mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-26 19:41:35 +08:00
Merge pull request #4511 from kolyshkin/rm-internal-testutil
ci: rm "skip on CentOS 7" kludges
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
@@ -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",
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user