4 image="/srv/debian.img"
7 if ! mountpoint "${mountpath}" &>/dev/null ; then
8 partition="$(kpartx -asv ${image} | awk '/add/ {print $3}')"
9 mount "/dev/mapper/${partition}" "${mountpath}"
14 if mountpoint "${mountpath}" &>/dev/null ; then
20 @test "ensure grub configuration is present" {
21 run ls "${mountpath}"/boot/grub/grub.cfg
25 @test "ensure eatmydata package is present" {
26 run chroot "${mountpath}" dpkg --list eatmydata
30 @test "kernel is present" {
31 run ls "${mountpath}"/boot/vmlinuz-*
35 @test "debian_version exists and is valid version" {
36 run cat "${mountpath}/etc/debian_version"
38 [[ "$output" == [0-9].[0-9]* ]] || [[ "$output" == 'stretch/sid' ]]