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
|
#! /bin/bash
# test fai dirinstall
. ./debian/tests/common.sh
trap "cp -avL dirinstall.log $AUTOPKGTEST_ARTIFACTS" INT QUIT EXIT
cd "$AUTOPKGTEST_TMP"
ch=/srv/chroot
cl="DEBIAN,AMD64,FAIBASE,DHCPC,DEMO,LAST"
export NIC1=dummy
LC_ALL=C fai -v dirinstall -c $cl -s file://$CS $ch >& dirinstall.log
echo "dirinstall exit $?"
# test the results of the commands called
chk-size $ch 700
chk-size $ch/boot 30
# chroot into and execute some commands
chroot $ch ls -l /boot/ || error "error calling ls in chroot"
chroot $ch /usr/bin/ldd --version
chroot $ch /usr/bin/apt --version || error "error calling apt in chroot"
chroot $ch /usr/bin/systemd --version
chk-no-file $ch/etc/dpkg/dpkg.cfg.d/unsafe-io
grep tmpfs $ch/etc/fstab
if [ ! -f $ch/etc/network/interfaces.d/dummy ]; then
error "dirinstall failed. interfaces.d/dummy is missing"
fi
if [ ! -d $ch/home/demo/ ]; then
error "dirinstall failed. No home dir for user demo"
fi
if grep -q FAILED $ch/var/log/fai/localhost/last/status.log; then
error "dirinstall failed. See status.log"
fi
if grep -q FAILED dirinstall.log; then
error "dirinstall failed. See dirinstall.log"
fi
if [ X$NO_CLEANUP != X1 ]; then
rm -rf $ch
fi
|