1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
summary: Check that snaps can use start-timeout
details: |
Snaps may have forking services, which are expected to call fork() as part
of start-up and the parent process is then expected to exit when start-up
is complete.
A forking service may have a `start-timeout` value set, where if the parent
process does not exit within the given timeout, the installation fails.
This test verifies that if a forking service fails to exit within the
timeout, the installation fails, and if it does exit within the timeout,
the installation is successful.
# this test is expected to fail once we run the tests for SELinux
# distros in Enforce mode
restore: |
f=test-snapd-service-start-timeout/forking.sh
if [ -e "$f.bak" ]; then
mv -v "$f.bak" "$f"
fi
execute: |
dir=test-snapd-service-start-timeout
# with the 30s sleep, start-timeout stops the snap from working
not snap try "$dir"
# drop the 'sleep 30'
sed -i -e '/@@@/d' "$dir/forking.sh"
snap try "$dir"
|