virtcontainers: tests: Ensure Linux specific tests are just run on Linux

Fixes: #5993

Several tests utilize linux'isms like Mounts, bindmounts, vsock etc.

Let's ensure that these are still tested on Linux, but that we also skip
these tests when on other operating systems (Darwin). This commit just
moves tests; there shouldn't be any functional test changes. While the
tests still won't be runnable on Darwin/other hosts yet, this is a necessary
step forward.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
Signed-off-by: Danny Canter <danny@dcantah.dev>
This commit is contained in:
Eric Ernst
2022-06-11 10:47:20 +02:00
committed by Danny Canter
parent 31abe170fc
commit fafc7a8b1a
14 changed files with 605 additions and 510 deletions

View File

@@ -12,7 +12,6 @@ import (
"os"
"os/exec"
"path/filepath"
"syscall"
"testing"
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/fs"
@@ -54,16 +53,6 @@ var testVirtiofsdPath = ""
var testHyperstartCtlSocket = ""
var testHyperstartTtySocket = ""
// cleanUp Removes any stale sandbox/container state that can affect
// the next test to run.
func cleanUp() {
syscall.Unmount(GetSharePath(testSandboxID), syscall.MNT_DETACH|UmountNoFollow)
os.RemoveAll(testDir)
os.MkdirAll(testDir, DirMode)
setup()
}
func setup() {
os.Mkdir(filepath.Join(testDir, testBundle), DirMode)