| 1 |
#! /bin/bash |
| 2 |
|
| 3 |
# test fai dirinstall |
| 4 |
|
| 5 |
. ./debian/tests/common.sh |
| 6 |
trap "cp -avL dirinstall.log $AUTOPKGTEST_ARTIFACTS" INT QUIT EXIT |
| 7 |
cd "$AUTOPKGTEST_TMP" |
| 8 |
|
| 9 |
ch=/srv/chroot |
| 10 |
cl="DEBIAN,AMD64,FAIBASE,DHCPC,DEMO,LAST" |
| 11 |
export NIC1=dummy |
| 12 |
LC_ALL=C fai -v dirinstall -c $cl -s file://$CS $ch >& dirinstall.log |
| 13 |
echo "dirinstall exit $?" |
| 14 |
|
| 15 |
|
| 16 |
# test the results of the commands called |
| 17 |
chk-size $ch 700 |
| 18 |
chk-size $ch/boot 30 |
| 19 |
|
| 20 |
# chroot into and execute some commands |
| 21 |
chroot $ch ls -l /boot/ || error "error calling ls in chroot" |
| 22 |
chroot $ch /usr/bin/ldd --version |
| 23 |
chroot $ch /usr/bin/apt --version || error "error calling apt in chroot" |
| 24 |
chroot $ch /usr/bin/systemd --version |
| 25 |
chk-no-file $ch/etc/dpkg/dpkg.cfg.d/unsafe-io |
| 26 |
|
| 27 |
grep tmpfs $ch/etc/fstab |
| 28 |
if [ ! -f $ch/etc/network/interfaces.d/dummy ]; then |
| 29 |
error "dirinstall failed. interfaces.d/dummy is missing" |
| 30 |
fi |
| 31 |
if [ ! -d $ch/home/demo/ ]; then |
| 32 |
error "dirinstall failed. No home dir for user demo" |
| 33 |
fi |
| 34 |
if grep -q FAILED $ch/var/log/fai/localhost/last/status.log; then |
| 35 |
error "dirinstall failed. See status.log" |
| 36 |
fi |
| 37 |
if grep -q FAILED dirinstall.log; then |
| 38 |
error "dirinstall failed. See dirinstall.log" |
| 39 |
fi |
| 40 |
|
| 41 |
if [ X$NO_CLEANUP != X1 ]; then |
| 42 |
rm -rf $ch |
| 43 |
fi |