File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -316,12 +316,21 @@ pkgs.nixosTest {
316316 (echo 'Unexpected: whoami seems to work in sandbox'; false)
317317 """))
318318
319+ with subtest("-u exposes username in sandbox, whoami does work"):
320+ machine.succeed(as_alice("""
321+ # ensure `whoami` works outside sandbox
322+ whoami | grep 'alice' ||
323+ (echo 'Unexpected: whoami does not work outside sandbox'; false)
324+
325+ # ensure `whoami` does work in sandbox
326+ wrap -u whoami ||
327+ (echo 'Unexpected: whoami does not work in sandbox'; false)
328+
329+ wrap -u whoami | grep "^alice$" ||
330+ (echo 'Unexpected: whoami does not return username in sandbox'; false)
331+ """))
332+
319333
320- # with subtest("u-exposes-user-name"):
321- # print(machine.succeed(as_alice("""
322- # wrap -u whoami
323- # """)))
324- #
325334 # with subtest("env-wayland-display-is-hidden"):
326335 # print(machine.succeed(as_alice("""
327336 # WAYLAND_DISPLAY=wl-0 wrap bash -c 'set -u; echo $WAYLAND_DISPLAY' 2> error-msg || true
You can’t perform that action at this time.
0 commit comments