tests: ignore empty cgroup

My latest Vagrant box contains an empty cgroup name that isn't used for
isolation:

```
$ cat /proc/self/cgroup  | grep ::
0::/user.slice/user-1000.slice/session-17.scope
```
This commit is contained in:
Mahmood Ali 2020-09-30 12:01:39 -04:00
parent eb5ff115a5
commit cd060db42a
2 changed files with 5 additions and 3 deletions

View File

@ -570,7 +570,7 @@ func TestExecDriver_HandlerExec(t *testing.T) {
}
// Skip rdma subsystem; rdma was added in most recent kernels and libcontainer/docker
// don't isolate it by default.
if strings.Contains(line, ":rdma:") {
if strings.Contains(line, ":rdma:") || strings.Contains(line, "::") {
continue
}
if !strings.Contains(line, ":/nomad/") {

View File

@ -206,7 +206,9 @@ func TestExecutor_CgroupPaths(t *testing.T) {
// Skip rdma subsystem; rdma was added in most recent kernels and libcontainer/docker
// don't isolate it by default.
if strings.Contains(line, ":rdma:") {
// :: filters out odd empty cgroup found in latest Ubuntu lines, e.g. 0::/user.slice/user-1000.slice/session-17.scope
// that is also not used for isolation
if strings.Contains(line, ":rdma:") || strings.Contains(line, "::") {
continue
}
@ -260,7 +262,7 @@ func TestExecutor_CgroupPathsAreDestroyed(t *testing.T) {
// Skip rdma subsystem; rdma was added in most recent kernels and libcontainer/docker
// don't isolate it by default.
if strings.Contains(line, ":rdma:") {
if strings.Contains(line, ":rdma:") || strings.Contains(line, "::") {
continue
}