Debian Codegraph @

debian/tests/nfsroot

raw
1 #! /bin/bash
2
3 set -e
4
5 . ./debian/tests/common.sh
6 cd "$AUTOPKGTEST_TMP"
7 trap "cp -vp /var/log/fai/fai-make-nfsroot.log nfsroot.log $AUTOPKGTEST_ARTIFACTS" INT QUIT EXIT
8
9 fai-make-nfsroot -zgv > nfsroot.log
10 err=$?
11 echo "exit code fai-make-nfsroot: $err"
12 if [ $err -ne 0 ]; then
13 error "ERROR: fai-make-nfsroot exit code $err"
14 fi
15
16 # test the results of the commands called
17 chk-size $N 750
18
19 grep 'fai-make-nfsroot finished properly.' nfsroot.log || error "fai-make-nfsroot error."
20 egrep '^Calling debootstrap ' nfsroot.log
21 egrep ^fai-nfsroot nfsroot.log
22 egrep ^dracut-network nfsroot.log || error "package dracut-network is missing."
23
24 chk-file $TFTP/pxelinux.0
25 chk-file $TFTP/syslinux.efi
26 chk-file $TFTP/ldlinux.e64
27 chk-size $N/boot/initrd.img* 40
28 chk-no-file $N/etc/udev/rules.d/70-persistent-net.rules
29
30 initrd=$(chroot $N readlink -f /initrd.img)
31 chroot $N /usr/bin/lsinitrd -m $initrd | grep livenet || error "livenet mising"
32 chroot $N /usr/bin/lsinitrd $initrd | grep mount.nfs || error "mount.nfs missing"
33
34 # - - - - - - - - - - - - - - - - -
35 # fai-chboot
36 # currently fai-chboot writes to stderr
37 fai-chboot -o default 2>/dev/null
38 fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/$CS test.tmpl 2>/dev/null
39 fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/$CS localhost 2>/dev/null
40
41 chk-file $TFTP/pxelinux.cfg/default
42 chk-file $TFTP/pxelinux.cfg/test.tmpl
43 chk-file $TFTP/pxelinux.cfg/7F000001