diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-03-JOBS/test-jobs.sh | 10 | ||||
-rw-r--r-- | test/fuzz/fuzz-unit-file/directives.scope | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/TEST-03-JOBS/test-jobs.sh b/test/TEST-03-JOBS/test-jobs.sh index 42190cf478..fca6cccb4f 100755 --- a/test/TEST-03-JOBS/test-jobs.sh +++ b/test/TEST-03-JOBS/test-jobs.sh @@ -84,4 +84,14 @@ END_SEC=$(date -u '+%s') ELAPSED=$(($END_SEC-$START_SEC)) [[ "$ELAPSED" -ge 5 ]] && [[ "$ELAPSED" -le 7 ]] || exit 1 +# Test time-limited scopes +START_SEC=$(date -u '+%s') +set +e +systemd-run --scope --property=RuntimeMaxSec=3s sleep 10 +RESULT=$? +END_SEC=$(date -u '+%s') +ELAPSED=$(($END_SEC-$START_SEC)) +[[ "$ELAPSED" -ge 3 ]] && [[ "$ELAPSED" -le 5 ]] || exit 1 +[[ "$RESULT" -ne 0 ]] || exit 1 + touch /testok diff --git a/test/fuzz/fuzz-unit-file/directives.scope b/test/fuzz/fuzz-unit-file/directives.scope new file mode 100644 index 0000000000..d0e194c371 --- /dev/null +++ b/test/fuzz/fuzz-unit-file/directives.scope @@ -0,0 +1,2 @@ +scope +RuntimeMaxSec= |