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 34 35 36 37 38 39 40 41 42 43 44
|
#!/bin/sh
set -e
# 2 packages that use dh-sysuser:
# runit --> _runit-log // nonexistent //
# make sure the test env is clean
apt-get -y purge runit
if grep _runit-log /etc/passwd /etc/group ; then
echo "user _runit-log exists, environment is not clean"
exit 1
fi
rc=0
# test the user creation
apt-get -y install runit
# we expect _runit-log to exist now
if grep _runit-log /etc/passwd; then
echo "OK: user _runit-log succesfully created"
else
echo "FAILED: user _runit-log does not exist"
rc=1
fi
# remove without purge, users should be still there
apt-get -y remove runit
if grep _runit-log /etc/passwd; then
echo "OK: user _runit-log succesfully created"
else
echo "FAILED: user _runit-log does not exist"
rc=1
fi
# now test the user removal on purge:
# _runit-log has home set to nonexistent so
# user should be removed on purge
#apt-get -y purge runit
#if grep _runit-log /etc/passwd /etc/group ; then
# echo "FAILED: user _runit-log exists after purge or environment is not clean"
# rc=1
#fi
exit $rc
|