From f707a02f4d61fa391fd71b17d21dfde575e30197 Mon Sep 17 00:00:00 2001 From: Juanadelacuesta <8647634+Juanadelacuesta@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:26:55 +0100 Subject: [PATCH] fix: update test to force recreation of idvalidator --- drivers/rawexec/driver_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/rawexec/driver_test.go b/drivers/rawexec/driver_test.go index af33a17af..8c9a5e56e 100644 --- a/drivers/rawexec/driver_test.go +++ b/drivers/rawexec/driver_test.go @@ -117,20 +117,27 @@ func TestRawExecDriver_SetConfig(t *testing.T) { // Enable raw_exec, but disable cgroups. config.Enabled = true data = []byte{} + must.NoError(t, basePlug.MsgPackEncode(&data, config)) bconfig.PluginConfig = data + must.NoError(t, harness.SetConfig(bconfig)) must.Eq(t, config, d.(*Driver).config) - // Turns on uid/gid restrictions, and sets the range to a bad value + // Turns on uid/gid restrictions, and sets the range to a bad value and + // force the recreation of the validator. + d.(*Driver).userIDValidator = nil config.DeniedHostUidsStr = "100-1" data = []byte{} + must.NoError(t, basePlug.MsgPackEncode(&data, config)) + bconfig.PluginConfig = data err := harness.SetConfig(bconfig) must.Error(t, err) must.ErrorContains(t, err, "invalid range deniedHostUIDs \"100-1\": lower bound cannot be greater than upper bound") + } func TestRawExecDriver_Fingerprint(t *testing.T) {