diff --git a/cli/kata-check_amd64_test.go b/cli/kata-check_amd64_test.go index 78ed52f63..bf2bbedd0 100644 --- a/cli/kata-check_amd64_test.go +++ b/cli/kata-check_amd64_test.go @@ -171,6 +171,7 @@ func TestCheckCheckKernelModulesNoNesting(t *testing.T) { "nested": "Y", "unrestricted_guest": "Y", }, + required: true, }, } @@ -255,6 +256,7 @@ func TestCheckCheckKernelModulesNoUnrestrictedGuest(t *testing.T) { "nested": "Y", "unrestricted_guest": "Y", }, + required: true, }, } diff --git a/cli/kata-check_test.go b/cli/kata-check_test.go index 418a6635b..29767a926 100644 --- a/cli/kata-check_test.go +++ b/cli/kata-check_test.go @@ -502,6 +502,7 @@ func TestCheckCheckKernelModules(t *testing.T) { "foo": { desc: "desc", parameters: map[string]string{}, + required: true, }, "bar": { desc: "desc", @@ -511,6 +512,7 @@ func TestCheckCheckKernelModules(t *testing.T) { "param3": "a", "param4": ".", }, + required: true, }, } @@ -570,6 +572,7 @@ func TestCheckCheckKernelModulesUnreadableFile(t *testing.T) { parameters: map[string]string{ "param1": "wibble", }, + required: true, }, } @@ -617,6 +620,7 @@ func TestCheckCheckKernelModulesInvalidFileContents(t *testing.T) { parameters: map[string]string{ "param1": "wibble", }, + required: true, }, } @@ -713,6 +717,7 @@ func TestCheckKernelParamHandler(t *testing.T) { "foo": { desc: "desc", parameters: map[string]string{}, + required: true, }, "bar": { desc: "desc", @@ -720,6 +725,7 @@ func TestCheckKernelParamHandler(t *testing.T) { "param1": "hello", "param2": "world", }, + required: true, }, } @@ -731,6 +737,7 @@ func TestCheckKernelParamHandler(t *testing.T) { parameters: map[string]string{ "param1": "moo", }, + required: true, }, } @@ -740,6 +747,7 @@ func TestCheckKernelParamHandler(t *testing.T) { parameters: map[string]string{ "param1": "bar", }, + required: true, }, } diff --git a/pkg/katautils/config_test.go b/pkg/katautils/config_test.go index ef296c488..883818d80 100644 --- a/pkg/katautils/config_test.go +++ b/pkg/katautils/config_test.go @@ -719,13 +719,10 @@ func TestMinimalRuntimeConfigWithVsock(t *testing.T) { [agent.kata] ` orgVHostVSockDevicePath := utils.VHostVSockDevicePath - orgVSockDevicePath := utils.VSockDevicePath defer func() { utils.VHostVSockDevicePath = orgVHostVSockDevicePath - utils.VSockDevicePath = orgVSockDevicePath }() utils.VHostVSockDevicePath = "/dev/null" - utils.VSockDevicePath = "/dev/null" configPath := path.Join(dir, "runtime.toml") err = createConfig(configPath, runtimeMinimalConfig) @@ -765,13 +762,10 @@ func TestNewQemuHypervisorConfig(t *testing.T) { disableBlock := true enableIOThreads := true hotplugVFIOOnRootBus := true - orgVSockDevicePath := utils.VSockDevicePath orgVHostVSockDevicePath := utils.VHostVSockDevicePath defer func() { - utils.VSockDevicePath = orgVSockDevicePath utils.VHostVSockDevicePath = orgVHostVSockDevicePath }() - utils.VSockDevicePath = "/dev/abc/xyz" utils.VHostVSockDevicePath = "/dev/abc/xyz" hypervisor := hypervisor{ @@ -808,7 +802,6 @@ func TestNewQemuHypervisorConfig(t *testing.T) { t.Fatal(err) } - utils.VSockDevicePath = "/dev/null" utils.VHostVSockDevicePath = "/dev/null" // all paths exist now diff --git a/virtcontainers/utils/utils_test.go b/virtcontainers/utils/utils_test.go index 5403e9c94..aef5e2e22 100644 --- a/virtcontainers/utils/utils_test.go +++ b/virtcontainers/utils/utils_test.go @@ -298,25 +298,14 @@ func TestBuildSocketPath(t *testing.T) { func TestSupportsVsocks(t *testing.T) { assert := assert.New(t) - orgVSockDevicePath := VSockDevicePath orgVHostVSockDevicePath := VHostVSockDevicePath defer func() { - VSockDevicePath = orgVSockDevicePath VHostVSockDevicePath = orgVHostVSockDevicePath }() - VSockDevicePath = "/abc/xyz/123" VHostVSockDevicePath = "/abc/xyz/123" assert.False(SupportsVsocks()) - vSockDeviceFile, err := ioutil.TempFile("", "vsock") - assert.NoError(err) - defer os.Remove(vSockDeviceFile.Name()) - defer vSockDeviceFile.Close() - VSockDevicePath = vSockDeviceFile.Name() - - assert.False(SupportsVsocks()) - vHostVSockFile, err := ioutil.TempFile("", "vhost-vsock") assert.NoError(err) defer os.Remove(vHostVSockFile.Name())