git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/1] maintenance: fix test t7900-maintenance.sh

From
Lénaïc Huard <lenaic@lhuard.fr>
Date
Sep 27, 2021, 21:30 UTC
Message-ID
<20210927213016.21714-2-lenaic@lhuard.fr>
In-Reply-To
<20210927213016.21714-1-lenaic@lhuard.fr>

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 <lenaic@lhuard.fr>
---
 t/t7900-maintenance.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 36a4218745..6b4941980c 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 () {
-- 
2.33.0
Previous: Lénaïc Huard
Message 2 of 2 in “maintenance: fix test t7900-maintenance.sh”
  1. 0/1 maintenance: fix test t7900-maintenance.shLénaïc Huard, Sep 27, 2021
  2. 1/1 maintenance: fix test t7900-maintenance.shLénaïc Huard, Sep 27, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.