* [PATCH 0/1] maintenance: fix test t7900-maintenance.sh
@ 2021-09-27 21:30 Lénaïc Huard
2021-09-27 21:30 ` [PATCH 1/1] " Lénaïc Huard
0 siblings, 1 reply; 2+ messages in thread
From: Lénaïc Huard @ 2021-09-27 21:30 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Derrick Stolee, Derrick Stolee, Eric Sunshine,
Ævar Arnfjörð Bjarmason, Lénaïc Huard
The test t7900-maintenance.sh seems to be currently broken on the
master branch on some platforms.
Since commit b681b191, one of the test leverages `systemd-analyze
verify` utility to check the correctness of systemd unit files
generated by git.
But, whereas it works on Arch Linux with a recent version of systemd,
it fails on Ubuntu 18.04 and systemd 237 with this error [1]:
Failed to create /user.slice/user-1000.slice/session-44.scope/init.scope control group: Permission denied
Failed to initialize manager: Permission denied
It also fails on CentOS 7.9 and systemd 219 with this error [2]:
Failed to open /dev/tty0: Permission denied
Failed to load systemd/user/git-maintenance@.service: Invalid argument
This patch changes the prerequisite used in the test to check if
`system-analyze verify` can be used.
As a result, this step should be now skipped on the two
above-mentioned platforms instead of making the test fail.
[1] https://lore.kernel.org/git/4c0c1fd4-f3f4-5e3a-abd2-0350c18b18b7@gmail.com/
[2] https://lore.kernel.org/git/874ka618n4.fsf@evledraar.gmail.com/
Lénaïc Huard (1):
maintenance: fix test t7900-maintenance.sh
t/t7900-maintenance.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] maintenance: fix test t7900-maintenance.sh
2021-09-27 21:30 [PATCH 0/1] maintenance: fix test t7900-maintenance.sh Lénaïc Huard
@ 2021-09-27 21:30 ` Lénaïc Huard
0 siblings, 0 replies; 2+ messages in thread
From: Lénaïc Huard @ 2021-09-27 21:30 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Derrick Stolee, Derrick Stolee, Eric Sunshine,
Ævar Arnfjörð Bjarmason, Lénaïc Huard
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-27 21:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27 21:30 [PATCH 0/1] maintenance: fix test t7900-maintenance.sh Lénaïc Huard
2021-09-27 21:30 ` [PATCH 1/1] " Lénaïc Huard
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).