summaryrefslogtreecommitdiff
path: root/yarns/300-slow-build-tests.yarn
blob: cf6f7c05658d7a0874e8c0bcbf6fe87380a0d00f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# 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 --roottype ext3
    THEN the image has the correct size
    AND the partition count of the image is 1
    AND partition 1 has an ext3 filesystem
    AND partition 1 has file /etc/debian_version matching ^8\..*$
    AND partition 1 has filename ldlinux.sys
    AND partition 1 has filename extlinux.conf

    SCENARIO build a basic Debian 8 image with networking
    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
    ... --roottype ext3 --enable-dhcp --configure-apt --distribution stable
    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 ext3 filesystem
    AND partition 1 has file /etc/debian_version matching ^8\..*$
    AND partition 1 has filename ldlinux.sys
    AND partition 1 has filename extlinux.conf

    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 stretch 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 --distribution stretch
    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 stretch image with systemd
    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 --distribution stretch
    ... --systemd-networkd
    THEN the image has the correct size
    AND the partition count of the image is 1
    AND partition 1 has symlink /etc/resolv.conf
    AND partition 1 has the boot flag set
    AND partition 1 has an ext4 filesystem
    AND partition 1 has symlink /sbin/init

    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 basic Debian 8 qcow 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 --roottype ext2 --extlinux --convert-qcow2
    THEN image has file format matching qcow2

    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$

    SCENARIO build a Debian 8 armhf image with boot flag lba
    ASSUMING build tests are requested
    GIVEN user wants to build an image FOO.img that is 2GiB in size
    WHEN the user runs vmdebootstrap --bootflag=lba --arch armhf --grub
    ... --foreign /usr/bin/qemu-arm-static --bootsize 100mib --boottype vfat
    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 the lba flag set