mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-10 19:19:04 -04:00
tests: Check that we handle XDG_foo_HOME as intended
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
committed by
Alexander Larsson
parent
3acdb37fc6
commit
a3464bebb7
@@ -24,7 +24,7 @@ set -euo pipefail
|
||||
skip_without_bwrap
|
||||
skip_revokefs_without_fuse
|
||||
|
||||
echo "1..19"
|
||||
echo "1..20"
|
||||
|
||||
# Use stable rather than master as the branch so we can test that the run
|
||||
# command automatically finds the branch correctly
|
||||
@@ -83,6 +83,40 @@ assert_file_has_content value-in-sandbox "^/run/user/$(id -u)\$"
|
||||
|
||||
ok "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR not inherited"
|
||||
|
||||
assert_streq "$XDG_CACHE_HOME" "${TEST_DATA_DIR}/home/cache"
|
||||
run_sh org.test.Hello 'echo "$XDG_CACHE_HOME"' > value-in-sandbox
|
||||
head value-in-sandbox >&2
|
||||
assert_file_has_content value-in-sandbox "^${TEST_DATA_DIR}/home/\\.var/app/org\\.test\\.Hello/cache\$"
|
||||
run_sh org.test.Hello 'echo "$HOST_XDG_CACHE_HOME"' > host-value-in-sandbox
|
||||
head host-value-in-sandbox >&2
|
||||
assert_file_has_content host-value-in-sandbox "^${TEST_DATA_DIR}/home/cache\$"
|
||||
|
||||
assert_streq "$XDG_CONFIG_HOME" "${TEST_DATA_DIR}/home/config"
|
||||
run_sh org.test.Hello 'echo "$XDG_CONFIG_HOME"' > value-in-sandbox
|
||||
head value-in-sandbox >&2
|
||||
assert_file_has_content value-in-sandbox "^${TEST_DATA_DIR}/home/\\.var/app/org\\.test\\.Hello/config\$"
|
||||
run_sh org.test.Hello 'echo "$HOST_XDG_CONFIG_HOME"' > host-value-in-sandbox
|
||||
head host-value-in-sandbox >&2
|
||||
assert_file_has_content host-value-in-sandbox "^${TEST_DATA_DIR}/home/config\$"
|
||||
|
||||
assert_streq "$XDG_DATA_HOME" "${TEST_DATA_DIR}/home/share"
|
||||
run_sh org.test.Hello 'echo "$XDG_DATA_HOME"' > value-in-sandbox
|
||||
head value-in-sandbox >&2
|
||||
assert_file_has_content value-in-sandbox "^${TEST_DATA_DIR}/home/\\.var/app/org\\.test\\.Hello/data\$"
|
||||
run_sh org.test.Hello 'echo "$HOST_XDG_DATA_HOME"' > host-value-in-sandbox
|
||||
head host-value-in-sandbox >&2
|
||||
assert_file_has_content host-value-in-sandbox "^${TEST_DATA_DIR}/home/share\$"
|
||||
|
||||
assert_streq "$XDG_STATE_HOME" "${TEST_DATA_DIR}/home/state"
|
||||
run_sh org.test.Hello 'echo "$XDG_STATE_HOME"' > value-in-sandbox
|
||||
head value-in-sandbox >&2
|
||||
assert_file_has_content value-in-sandbox "^${TEST_DATA_DIR}/home/\\.var/app/org\\.test\\.Hello/\\.local/state\$"
|
||||
run_sh org.test.Hello 'echo "$HOST_XDG_STATE_HOME"' > host-value-in-sandbox
|
||||
head host-value-in-sandbox >&2
|
||||
assert_file_has_content host-value-in-sandbox "^${TEST_DATA_DIR}/home/state\$"
|
||||
|
||||
ok "XDG_foo_HOME work as expected"
|
||||
|
||||
run_sh org.test.Platform cat /.flatpak-info >runtime-fpi
|
||||
assert_file_has_content runtime-fpi "[Runtime]"
|
||||
assert_file_has_content runtime-fpi "^runtime=runtime/org\.test\.Platform/$ARCH/stable$"
|
||||
|
||||
Reference in New Issue
Block a user