1
0
mirror of https://pagure.io/fedora-qa/createhdds.git synced 2024-11-26 00:23:07 +00:00

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,14 +113,19 @@ upload /tmp/updates.img /updates.img
_EOF_ _EOF_
} }
if [ "$#" -eq 0 ]; then if [[ "$1" != "" ]]; then
VERSION="$1"
shift
if [[ "$#" -eq 0 ]]; then
disk_full disk_full
disk_freespace disk_freespace
disk_f22_minimal disk_minimal ${VERSION} "x86_64"
disk_f22_desktop disk_minimal ${VERSION} "i686"
disk_desktop ${VERSION} "x86_64"
disk_desktop ${VERSION} "i686"
disk_ks disk_ks
disk_updates_img disk_updates_img
else else
case $1 in case $1 in
full) full)
disk_full disk_full
@ -120,11 +133,17 @@ else
freespace) freespace)
disk_freespace disk_freespace
;; ;;
minimal) minimal_64bit)
disk_f22_minimal disk_minimal ${VERSION} "x86_64"
;; ;;
desktop) minimal_32bit)
disk_f22_desktop disk_minimal ${VERSION} "i686"
;;
desktop_64bit)
disk_desktop ${VERSION} "x86_64"
;;
desktop_32bit)
disk_desktop ${VERSION} "i686"
;; ;;
ks) ks)
disk_ks disk_ks
@ -133,7 +152,12 @@ else
disk_updates_img disk_updates_img
;; ;;
*) *)
echo "$0 [full|freespace|minimal|desktop|ks|updates]" echo "name not in [full|freespace|minimal_64bit|minimal_32bit|desktop_64bit|desktop_32bit|ks|updates]"
exit 1
;; ;;
esac esac
fi
else
echo "USAGE: $0 VERSION [full|freespace|minimal_64bit|minimal_32bit|desktop_64bit|desktop_32bit|ks|updates]"
exit 1
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": [