]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: drop redirection to tty in integration tests
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Oct 2019 06:45:12 +0000 (08:45 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Oct 2019 06:48:48 +0000 (08:48 +0200)
I *think* this was originally added to make it easier to see what was happening
in tests. Later we added the functionality to print the journal on failure, so
this redirection has stopped being useful.

In https://github.com/systemd/systemd/pull/13719#issuecomment-539292650
@filbranden shows that grep tries to write to stdout and fails. In general,
we should not assume that writing to the console it always possible. We have
special code to handle this in pid1 after all:

99    19:22:10.731965 fstat(1,  <unfinished ...>
99    19:22:10.731993 <... fstat resumed>{st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
99    19:22:10.732070 write(1, "ExecStartPost={ path=/bin/echo ; argv[]=/bin/echo ${4_four_ex} ; ignore_errors=no ; start_time=[Mon 2019-10-07 19:22:10 PDT] ; stop_time=[Mon 209-10-07 19:22:10 PDT] ; pid=97 ; code=exited ; status=0 }\n", 203) = -1 EIO (Input/output error)
99    19:22:10.732174 write(2, "grep: ", 6) = -1 EIO (Input/output error)
99    19:22:10.732226 write(2, "write error", 11) = -1 EIO (Input/output error)
99    19:22:10.732263 write(2, ": Input/output error", 20) = -1 EIO (Input/output error)
99    19:22:10.732298 write(2, "\n", 1 <unfinished ...>
99    19:22:10.732325 <... write resumed>) = -1 EIO (Input/output error)
99    19:22:10.732349 exit_group(2)     = ?
99    19:22:10.732424 +++ exited with 2 +++

Removing the redirection should make the tests less flakey.

Replaces #13719.

While at it, also drop NotifyAccess=all. I think it was added purposefully in
TEST-20-MAINPIDGAMES, and then cargo culted to newer tests.

21 files changed:
test/TEST-03-JOBS/test.sh
test/TEST-10-ISSUE-2467/test.sh
test/TEST-13-NSPAWN-SMOKE/test.sh
test/TEST-17-UDEV-WANTS/test.sh
test/TEST-18-FAILUREACTION/test.sh
test/TEST-19-DELEGATE/test.sh
test/TEST-20-MAINPIDGAMES/test.sh
test/TEST-23-TYPE-EXEC/test.sh
test/TEST-25-IMPORT/test.sh
test/TEST-26-SETENV/test.sh
test/TEST-27-STDOUTFILE/test.sh
test/TEST-29-UDEV-ID_RENAMING/test.sh
test/TEST-30-ONCLOCKCHANGE/test.sh
test/TEST-31-DEVICE-ENUMERATION/test.sh
test/TEST-32-OOMPOLICY/test.sh
test/TEST-33-CLEAN-UNIT/test.sh
test/TEST-34-DYNAMICUSERMIGRATE/test.sh
test/TEST-36-NUMAPOLICY/test.sh
test/TEST-37-RUNTIMEDIRECTORYPRESERVE/test.sh
test/TEST-39-EXECRELOAD/test.sh
test/TEST-40-EXEC-COMMAND-EX/test.sh

index b815e7cb67270b4e9ee84b6ac0991dd239a8e41d..3359ee68400f994426ae4cda4069b15b49e4ee69 100755 (executable)
@@ -32,8 +32,6 @@ After=multi-user.target
 [Service]
 ExecStart=/test-jobs.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 EOF
 
         # copy the units used by this test
index e0e78b11003e7e0b0a237f361d3f5eba2be1e96e..80b2fd923f932c72cf499b5478fad51ee245434f 100755 (executable)
@@ -22,8 +22,6 @@ Description=Testsuite service
 
 [Service]
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 ExecStart=/bin/sh -e -x -c 'rm -f /tmp/nonexistent; systemctl start test.socket; printf x > test.file; socat -t20 OPEN:test.file UNIX-CONNECT:/run/test.ctl; >/testok'
 EOF
 
index f89bdca99ff85b06e0112d9932124750f515a83c..4f14bf12e334a8a1f69772aa996d46e42d3dc21f 100755 (executable)
@@ -37,8 +37,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/test-nspawn.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 EOF
 
         cat >$initdir/test-nspawn.sh <<'EOF'
index 8727432e30c02e71a5944d905c7d484ff9596678..36032348b89204124e5105bd5493c1e18918cbbe 100755 (executable)
@@ -30,8 +30,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 EOF
         cp testsuite.sh $initdir/
 
index 503c5ca551df497b793f6a4b03e253a48cfa3560..18b0be82e8e1f1fa24ffd24aafaf23cc6ac3e361 100755 (executable)
@@ -22,8 +22,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 EOF
         cp testsuite.sh $initdir/
 
index 348c697f633ff6733abfcc1e784d9af1de198f87..bdd6562a3370c2fbe3c9d4b4d756739b14a58848 100755 (executable)
@@ -32,8 +32,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 EOF
         cp testsuite.sh $initdir/
 
index 457ef6ae745beba911cf7a24b82770011015682b..0f6aef745366ce3b179e66852b7cd6b9f1fd7d2d 100755 (executable)
@@ -29,8 +29,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
index 9163f88c8226f20d1b92c15ab6b840d426c3331a..2b10b9ad7033349d5b545578f78bccd55f7aea06 100755 (executable)
@@ -29,9 +29,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
 
index 026c38a264f3a1094206e7a3383cabbf56e1a2fd..c0f51f3b897da14c933bde847dd92e748aeb537b 100755 (executable)
@@ -22,9 +22,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
 
index fc216ee5bf1a19282448b0ad4bd24940fe10dbb1..065a8e461c8e0211231a215563ce59babe1e8699 100755 (executable)
@@ -21,9 +21,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
 
index d481f1b8bfe7f57d125fcfaaf36762ad4694b59e..a796dcd79e4fdf2abed562522a9c1a103b405867 100755 (executable)
@@ -31,9 +31,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
 
index 67641746d88b8530f4bb95e277dc8d5e991362d7..2a483bbc3ddba457a5eda345c7678174134be85b 100755 (executable)
@@ -30,8 +30,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 EOF
         cp testsuite.sh $initdir/
 
index 98a9db800722ac8729820038907ce965f4a38f44..67e074af4c802f24377ca53c329d111169bfc0a2 100755 (executable)
@@ -40,9 +40,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
 
index 064daf923587b4ef313a22639ae241b79321c7ba..855ec42266c8359677e82ab6fa48cc97328437be 100755 (executable)
@@ -30,8 +30,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 EOF
         cp testsuite.sh $initdir/
 
index 17610af21d74f91cb6f089ec5106d86c06d29334..4578916762d2cad2095e49ef218d85c4b45468ca 100755 (executable)
@@ -32,8 +32,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 MemoryAccounting=yes
 EOF
         cp testsuite.sh $initdir/
index aeda69baae4f682e189e3b4b188ed253eba2f868..90dd495c0a5208a2c3e2b8db67ffe4065043f979 100755 (executable)
@@ -31,8 +31,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 EOF
         cp testsuite.sh $initdir/
 
index 7339d3b656ce02e35de72cb8eef5926621d00fba..0bff59fcb7fb1fa778dcd2906e695126d8860e22 100755 (executable)
@@ -29,9 +29,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
 
index a586f9dc9047ff66f64d9e7e2d5d64cf3aa5edad..14cbe5f3860af6b96cc15f6c1bf929be25cad34f 100755 (executable)
@@ -33,9 +33,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
 
index 9e87e61dcd55ba8e36069dd51a9bd672164994b9..b7a3ab8ce498627c3ab9d3b580e2717375073f84 100755 (executable)
@@ -31,8 +31,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
 EOF
         cp testsuite.sh $initdir/
 
index 7eb9db415a503690ac39d6c107425e46fcaaaa5d..e6bb7baedfd3f204a2666b5d2949ac186866d4ec 100755 (executable)
@@ -31,9 +31,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/bin/bash -x /testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/
 
index 723c9ccd4b1fd7758b494966a1ab86a9859b5af0..4e73fbaee933de730125efa0de35b870ba783c07 100755 (executable)
@@ -29,9 +29,6 @@ Description=Testsuite service
 [Service]
 ExecStart=/testsuite.sh
 Type=oneshot
-StandardOutput=tty
-StandardError=tty
-NotifyAccess=all
 EOF
         cp testsuite.sh $initdir/