X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=packer%2Fdebian64.bats;h=189c668f2a7ba8a559aa79d2fe02aba1ceb5fa7b;hp=a67716836b50d6319c0fff5762f927de92b32caf;hb=45b4746a0ac2eebe631be0466fc62741c32744f8;hpb=1e8339d1890dbcc25ef0e2b49b64ce9fa427f79b diff --git a/packer/debian64.bats b/packer/debian64.bats index a677168..189c668 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" == 'stretch/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"