Skip to content

Commit 670e597

Browse files
L3n41cgitster
authored andcommitted
maintenance: fix test t7900-maintenance.sh
Commit b681b19 introduced the support of systemd timers for git maintenance. A test is leveraging the `systemd-analyze verify` utility to verify the correctness of the systemd unit files generated by git. But on some systems, although the `systemd-analyze` tool is installed and supports the `verify` subcommand, it fails with some permission errors. So, instead of only checking if the `verify` subcommand exists, a more reliable way of detecting whether `systemd-analyze verify` can be used is to try to use it. The SYSTEMD_ANALYZE prerequisite is now trying to run `systemd-analyze verify` on a systemd unit file which is shipped by systemd itself. We can reasonably think that, on systemd hosts, this file is present and valid. Signed-off-by: Lénaïc Huard <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b681b19 commit 670e597

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

t/t7900-maintenance.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ test_xmllint () {
2121
}
2222

2323
test_lazy_prereq SYSTEMD_ANALYZE '
24-
systemd-analyze --help >out &&
25-
grep verify out
24+
systemd-analyze verify /lib/systemd/system/basic.target
2625
'
2726

2827
test_systemd_analyze_verify () {

0 commit comments

Comments
 (0)