Merge pull request #47155 from xeji/p/installer-tests

nixos/tests/installer: prevent race between parted and udev
This commit is contained in:
xeji 2018-09-24 18:59:50 +02:00 committed by GitHub
commit 9163c057e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -282,9 +282,9 @@ in {
{ createPartitions =
''
$machine->succeed(
"parted --script /dev/vda mklabel msdos",
"parted --script /dev/vda -- mkpart primary linux-swap 1M 1024M",
"parted --script /dev/vda -- mkpart primary ext2 1024M -1s",
"flock /dev/vda parted --script /dev/vda -- mklabel msdos"
. " mkpart primary linux-swap 1M 1024M"
. " mkpart primary ext2 1024M -1s",
"udevadm settle",
"mkswap /dev/vda1 -L swap",
"swapon -L swap",
@ -299,11 +299,11 @@ in {
{ createPartitions =
''
$machine->succeed(
"parted --script /dev/vda mklabel gpt",
"parted --script /dev/vda -- mkpart ESP fat32 1M 50MiB", # /boot
"parted --script /dev/vda -- set 1 boot on",
"parted --script /dev/vda -- mkpart primary linux-swap 50MiB 1024MiB",
"parted --script /dev/vda -- mkpart primary ext2 1024MiB -1MiB", # /
"flock /dev/vda parted --script /dev/vda -- mklabel gpt"
. " mkpart ESP fat32 1M 50MiB" # /boot
. " set 1 boot on"
. " mkpart primary linux-swap 50MiB 1024MiB"
. " mkpart primary ext2 1024MiB -1MiB", # /
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
@ -321,11 +321,11 @@ in {
{ createPartitions =
''
$machine->succeed(
"parted --script /dev/vda mklabel gpt",
"parted --script /dev/vda -- mkpart ESP fat32 1M 50MiB", # /boot
"parted --script /dev/vda -- set 1 boot on",
"parted --script /dev/vda -- mkpart primary linux-swap 50MiB 1024MiB",
"parted --script /dev/vda -- mkpart primary ext2 1024MiB -1MiB", # /
"flock /dev/vda parted --script /dev/vda -- mklabel gpt"
. " mkpart ESP fat32 1M 50MiB" # /boot
. " set 1 boot on"
. " mkpart primary linux-swap 50MiB 1024MiB"
. " mkpart primary ext2 1024MiB -1MiB", # /
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
@ -345,10 +345,10 @@ in {
{ createPartitions =
''
$machine->succeed(
"parted --script /dev/vda mklabel msdos",
"parted --script /dev/vda -- mkpart primary ext2 1M 50MB", # /boot
"parted --script /dev/vda -- mkpart primary linux-swap 50MB 1024M",
"parted --script /dev/vda -- mkpart primary ext2 1024M -1s", # /
"flock /dev/vda parted --script /dev/vda -- mklabel msdos"
. " mkpart primary ext2 1M 50MB" # /boot
. " mkpart primary linux-swap 50MB 1024M"
. " mkpart primary ext2 1024M -1s", # /
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
@ -366,10 +366,10 @@ in {
{ createPartitions =
''
$machine->succeed(
"parted --script /dev/vda mklabel msdos",
"parted --script /dev/vda -- mkpart primary ext2 1M 50MB", # /boot
"parted --script /dev/vda -- mkpart primary linux-swap 50MB 1024M",
"parted --script /dev/vda -- mkpart primary ext2 1024M -1s", # /
"flock /dev/vda parted --script /dev/vda -- mklabel msdos"
. " mkpart primary ext2 1M 50MB" # /boot
. " mkpart primary linux-swap 50MB 1024M"
. " mkpart primary ext2 1024M -1s", # /
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
@ -402,9 +402,9 @@ in {
createPartitions =
''
$machine->succeed(
"parted --script /dev/vda mklabel msdos",
"parted --script /dev/vda -- mkpart primary linux-swap 1M 1024M",
"parted --script /dev/vda -- mkpart primary 1024M -1s",
"flock /dev/vda parted --script /dev/vda -- mklabel msdos"
. " mkpart primary linux-swap 1M 1024M"
. " mkpart primary 1024M -1s",
"udevadm settle",
"mkswap /dev/vda1 -L swap",
@ -425,11 +425,11 @@ in {
{ createPartitions =
''
$machine->succeed(
"parted --script /dev/vda mklabel msdos",
"parted --script /dev/vda -- mkpart primary 1M 2048M", # PV1
"parted --script /dev/vda -- set 1 lvm on",
"parted --script /dev/vda -- mkpart primary 2048M -1s", # PV2
"parted --script /dev/vda -- set 2 lvm on",
"flock /dev/vda parted --script /dev/vda -- mklabel msdos"
. " mkpart primary 1M 2048M" # PV1
. " set 1 lvm on"
. " mkpart primary 2048M -1s" # PV2
. " set 2 lvm on",
"udevadm settle",
"pvcreate /dev/vda1 /dev/vda2",
"vgcreate MyVolGroup /dev/vda1 /dev/vda2",
@ -447,10 +447,10 @@ in {
luksroot = makeInstallerTest "luksroot"
{ createPartitions = ''
$machine->succeed(
"parted --script /dev/vda mklabel msdos",
"parted --script /dev/vda -- mkpart primary ext2 1M 50MB", # /boot
"parted --script /dev/vda -- mkpart primary linux-swap 50M 1024M",
"parted --script /dev/vda -- mkpart primary 1024M -1s", # LUKS
"flock /dev/vda parted --script /dev/vda -- mklabel msdos"
. " mkpart primary ext2 1M 50MB" # /boot
. " mkpart primary linux-swap 50M 1024M"
. " mkpart primary 1024M -1s", # LUKS
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
@ -481,11 +481,11 @@ in {
filesystemEncryptedWithKeyfile = makeInstallerTest "filesystemEncryptedWithKeyfile"
{ createPartitions = ''
$machine->succeed(
"parted --script /dev/vda mklabel msdos",
"parted --script /dev/vda -- mkpart primary ext2 1M 50MB", # /boot
"parted --script /dev/vda -- mkpart primary linux-swap 50M 1024M",
"parted --script /dev/vda -- mkpart primary 1024M 1280M", # LUKS with keyfile
"parted --script /dev/vda -- mkpart primary 1280M -1s",
"flock /dev/vda parted --script /dev/vda -- mklabel msdos"
. " mkpart primary ext2 1M 50MB" # /boot
. " mkpart primary linux-swap 50M 1024M"
. " mkpart primary 1024M 1280M" # LUKS with keyfile
. " mkpart primary 1280M -1s",
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
@ -520,7 +520,7 @@ in {
{ createPartitions =
''
$machine->succeed(
"parted --script /dev/vda --"
"flock /dev/vda parted --script /dev/vda --"
. " mklabel msdos"
. " mkpart primary ext2 1M 100MB" # /boot
. " mkpart extended 100M -1s"
@ -531,8 +531,10 @@ in {
"udevadm settle",
"ls -l /dev/vda* >&2",
"cat /proc/partitions >&2",
"udevadm control --stop-exec-queue",
"mdadm --create --force /dev/md0 --metadata 1.2 --level=raid1 --raid-devices=2 /dev/vda5 /dev/vda6",
"mdadm --create --force /dev/md1 --metadata 1.2 --level=raid1 --raid-devices=2 /dev/vda7 /dev/vda8",
"udevadm control --start-exec-queue",
"udevadm settle",
"mkswap -f /dev/md1 -L swap",
"swapon -L swap",
@ -555,9 +557,9 @@ in {
{ createPartitions =
''
$machine->succeed(
"parted --script /dev/sda mklabel msdos",
"parted --script /dev/sda -- mkpart primary linux-swap 1M 1024M",
"parted --script /dev/sda -- mkpart primary ext2 1024M -1s",
"flock /dev/sda parted --script /dev/sda -- mklabel msdos"
. " mkpart primary linux-swap 1M 1024M"
. " mkpart primary ext2 1024M -1s",
"udevadm settle",
"mkswap /dev/sda1 -L swap",
"swapon -L swap",