#! /bin/bash

# test fai-cd

set -e

. ./debian/tests/common.sh
trap "cp -vp fai-cd.log $AUTOPKGTEST_ARTIFACTS" INT QUIT EXIT
cd "$AUTOPKGTEST_TMP"


# - - - - - - - - - - - - - - - - -
fai-cd -Jm /tmp/mirror faicd64-small.iso >& fai-cd.log
echo fai-cd exit code: $?



# test the results of the commands called
chk-size faicd64-small.iso 700

# more test after mounting the ISO
# mount -oloop faicd64-small.iso /mnt
# umount /mnt
# chk-size /mnt/boot/initrd.img 30

# rm faicd64-small.iso fai-cd.log
