Skip to content

Commit 22809e4

Browse files
committed
validation: skip the cgroup v1 only resource tests
linux.resources.network and linux.resources.devices have no counterpart in the unified hierarchy at all. net_cls and net_prio were never ported, and device access is enforced by an eBPF program that cannot be read back from the filesystem, so there is nothing for these tests to compare the configuration against. Skip the four tests where the host runs a unified hierarchy, the way the suite already skips tests that do not apply to the platform it runs on. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
1 parent 7358f92 commit 22809e4

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

‎validation/linux_cgroups_devices/linux_cgroups_devices.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package main
22

33
import (
4+
"os"
5+
46
"github.com/mndrix/tap-go"
57
"github.com/opencontainers/runtime-tools/cgroups"
68
"github.com/opencontainers/runtime-tools/validation/util"
@@ -9,6 +11,11 @@ import (
911
func main() {
1012
var major1, minor1, major2, minor2, major3, minor3 int64 = 10, 229, 8, 20, 10, 200
1113

14+
if util.UnifiedCgroups() {
15+
util.Skip("cgroup v1 specific linux.resources.devices test", nil)
16+
os.Exit(0)
17+
}
18+
1219
t := tap.New()
1320
t.Header(0)
1421
defer t.AutoPlan()

‎validation/linux_cgroups_network/linux_cgroups_network.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"fmt"
55
"net"
6+
"os"
67
"runtime"
78

89
"github.com/mndrix/tap-go"
@@ -102,6 +103,11 @@ func main() {
102103
util.Fatal(fmt.Errorf("linux-specific cgroup test"))
103104
}
104105

106+
if util.UnifiedCgroups() {
107+
util.Skip("cgroup v1 specific linux.resources.network test", nil)
108+
os.Exit(0)
109+
}
110+
105111
if err := testNetworkCgroups(); err != nil {
106112
util.Fatal(err)
107113
}

‎validation/linux_cgroups_relative_devices/linux_cgroups_relative_devices.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package main
22

33
import (
4+
"os"
5+
46
"github.com/mndrix/tap-go"
57
"github.com/opencontainers/runtime-tools/cgroups"
68
"github.com/opencontainers/runtime-tools/validation/util"
@@ -9,6 +11,11 @@ import (
911
func main() {
1012
var major1, minor1, major2, minor2, major3, minor3 int64 = 10, 229, 8, 20, 10, 200
1113

14+
if util.UnifiedCgroups() {
15+
util.Skip("cgroup v1 specific linux.resources.devices test", nil)
16+
os.Exit(0)
17+
}
18+
1219
t := tap.New()
1320
t.Header(0)
1421
defer t.AutoPlan()

‎validation/linux_cgroups_relative_network/linux_cgroups_relative_network.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package main
22

33
import (
4+
"os"
5+
46
"github.com/mndrix/tap-go"
57
"github.com/opencontainers/runtime-tools/cgroups"
68
"github.com/opencontainers/runtime-tools/validation/util"
@@ -10,6 +12,11 @@ func main() {
1012
var id, prio uint32 = 255, 10
1113
ifName := "lo"
1214

15+
if util.UnifiedCgroups() {
16+
util.Skip("cgroup v1 specific linux.resources.network test", nil)
17+
os.Exit(0)
18+
}
19+
1320
t := tap.New()
1421
t.Header(0)
1522
defer t.AutoPlan()

0 commit comments

Comments
 (0)