test: make the output of TEST-69 less painful to read
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 11 Apr 2024 09:35:17 +0000 (11:35 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 11 Apr 2024 09:35:17 +0000 (11:35 +0200)
The logs from TEST-69 still contain a lot of unnecessary shell
metacharacters, so to make the output more readable let's just set
TERM=dumb, instead of having to strip everything semi-manually. Also,
move the related --background= tweak to TEST-69, since it's relevant
only for that particular test.

Follow-up for 8d4bfd38ed941aa8003d7007145eccc01f52a5f6.

test/TEST-69-SHUTDOWN/test.sh
test/test-functions
test/test-shutdown.py

index 0e12857618d94be0cfe78925ab066c5a10ff8cfe..0229d896d4168dd32eca13894443a85c352dcf28 100755 (executable)
@@ -17,7 +17,7 @@ SYSTEMD_NSPAWN="${STATEDIR:?}/run-nspawn"
 setup_nspawn_root_hook() {
     cat >"${STATEDIR:?}/run-nspawn" <<EOF
 #!/bin/bash
-exec "${TEST_BASE_DIR:?}/test-shutdown.py" -v -- "$_ORIG_NSPAWN" "\$@"
+exec "${TEST_BASE_DIR:?}/test-shutdown.py" -v -- "$_ORIG_NSPAWN" --background= "\$@"
 exit 1
 EOF
     chmod 755 "${STATEDIR:?}"/run-nspawn
index 33575d3b3aefd08bf2b88c1702494b0cef8726eb..c62cf3d52182796088e53f58fc30b1426d0de1f1 100644 (file)
@@ -662,7 +662,6 @@ run_nspawn() {
         "--directory=${1:?}"
         "--setenv=SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-$2.units:/usr/lib/systemd/tests/testdata/units:"
         "--machine=TEST-$TESTID"
-        "--background=''"
     )
     local kernel_params=(
         "$PATH_TO_INIT"
index 870c1e269f596e5de5523a50fd6d8f83f7f36e69..d19a03742c246f6c5cd2f2b40da28be601f38d21 100755 (executable)
@@ -12,7 +12,6 @@ import pexpect
 
 
 def run(args):
-
     ret = 1
     logger = logging.getLogger("test-shutdown")
     logfile = None
@@ -25,7 +24,7 @@ def run(args):
 
     logger.info("spawning test")
     console = pexpect.spawn(args.command, args.arg, logfile=logfile, env={
-            "TERM": "linux",
+            "TERM": "dumb",
         }, encoding='utf-8', timeout=60)
 
     logger.debug("child pid %d", console.pid)