Skip to content

Commit

Permalink
Move to 24.04 for docker integration testing
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Jul 5, 2024
1 parent 45e6d0b commit ccdcfe8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ jobs:
run: GO_VERSION="$(echo ${{ matrix.go-version }} | sed -e s/.x//)" make binaries

test-integration-docker-compatibility:
runs-on: ubuntu-22.04 # TODO: ubuntu-24.04
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/[email protected]
Expand Down
14 changes: 11 additions & 3 deletions cmd/nerdctl/container_run_cgroup_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,12 @@ func TestRunCgroupParent(t *testing.T) {
t.Parallel()
base := testutil.NewBase(t)
info := base.Info()
containerName := testutil.Identifier(t)
defer base.Cmd("rm", "-f", containerName).Run()

switch info.CgroupDriver {
case "none", "":
t.Skip("test requires cgroup driver")
}

containerName := testutil.Identifier(t)
t.Logf("Using %q cgroup driver", info.CgroupDriver)

parent := "/foobarbaz"
Expand All @@ -314,6 +312,13 @@ func TestRunCgroupParent(t *testing.T) {
parent = "foobarbaz.slice"
}

tearDown := func() {
base.Cmd("rm", "-f", containerName).Run()
}

tearDown()
t.Cleanup(tearDown)

// cgroup2 without host cgroup ns will just output 0::/ which doesn't help much to verify
// we got our expected path. This approach should work for both cgroup1 and 2, there will
// just be many more entries for cgroup1 as there'll be an entry per controller.
Expand All @@ -333,6 +338,9 @@ func TestRunCgroupParent(t *testing.T) {
expected := filepath.Join(parent, id)
if info.CgroupDriver == "systemd" {
expected = filepath.Join(parent, fmt.Sprintf("nerdctl-%s", id))
if base.Target == testutil.Docker {
expected = filepath.Join(parent, fmt.Sprintf("docker-%s", id))
}
}
base.Cmd("exec", containerName, "cat", "/proc/self/cgroup").AssertOutContains(expected)
}
Expand Down

0 comments on commit ccdcfe8

Please sign in to comment.