runtime: fix go test case

reload removed kernel modules to later testcases

Signed-off-by: Balint Tobik <btobik@redhat.com>
This commit is contained in:
Balint Tobik 2025-04-30 16:35:38 +02:00
parent a4d3f813c2
commit e1805eceda

View File

@ -348,6 +348,15 @@ func TestCheckHostIsVMContainerCapable(t *testing.T) {
defer func() {
os.Remove(denylistModuleConf)
// reload removed modules
for mod := range archRequiredKernelModules {
cmd := exec.Command(modProbeCmd, mod)
if output, err := cmd.CombinedOutput(); err == nil {
kataLog.WithField("output", string(output)).Info("module loaded")
} else {
kataLog.WithField("output", string(output)).Warn("failed to load module")
}
}
}()
// remove the modules to force a failure