diff options
author | Danila Kiver <danila.kiver@mail.ru> | 2019-09-15 21:28:13 +0300 |
---|---|---|
committer | Danila Kiver <danila.kiver@mail.ru> | 2019-09-15 21:28:13 +0300 |
commit | c06661f041f0fcef4bed0f44feecef1e1a5abe3e (patch) | |
tree | 60e1dfaf2163c298aef74a05479b6f8d6ea5f76b /pkg/spec | |
parent | 8ac57b48e1220490716d7281b140c2d96746fb02 (diff) | |
download | podman-c06661f041f0fcef4bed0f44feecef1e1a5abe3e.tar.gz podman-c06661f041f0fcef4bed0f44feecef1e1a5abe3e.tar.bz2 podman-c06661f041f0fcef4bed0f44feecef1e1a5abe3e.zip |
Check for rootless before checking cgroups version in spec_test.
Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
Diffstat (limited to 'pkg/spec')
-rw-r--r-- | pkg/spec/spec_test.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/pkg/spec/spec_test.go b/pkg/spec/spec_test.go index 54d964a3a..2f91e1b21 100644 --- a/pkg/spec/spec_test.go +++ b/pkg/spec/spec_test.go @@ -36,13 +36,15 @@ func doCommonSkipChecks(t *testing.T) { t.Skip("seccomp, which is enabled by default, is only supported on Linux") } - isUnified, err := cgroups.IsCgroup2UnifiedMode() - if err != nil { - t.Errorf("unexpected error: %v", err) - } - - if rootless.IsRootless() && !isUnified { - t.Skip("cgroups v1 cannot be used when rootless") + if rootless.IsRootless() { + isCgroupV2, err := cgroups.IsCgroup2UnifiedMode() + if err != nil { + t.Errorf("unexpected error: %v", err) + } + + if !isCgroupV2 { + t.Skip("cgroups v1 cannot be used when rootless") + } } } |