Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed Nov 1, 2022
1 parent 7aa5e69 commit 440d8ed
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions debian/tests/diskimage
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,30 @@ cd "$AUTOPKGTEST_TMP"

chk-loop-device

trap "cp -vap /var/log/fai/cloud3 $AUTOPKGTEST_ARTIFACTS" INT QUIT EXIT
trap "cp -vap /var/log/fai/cloud3 diskimage.log $AUTOPKGTEST_ARTIFACTS" INT QUIT EXIT

cl="DEBIAN,BUSTER64,AMD64,FAIBASE,GRUB_PC,DHCPC,DEMO,CLOUD,LAST"
LC_ALL=C fai-diskimage -vu cloud3 -S2G -c$cl cloud.raw
LC_ALL=C fai-diskimage -vu cloud3 -S2G -c$cl cloud.raw >& diskimage.log


# test the results of the commands called
chk-size cloud.raw 900
chk-size cloud.raw 860

mount -oloop,ro,offset=1048576 cloud.raw /mnt
chk-size /mnt/boot 38
chk-file /mnt/etc/network/interfaces.d/eth0
chk-file /mnt/etc/rc.local

echo 'd41d8cd98f00b204e9800998ecf8427e /mnt/etc/machine-id' > /tmp/zerocheck
md5sum -c /tmp/zerocheck
rm /tmp/zerocheck

chk-no-file /mnt/var/lib/dbus/machine-id
chk-no-file /mnt/etc/udev/rules.d/70-persistent-net.rules
chk-no-file /mnt/etc/resolv.conf
chk-no-file /mnt/etc/ssh/ssh_host_ed25519_key
chk-no-file /mnt/etc/ssh/ssh_host_ecdsa_key

mount -oloop,offset=1048576 cloud.raw /mnt
chk-size /mnt/boot 30
umount /mnt

if grep -q FAILED $ch/var/log/fai/cloud3/last/status.log; then
Expand Down

0 comments on commit 440d8ed

Please sign in to comment.