Skip to content

Commit

Permalink
tests: Fix weird error on centos-9
Browse files Browse the repository at this point in the history
centos-9 unit test sometimes fails with:

	=== RUN   TestPodSkipDevicesUpdate
	    systemd_test.go:114: container stderr not empty: basename: missing operand
	        Try 'basename --help' for more information.
	--- FAIL: TestPodSkipDevicesUpdate (0.11s)

I'm not sure why the container output is an error in basename. It seems
likely that the bashrc in that distro is kind of broken. Let's just run
a sleep command and forget about bash.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
  • Loading branch information
rata committed Feb 10, 2023
1 parent 5c2a1a0 commit 4d0a60c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcontainer/cgroups/devices/systemd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestPodSkipDevicesUpdate(t *testing.T) {

// Create a "container" within the "pod" cgroup.
// This is not a real container, just a process in the cgroup.
cmd := exec.Command("bash", "-c", "while true; do echo > /dev/null; done")
cmd := exec.Command("sleep", "infinity")
cmd.Env = append(os.Environ(), "LANG=C")
var stderr bytes.Buffer
cmd.Stderr = &stderr
Expand Down

0 comments on commit 4d0a60c

Please sign in to comment.