From: Lénaïc Huard Date: Mon, 27 Sep 2021 21:30:16 +0000 (+0200) Subject: maintenance: fix test t7900-maintenance.sh X-Git-Tag: v2.34.0-rc0~82^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=670e5973992b6126aa0841c3c6bc183f0cec749f;p=thirdparty%2Fgit.git maintenance: fix test t7900-maintenance.sh Commit b681b191 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 Signed-off-by: Junio C Hamano --- diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index b289cae6b9..1386756f0d 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -21,8 +21,7 @@ test_xmllint () { } test_lazy_prereq SYSTEMD_ANALYZE ' - systemd-analyze --help >out && - grep verify out + systemd-analyze verify /lib/systemd/system/basic.target ' test_systemd_analyze_verify () {