{"thread":{"id":"56593","subject":"[PATCH 0/1] maintenance: fix test t7900-maintenance.sh","startedAt":"2021-09-27T21:32:36Z","lastAt":"2021-09-27T21:32:38Z","messageCount":2,"participants":["Lénaïc Huard"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"437195","messageId":"20210927213016.21714-1-lenaic@lhuard.fr","threadId":"56593","inReplyTo":null,"subject":"[PATCH 0/1] maintenance: fix test t7900-maintenance.sh","fromName":"Lénaïc Huard","fromEmail":"lenaic@lhuard.fr","sentAt":"2021-09-27T21:30:15Z","receivedAt":"2021-09-27T21:32:36Z","isPatch":true,"sender":{"key":"lenaic@lhuard.fr","avatar":"https://avatars.githubusercontent.com/u/1437785?v=4"},"body":"The test t7900-maintenance.sh seems to be currently broken on the\nmaster branch on some platforms.\nSince commit b681b191, one of the test leverages `systemd-analyze\nverify` utility to check the correctness of systemd unit files\ngenerated by git.\n\nBut, whereas it works on Arch Linux with a recent version of systemd,\nit fails on Ubuntu 18.04 and systemd 237 with this error [1]:\n\n  Failed to create /user.slice/user-1000.slice/session-44.scope/init.scope control group: Permission denied\n  Failed to initialize manager: Permission denied\n\nIt also fails on CentOS 7.9 and systemd 219 with this error [2]:\n\n    Failed to open /dev/tty0: Permission denied\n    Failed to load systemd/user/git-maintenance@.service: Invalid argument\n\nThis patch changes the prerequisite used in the test to check if\n`system-analyze verify` can be used.\nAs a result, this step should be now skipped on the two\nabove-mentioned platforms instead of making the test fail.\n\n[1] https://lore.kernel.org/git/4c0c1fd4-f3f4-5e3a-abd2-0350c18b18b7@gmail.com/\n[2] https://lore.kernel.org/git/874ka618n4.fsf@evledraar.gmail.com/\n\nLénaïc Huard (1):\n  maintenance: fix test t7900-maintenance.sh\n\n t/t7900-maintenance.sh | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\n-- \n2.33.0\n\n"},{"id":"437196","messageId":"20210927213016.21714-2-lenaic@lhuard.fr","threadId":"56593","inReplyTo":"20210927213016.21714-1-lenaic@lhuard.fr","subject":"[PATCH 1/1] maintenance: fix test t7900-maintenance.sh","fromName":"Lénaïc Huard","fromEmail":"lenaic@lhuard.fr","sentAt":"2021-09-27T21:30:16Z","receivedAt":"2021-09-27T21:32:38Z","isPatch":true,"sender":{"key":"lenaic@lhuard.fr","avatar":"https://avatars.githubusercontent.com/u/1437785?v=4"},"body":"Commit b681b191 introduced the support of systemd timers for git\nmaintenance.\nA test is leveraging the `systemd-analyze verify` utility to verify the\ncorrectness of the systemd unit files generated by git.\n\nBut on some systems, although the `systemd-analyze` tool is installed\nand supports the `verify` subcommand, it fails with some permission\nerrors.\n\nSo, instead of only checking if the `verify` subcommand exists, a more\nreliable way of detecting whether `systemd-analyze verify` can be used\nis to try to use it.\n\nThe SYSTEMD_ANALYZE prerequisite is now trying to run `systemd-analyze\nverify` on a systemd unit file which is shipped by systemd itself.\nWe can reasonably think that, on systemd hosts, this file is present and\nvalid.\n\nSigned-off-by: Lénaïc Huard <lenaic@lhuard.fr>\n---\n t/t7900-maintenance.sh | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\nindex 36a4218745..6b4941980c 100755\n--- a/t/t7900-maintenance.sh\n+++ b/t/t7900-maintenance.sh\n@@ -21,8 +21,7 @@ test_xmllint () {\n }\n \n test_lazy_prereq SYSTEMD_ANALYZE '\n-\tsystemd-analyze --help >out &&\n-\tgrep verify out\n+\tsystemd-analyze verify /lib/systemd/system/basic.target\n '\n \n test_systemd_analyze_verify () {\n-- \n2.33.0\n\n"}]}