Skip to content

Commit 935ee8a

Browse files
committed
Fix TestRunApparmor: relax stdout matching to not fail when testing rootless
Signed-off-by: apostasie <[email protected]>
1 parent dbc0540 commit 935ee8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/nerdctl/container/container_run_security_linux_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ func TestRunApparmor(t *testing.T) {
182182
attrCurrentEnforceExpected := fmt.Sprintf("%s (enforce)\n", defaultProfile)
183183
base.Cmd("run", "--rm", testutil.AlpineImage, "cat", attrCurrentPath).AssertOutExactly(attrCurrentEnforceExpected)
184184
base.Cmd("run", "--rm", "--security-opt", "apparmor="+defaultProfile, testutil.AlpineImage, "cat", attrCurrentPath).AssertOutExactly(attrCurrentEnforceExpected)
185-
base.Cmd("run", "--rm", "--security-opt", "apparmor=unconfined", testutil.AlpineImage, "cat", attrCurrentPath).AssertOutExactly("unconfined\n")
186-
base.Cmd("run", "--rm", "--privileged", testutil.AlpineImage, "cat", attrCurrentPath).AssertOutExactly("unconfined\n")
185+
base.Cmd("run", "--rm", "--security-opt", "apparmor=unconfined", testutil.AlpineImage, "cat", attrCurrentPath).AssertOutContains("unconfined")
186+
base.Cmd("run", "--rm", "--privileged", testutil.AlpineImage, "cat", attrCurrentPath).AssertOutContains("unconfined")
187187
}
188188

189189
// TestRunSeccompCapSysPtrace tests https://github.com/containerd/nerdctl/issues/976

0 commit comments

Comments
 (0)