Make sure wget is quiet

This commit is contained in:
Alexandre Aubin 2020-11-24 03:45:10 +01:00
parent c1f2bfe536
commit b00ef3d23c

View file

@ -1152,6 +1152,17 @@ class Script(TestSuite):
message = "Please add --quiet to systemctl enable/disable commands to avoid unecessary warnings when the script runs" message = "Please add --quiet to systemctl enable/disable commands to avoid unecessary warnings when the script runs"
yield Warning(message) if self.name in ["_common.sh", "install"] else Info(message) yield Warning(message) if self.name in ["_common.sh", "install"] else Info(message)
@test()
def quiet_wget(self):
wget_cmds = [line
for line in [' '.join(line) for line in self.lines]
if re.search(r"^wget ", line)]
if any(" -q " not in cmd and "--quiet" not in cmd and "2>" not in cmd for cmd in wget_cmds):
message = "Please redirect wget's stderr to stdout with 2>&1 to avoid unecessary warnings when the script runs (yes, wget is annoying and displays a warning even when things are going okay >_> ...)"
yield Warning(message) if self.name in ["_common.sh", "install"] else Info(message)
@test(only=["install"]) @test(only=["install"])
def argument_fetching(self): def argument_fetching(self):