mirror of
https://github.com/containers/podman.git
synced 2025-09-10 15:46:07 +08:00
Update run tests to be skipped when not supported
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"github.com/containers/libpod/cmd/podman/shared"
|
||||
"github.com/containers/libpod/pkg/inspect"
|
||||
cc "github.com/containers/libpod/pkg/spec"
|
||||
"github.com/containers/libpod/pkg/sysinfo"
|
||||
"github.com/docker/go-units"
|
||||
ociv1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
spec "github.com/opencontainers/runtime-spec/specs-go"
|
||||
@ -16,6 +17,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
sysInfo = sysinfo.New(true)
|
||||
cmd = []string{"podman", "test", "alpine"}
|
||||
CLI *cliconfig.PodmanCommand
|
||||
)
|
||||
@ -100,6 +102,9 @@ func TestPIDsLimit(t *testing.T) {
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skip("seccomp, which is enabled by default, is only supported on Linux")
|
||||
}
|
||||
if !sysInfo.PidsLimit {
|
||||
t.Skip("running test not supported by the host system")
|
||||
}
|
||||
args := []string{"--pids-limit", "22"}
|
||||
a := createCLI(args)
|
||||
a.InputArgs = args
|
||||
@ -119,6 +124,9 @@ func TestBLKIOWeightDevice(t *testing.T) {
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skip("seccomp, which is enabled by default, is only supported on Linux")
|
||||
}
|
||||
if !sysInfo.BlkioWeightDevice {
|
||||
t.Skip("running test not supported by the host system")
|
||||
}
|
||||
args := []string{"--blkio-weight-device", "/dev/zero:100"}
|
||||
a := createCLI(args)
|
||||
a.InputArgs = args
|
||||
@ -137,6 +145,9 @@ func TestMemorySwap(t *testing.T) {
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skip("seccomp, which is enabled by default, is only supported on Linux")
|
||||
}
|
||||
if !sysInfo.SwapLimit {
|
||||
t.Skip("running test not supported by the host system")
|
||||
}
|
||||
args := []string{"--memory-swap", "45m", "--memory", "40m"}
|
||||
a := createCLI(args)
|
||||
a.InputArgs = args
|
||||
|
Reference in New Issue
Block a user