From 375575cd0790e2b5459a102940df6dae189e88ac Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 13 Mar 2019 12:37:42 -0700 Subject: [PATCH] Use a second disk for the update repo in image build tests This tweaks the update live and installer image build tests to store the update repo on a separate disk. This should hopefully avoid the tests failing due to insufficient disk space when the update is huge (e.g. KDE or GNOME megaupdates). Signed-off-by: Adam Williamson --- lib/utils.pm | 11 +++++++++++ templates-updates | 2 ++ 2 files changed, 13 insertions(+) diff --git a/lib/utils.pm b/lib/utils.pm index a7e8a54d..3e0503ba 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -430,6 +430,17 @@ sub _repo_setup_updates { # update and enabling it here, we ensure all later 'dnf install' calls # will get the packages from the update. assert_script_run "mkdir -p /opt/update_repo"; + # if NUMDISKS is above 1, assume we want to put the update repo on + # the other disk (to avoid huge updates exhausting space on the main + # disk) + if (get_var("NUMDISKS") > 1) { + # I think the disk will always be vdb. This creates a single large + # partition. + assert_script_run "echo 'type=83' | sfdisk /dev/vdb"; + assert_script_run "mkfs.ext4 /dev/vdb1"; + assert_script_run "echo '/dev/vdb1 /opt/update_repo ext4 defaults 1 2' >> /etc/fstab"; + assert_script_run "mount /opt/update_repo"; + } assert_script_run "cd /opt/update_repo"; assert_script_run "dnf -y install bodhi-client git createrepo koji", 300; # download the packages diff --git a/templates-updates b/templates-updates index 330db49f..b1feeba8 100755 --- a/templates-updates +++ b/templates-updates @@ -1109,6 +1109,7 @@ { key => "USER_LOGIN", value => "false" }, { key => "ROOT_PASSWORD", value => "weakpassword" }, { key => "BOOTFROM", value => "c" }, + { key => "NUMDISKS", value => "2" }, { key => "HDD_1", value => "disk_f%VERSION%_minimal_3_%ARCH%.img" }, ], }, @@ -1121,6 +1122,7 @@ { key => "BOOTFROM", value => "c" }, { key => "+DESKTOP", value => "" }, { key => "+LIVE", value => "" }, + { key => "NUMDISKS", value => "2" }, { key => "HDD_1", value => "disk_f%VERSION%_minimal_3_%ARCH%.img" }, ], },