# Slow image building tests In this chapter, we have test scenarios that actually build an image and test the output. The images are not booted, but that may be added later. Instead, all the tests on the images are static. These tests are slow, since building images is slow. ## Build a very basic Debian 8 image SCENARIO build a basic Debian 8 image ASSUMING build tests are requested GIVEN user wants to build an image FOO.img that is 2GiB in size WHEN the user runs vmdebootstrap --sparse --extlinux THEN the image has the correct size AND the partition count of the image is 1 AND partition 1 has the boot flag set AND partition 1 has an ext4 filesystem AND partition 1 has file /etc/debian_version matching ^8\..*$ SCENARIO build a Debian 8 image with grub ASSUMING build tests are requested GIVEN user wants to build an image FOO.img that is 2GiB in size WHEN the user runs vmdebootstrap --grub THEN the image has the correct size AND the partition count of the image is 1 AND partition 1 has the boot flag set AND partition 1 has an ext4 filesystem AND partition 1 has file /boot/grub/grub.cfg matching ^### BEGIN /etc/grub.d/00_header ###$ AND partition 1 has file /etc/fstab matching ^\S+\s+\/\s+ext4\s+errors=remount-ro\s+\d\s+\d$ SCENARIO build a Debian 8 image with uefi ASSUMING build tests are requested GIVEN user wants to build an image FOO.img that is 2GiB in size WHEN the user runs vmdebootstrap --grub --use-uefi THEN the image has the correct size AND the partition count of the image is 2 AND partition 1 has an vfat filesystem AND partition 2 has file /boot/grub/grub.cfg matching ^### BEGIN /etc/grub.d/00_header ###$ SCENARIO build a Debian 8 image with btrfs and grub ASSUMING build tests are requested GIVEN user wants to build an image FOO.img that is 2GiB in size WHEN the user runs vmdebootstrap --roottype=btrfs --grub THEN the image has the correct size AND the partition count of the image is 1 AND partition 1 has the boot flag set AND partition 1 has an btrfs filesystem AND partition 1 has file /etc/fstab matching ^\S+\s+\/\s+btrfs\s+defaults\s+\d\s+\d$ SCENARIO build a Debian 8 image with separate boot partition ASSUMING build tests are requested GIVEN user wants to build an image FOO.img that is 2GiB in size WHEN the user runs vmdebootstrap --bootsize=128M --boottype=ext3 --grub THEN the image has the correct size AND the partition count of the image is 2 AND partition 1 has the boot flag set AND partition 1 has an ext3 filesystem AND partition 2 has an ext4 filesystem AND partition 2 has file /etc/fstab matching ^\S+\s+\/\s+ext4\s+errors=remount-ro\s+\d\s+\d$ AND partition 2 has file /etc/fstab matching ^\S+\s+\/boot\s+ext3\s+errors=remount-ro\s+\d\s+\d$