test: use XDG_STATE_HOME for %S and %L
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 Jul 2023 07:07:58 +0000 (16:07 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 20 Jul 2023 11:54:54 +0000 (12:54 +0100)
commitb0efbe9b81cdae8544fbc58422f81513adc68d9a
treef895c6448355548834ea0a6b8dd6e93b674b8494
parent4fc925a0268cff33497f8969ff516880f589c782
test: use XDG_STATE_HOME for %S and %L

This fixes the test failure when invoked by a user.
===
Running ./systemd-tmpfiles --user on 'f /tmp/test-systemd-tmpfiles.1foag_ur/test-content.n_9r_xhm/arg - - - - %S'
expect: '/home/watanabe/.config'
actual: '/home/watanabe/.local/state'
Traceback (most recent call last):
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 233, in <module>
    test_valid_specifiers(user=True)
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 135, in test_valid_specifiers
    test_content('f {} - - - - %S',
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 88, in test_content
    assert content == expected
           ^^^^^^^^^^^^^^^^^^^
AssertionError
===

This also makes the test uses fallback paths.

Follow-up for b50aadaff22f9b3ad3bbcbfd2edd661456a5b4bf.
test/test-systemd-tmpfiles.py