#! /bin/bash

set -e

. ./debian/tests/common.sh

trap "cp -vp fai-cd.log $AUTOPKGTEST_ARTIFACTS" INT QUIT EXIT


cd "$AUTOPKGTEST_TMP"

# test fai-mirror and fai-cd

# - - - - - - - - - - - - - - - - -
# fai-cd
fai-cd -Jm /tmp/mirror faicd64-small.iso >& fai-cd.log
echo fai-cd exit code: $?
# check size of ISO
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 mirror.log fai-cd.log pkg.list
