Skip to content

Commit

Permalink
test-run.sh: Assert that fd redirections pass through into the app
Browse files Browse the repository at this point in the history
Before the previous commit, this would normally work, but would fail if
we had FLATPAK_TEST_COVERAGE=1 in the environment.

Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv committed Feb 13, 2024
1 parent 48caf88 commit 3a297d8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set -euo pipefail
skip_without_bwrap
skip_revokefs_without_fuse

echo "1..20"
echo "1..21"

# Use stable rather than master as the branch so we can test that the run
# command automatically finds the branch correctly
Expand Down Expand Up @@ -76,6 +76,13 @@ assert_file_has_content hello_out '^Hello world, from a sandbox$'

ok "hello"

true > value-in-sandbox
head value-in-sandbox >&2
run_sh org.test.Hello 'echo fd passthrough >&5' 5>value-in-sandbox
assert_file_has_content value-in-sandbox '^fd passthrough$'

ok "redirected fds can pass through to the app"

# XDG_RUNTIME_DIR is set to <temp directory>/runtime by libtest.sh,
# so we always have the necessary setup to reproduce #4372
assert_not_streq "$XDG_RUNTIME_DIR" "/run/user/$(id -u)"
Expand Down

0 comments on commit 3a297d8

Please sign in to comment.