From 9cb59b46590329861c3e5701326821a7c613178c Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 4 Nov 2024 18:05:41 -0800 Subject: [PATCH] ci: rm "skip on CentOS 7" kludges We no longer test on CentOS 7. Remove the internal/testutil package as it has no other uses. Signed-off-by: Kir Kolyshkin --- internal/testutil/testutil.go | 30 -------------------- libcontainer/cgroups/devices/systemd_test.go | 5 ---- libcontainer/cgroups/file_test.go | 4 --- 3 files changed, 39 deletions(-) delete mode 100644 internal/testutil/testutil.go diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go deleted file mode 100644 index 9df3ed1f6..000000000 --- a/internal/testutil/testutil.go +++ /dev/null @@ -1,30 +0,0 @@ -package testutil - -import ( - "os/exec" - "strconv" - "sync" - "testing" -) - -var ( - centosVer string - centosVerOnce sync.Once -) - -func centosVersion() string { - centosVerOnce.Do(func() { - ver, _ := exec.Command("rpm", "-q", "--qf", "%{version}", "centos-release").CombinedOutput() - centosVer = string(ver) - }) - return centosVer -} - -func SkipOnCentOS(t *testing.T, reason string, versions ...int) { - t.Helper() - for _, v := range versions { - if vstr := strconv.Itoa(v); centosVersion() == vstr { - t.Skip(reason + " on CentOS " + vstr) - } - } -} diff --git a/libcontainer/cgroups/devices/systemd_test.go b/libcontainer/cgroups/devices/systemd_test.go index 7bae2f740..2ab4b2535 100644 --- a/libcontainer/cgroups/devices/systemd_test.go +++ b/libcontainer/cgroups/devices/systemd_test.go @@ -8,7 +8,6 @@ import ( "strings" "testing" - "github.com/opencontainers/runc/internal/testutil" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/systemd" "github.com/opencontainers/runc/libcontainer/configs" @@ -27,8 +26,6 @@ func TestPodSkipDevicesUpdate(t *testing.T) { if os.Geteuid() != 0 { t.Skip("Test requires root.") } - // https://github.com/opencontainers/runc/issues/3743. - testutil.SkipOnCentOS(t, "Flaky (#3743)", 7) podName := "system-runc_test_pod" + t.Name() + ".slice" podConfig := &configs.Cgroup{ @@ -126,8 +123,6 @@ func testSkipDevices(t *testing.T, skipDevices bool, expected []string) { if os.Geteuid() != 0 { t.Skip("Test requires root.") } - // https://github.com/opencontainers/runc/issues/3743. - testutil.SkipOnCentOS(t, "Flaky (#3743)", 7) podConfig := &configs.Cgroup{ Parent: "system.slice", diff --git a/libcontainer/cgroups/file_test.go b/libcontainer/cgroups/file_test.go index 5ce438380..3a9fac329 100644 --- a/libcontainer/cgroups/file_test.go +++ b/libcontainer/cgroups/file_test.go @@ -8,13 +8,9 @@ import ( "strconv" "testing" "time" - - "github.com/opencontainers/runc/internal/testutil" ) func TestWriteCgroupFileHandlesInterrupt(t *testing.T) { - testutil.SkipOnCentOS(t, "Flaky (see #3418)", 7) - const ( memoryCgroupMount = "/sys/fs/cgroup/memory" memoryLimit = "memory.limit_in_bytes"