add 32bit disk creation

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D534
This commit is contained in:
Jan Sedlák 2015-08-27 13:48:25 +02:00
parent b8fe095296
commit 75936a2870
2 changed files with 70 additions and 40 deletions

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
function disk_full { function disk_full {
echo "Creating disk_full.img..." echo "Creating disk_full.img..."
guestfish <<_EOF_ guestfish <<_EOF_
@ -31,14 +32,17 @@ write /testfile "Hello, world!"
_EOF_ _EOF_
} }
function disk_f22_minimal { function disk_minimal {
echo "Creating disk_f22_minimal.img..." version=$1
virt-builder fedora-22 -o disk_f22_minimal.img --update --selinux-relabel --root-password password:weakpassword > /dev/null arch=$2
echo "Creating disk_f${version}_minimal_${arch}.img..."
virt-builder fedora-${version} -o disk_f${version}_minimal_${arch}.img --arch ${arch} --run-command \
"setarch ${arch} dnf -y update" --selinux-relabel --root-password password:weakpassword > /dev/null
expect <<_EOF_ expect <<_EOF_
log_user 0 log_user 0
set timeout -1 set timeout -1
spawn qemu-kvm -m 2G -nographic disk_f22_minimal.img spawn qemu-kvm -m 2G -nographic disk_f${version}_minimal_${arch}.img
expect "localhost login:" expect "localhost login:"
send "root\r" send "root\r"
@ -50,20 +54,24 @@ expect "reboot: Power down"
_EOF_ _EOF_
} }
function disk_f22_desktop { function disk_desktop {
echo "Creating disk_f22_desktop.img..." version=$1
arch=$2
echo "Creating disk_f${version}_desktop_${arch}.img..."
# these steps are required # these steps are required
# 1. remove firewalld - firewalld configuration in minimal and desktop are conflicting # 1. remove firewalld - firewalld configuration in minimal and desktop are conflicting
# 2. update fedora # 2. update fedora
# 3. install @Fedora Workstation group # 3. install @Fedora Workstation group
# 4. add new user on first boot # 4. add new user on first boot
# 5. use expect to do selinux relabelling and to set password for user # 5. use expect to do selinux relabelling and to set password for user
virt-builder fedora-22 -o disk_f22_desktop.img --size 10G --run-command "yum -y remove firewalld*" --update --selinux-relabel --install "@^workstation-product-environment" --root-password password:weakpassword --firstboot-command 'useradd -m -p "" ejohn' > /dev/null virt-builder fedora-${version} -o disk_f${version}_desktop_${arch}.img --size 20G --arch ${arch} --run-command \
"setarch ${arch} dnf -y remove firewalld* && setarch ${arch} dnf -y update && setarch ${arch} dnf -y install @'Fedora Workstation'" \
--selinux-relabel --root-password password:weakpassword --firstboot-command 'useradd -m -p "" ejohn' > /dev/null
expect <<_EOF_ expect <<_EOF_
log_user 0 log_user 0
set timeout -1 set timeout -1
spawn qemu-kvm -m 2G -nographic disk_f22_desktop.img spawn qemu-kvm -m 2G -nographic disk_f${version}_desktop_${arch}.img
expect "localhost login:" expect "localhost login:"
send "root\r" send "root\r"
@ -105,35 +113,51 @@ upload /tmp/updates.img /updates.img
_EOF_ _EOF_
} }
if [ "$#" -eq 0 ]; then if [[ "$1" != "" ]]; then
disk_full VERSION="$1"
disk_freespace shift
disk_f22_minimal if [[ "$#" -eq 0 ]]; then
disk_f22_desktop disk_full
disk_ks disk_freespace
disk_updates_img disk_minimal ${VERSION} "x86_64"
disk_minimal ${VERSION} "i686"
disk_desktop ${VERSION} "x86_64"
disk_desktop ${VERSION} "i686"
disk_ks
disk_updates_img
else
case $1 in
full)
disk_full
;;
freespace)
disk_freespace
;;
minimal_64bit)
disk_minimal ${VERSION} "x86_64"
;;
minimal_32bit)
disk_minimal ${VERSION} "i686"
;;
desktop_64bit)
disk_desktop ${VERSION} "x86_64"
;;
desktop_32bit)
disk_desktop ${VERSION} "i686"
;;
ks)
disk_ks
;;
updates)
disk_updates_img
;;
*)
echo "name not in [full|freespace|minimal_64bit|minimal_32bit|desktop_64bit|desktop_32bit|ks|updates]"
exit 1
;;
esac
fi
else else
case $1 in echo "USAGE: $0 VERSION [full|freespace|minimal_64bit|minimal_32bit|desktop_64bit|desktop_32bit|ks|updates]"
full) exit 1
disk_full
;;
freespace)
disk_freespace
;;
minimal)
disk_f22_minimal
;;
desktop)
disk_f22_desktop
;;
ks)
disk_ks
;;
updates)
disk_updates_img
;;
*)
echo "$0 [full|freespace|minimal|desktop|ks|updates]"
;;
esac
fi fi

View File

@ -285,10 +285,16 @@ TESTSUITES = {
"QA:Testcase_kickstart_user_creation", "QA:Testcase_kickstart_user_creation",
"QA:Testcase_Kickstart_Hd_Device_Path_Ks_Cfg", "QA:Testcase_Kickstart_Hd_Device_Path_Ks_Cfg",
], ],
"fedup_minimal": [ "fedup_minimal_64bit": [
"QA:Testcase_upgrade_fedup_cli_previous_minimal", "QA:Testcase_upgrade_fedup_cli_previous_minimal",
], ],
"fedup_desktop": [ "fedup_desktop_64bit": [
"QA:Testcase_upgrade_fedup_cli_previous_workstation",
],
"fedup_minimal_32bit": [
"QA:Testcase_upgrade_fedup_cli_previous_minimal",
],
"fedup_desktop_32bit": [
"QA:Testcase_upgrade_fedup_cli_previous_workstation", "QA:Testcase_upgrade_fedup_cli_previous_workstation",
], ],
"server_btrfs": [ "server_btrfs": [