Improved regex to avoid matching timer/target services

This commit is contained in:
Alexandre Aubin 2021-01-07 18:43:58 +01:00
parent 2650e4cc4b
commit 360da39e15

View file

@ -1367,7 +1367,7 @@ class Script(TestSuite):
@test() @test()
def raw_systemctl_start(self): def raw_systemctl_start(self):
if self.containsregex(r'systemctl start [^. ]+(\.service)?'): if self.containsregex(r'systemctl start \"?[^. ]+(\.service)?\"?\s'):
yield Warning("Please do not use 'systemctl start' to start services. Instead, you should use ynh_systemd_action which will display the service log in case it fails to start. You can also use --line_match to wait until some specific word appear in the log, signaling the service indeed fully started.") yield Warning("Please do not use 'systemctl start' to start services. Instead, you should use ynh_systemd_action which will display the service log in case it fails to start. You can also use --line_match to wait until some specific word appear in the log, signaling the service indeed fully started.")
@test() @test()