mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +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"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/opencontainers/runc/internal/testutil"
|
|
||||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||||
"github.com/opencontainers/runc/libcontainer/cgroups/systemd"
|
"github.com/opencontainers/runc/libcontainer/cgroups/systemd"
|
||||||
"github.com/opencontainers/runc/libcontainer/configs"
|
"github.com/opencontainers/runc/libcontainer/configs"
|
||||||
@@ -27,8 +26,6 @@ func TestPodSkipDevicesUpdate(t *testing.T) {
|
|||||||
if os.Geteuid() != 0 {
|
if os.Geteuid() != 0 {
|
||||||
t.Skip("Test requires root.")
|
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"
|
podName := "system-runc_test_pod" + t.Name() + ".slice"
|
||||||
podConfig := &configs.Cgroup{
|
podConfig := &configs.Cgroup{
|
||||||
@@ -126,8 +123,6 @@ func testSkipDevices(t *testing.T, skipDevices bool, expected []string) {
|
|||||||
if os.Geteuid() != 0 {
|
if os.Geteuid() != 0 {
|
||||||
t.Skip("Test requires root.")
|
t.Skip("Test requires root.")
|
||||||
}
|
}
|
||||||
// https://github.com/opencontainers/runc/issues/3743.
|
|
||||||
testutil.SkipOnCentOS(t, "Flaky (#3743)", 7)
|
|
||||||
|
|
||||||
podConfig := &configs.Cgroup{
|
podConfig := &configs.Cgroup{
|
||||||
Parent: "system.slice",
|
Parent: "system.slice",
|
||||||
|
|||||||
@@ -8,13 +8,9 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencontainers/runc/internal/testutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWriteCgroupFileHandlesInterrupt(t *testing.T) {
|
func TestWriteCgroupFileHandlesInterrupt(t *testing.T) {
|
||||||
testutil.SkipOnCentOS(t, "Flaky (see #3418)", 7)
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
memoryCgroupMount = "/sys/fs/cgroup/memory"
|
memoryCgroupMount = "/sys/fs/cgroup/memory"
|
||||||
memoryLimit = "memory.limit_in_bytes"
|
memoryLimit = "memory.limit_in_bytes"
|
||||||
|
|||||||
Reference in New Issue
Block a user