From 3bc1e8335aa15ea68847020f5ba7a8c334c73def Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 5 May 2020 21:12:12 -0700 Subject: [PATCH] Put /var/lib/mock on separate disk for live image build test The update live image build test keeps running out of disk space. We've bumped the minimal disk image from 12GB all the way up to 20GB so far but it keeps happening. So let's try a different strategy: use a scratch disk to mount /var/lib/mock. That's where all the space gets used. This should allow us to reduce the size of the minimal disk image again, and giving it 25GB of empty disk should avoid it running out of space again for a while. Signed-off-by: Adam Williamson --- templates-updates.fif.json | 3 ++- tests/_live_build.pm | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/templates-updates.fif.json b/templates-updates.fif.json index ca250eca..4f40e646 100644 --- a/templates-updates.fif.json +++ b/templates-updates.fif.json @@ -287,7 +287,8 @@ "BOOTFROM": "c", "GRUB_POSTINSTALL": "selinux=0", "HDD_1": "disk_f%VERSION%_minimal_3_%ARCH%.img", - "NUMDISKS": "2", + "HDDSIZEGB_3": "25", + "NUMDISKS": "3", "POSTINSTALL": "_live_build", "ROOT_PASSWORD": "weakpassword", "USER_LOGIN": "false" diff --git a/tests/_live_build.pm b/tests/_live_build.pm index 9d224bd9..5b6285ba 100644 --- a/tests/_live_build.pm +++ b/tests/_live_build.pm @@ -10,6 +10,16 @@ sub run { my $arch = get_var("ARCH"); my $subv = get_var("SUBVARIANT"); my $lcsubv = lc($subv); + if (get_var("NUMDISKS") > 2) { + # put /var/lib/mock on the third disk, so we don't run out of + # space on the main disk. The second disk will have already + # been claimed for the update repo. + assert_script_run "echo 'type=83' | sfdisk /dev/vdc"; + assert_script_run "mkfs.ext4 /dev/vdc1"; + assert_script_run "echo '/dev/vdc1 /var/lib/mock ext4 defaults 1 2' >> /etc/fstab"; + assert_script_run "mkdir -p /var/lib/mock"; + assert_script_run "mount /var/lib/mock"; + } # install the tools we need assert_script_run "dnf -y install mock git pykickstart tar", 120; # base mock config on original