X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=packer%2Fdebian64.bats;h=d5aca5988e5d6a2a7ba3cfcb24b36bc55c9508a3;hp=a67716836b50d6319c0fff5762f927de92b32caf;hb=c7ddca2d38ad6698a115de7f4d6a47f60d5ba48b;hpb=1669cf2d8c22833e325ce86e005ebd1a51abc295 diff --git a/packer/debian64.bats b/packer/debian64.bats index a677168..d5aca59 100644 --- a/packer/debian64.bats +++ b/packer/debian64.bats @@ -14,10 +14,10 @@ teardown() { } # tests -@test "debian_version exists" { +@test "debian_version exists and is valid version" { run cat "${mountpath}/etc/debian_version" [ "$status" -eq 0 ] - [[ "$output" == [0-9].[0-9] ]] + [[ "$output" == [0-9]*.[0-9]* ]] || [[ "$output" == 'bullseye/sid' ]] } @test "kernel exists" { @@ -61,7 +61,7 @@ teardown() { } @test "kernel entry in grub config" { - run grep "Debian GNU/Linux, with Linux" "${mountpath}/boot/grub/grub.cfg" + run grep "Debian GNU/Linux" "${mountpath}/boot/grub/grub.cfg" [ "$status" -eq 0 ] } @@ -81,12 +81,14 @@ teardown() { } @test "sudo setup for user vagrant" { - run grep -q '^vagrant ALL=(ALL) NOPASSWD: ALL' "${mountpath}/etc/sudoers.d/vagrant" + run grep -q '^vagrant ALL=(ALL) NOPASSWD: ALL' "${mountpath}/etc/sudoers.d/vagrant" "${mountpath}/etc/sudoers" [ "$status" -eq 0 ] } @test "check for GRUB in MBR" { - regex='^00000180.*GRUB.*' + # note: ^00000170 for lenny + # note: ^00000180 for >=wheezy + regex='^000001[78]0.*GRUB.*' grub_string=$(dd if=${device} bs=512 count=1 2>/dev/null | hexdump -C | egrep "$regex") run echo "$grub_string" echo "debug: grub_string = $grub_string"