]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: make sure we don't access an unbound variable
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 23 Jul 2021 10:53:31 +0000 (12:53 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 23 Jul 2021 15:20:42 +0000 (16:20 +0100)
```
testsuite-60.sh[759]: + grep -q '(mount-monitor-dispatch) entered rate limit'
testsuite-60.sh[571]: + sleep 5
testsuite-60.sh[761]: ++ date -u +%s
testsuite-60.sh[571]: + [[ 1627037066 -le 1627037061 ]]
testsuite-60.sh[571]: /usr/lib/systemd/tests/testdata/units/testsuite-60.sh: line 41: entered_rl: unbound variable
```

test/units/testsuite-60.sh

index 8158754667626c3f7d3f417a21deb00227de8a20..06526776fdbef21c96b5ed34a3370c86cab95c27 100755 (executable)
@@ -26,6 +26,7 @@ done
 
 # figure out if we have entered the rate limit state
 
+entered_rl=0
 exited_rl=0
 timeout="$(date -ud "2 minutes" +%s)"
 while [[ $(date -u +%s) -le ${timeout} ]]; do