[master 1/2] Use a disk label to find the filesystem for escrow results
dashea
installerbot-noreply at redhat.com
Thu Aug 6 20:34:28 UTC 2015
From: David Shea <dshea at redhat.com>
The escrow test does not use autopart, so the root filesystem does not
end up on /dev/mapper/fedora-root like most other tests. Use a label so
we don't have to depend on the partition order.
---
tests/kickstart_tests/escrow-cert.ks | 2 +-
tests/kickstart_tests/escrow-cert.sh | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/tests/kickstart_tests/escrow-cert.ks b/tests/kickstart_tests/escrow-cert.ks
index e1b31b9..6aa11e4 100644
--- a/tests/kickstart_tests/escrow-cert.ks
+++ b/tests/kickstart_tests/escrow-cert.ks
@@ -5,7 +5,7 @@ network --bootproto=dhcp
bootloader --timeout=1
zerombr
clearpart --all
-part --fstype=ext4 --size=4400 /
+part --fstype=ext4 --size=4400 --label=rootfs /
part --fstype=ext4 --size=500 /boot
part --fstype=swap --size=500 swap
diff --git a/tests/kickstart_tests/escrow-cert.sh b/tests/kickstart_tests/escrow-cert.sh
index 1564a16..87ade19 100755
--- a/tests/kickstart_tests/escrow-cert.sh
+++ b/tests/kickstart_tests/escrow-cert.sh
@@ -19,3 +19,22 @@
# Red Hat Author(s): David Shea <dshea at redhat.com>
. ${KSTESTDIR}/functions.sh
+
+validate() {
+ disksdir=$1
+ args=$(for d in ${disksdir}/disk-*img; do echo -a ${d}; done)
+
+ # There should be a /root/RESULT file with results in it. Check
+ # its contents and decide whether the test finally succeeded or
+ # not.
+ result=$(virt-cat ${args} -m /dev/disk/by-label/rootfs /root/RESULT)
+ if [[ $? != 0 ]]; then
+ status=1
+ echo '*** /root/RESULT does not exist in VM image.'
+ elif [[ "${result}" != SUCCESS* ]]; then
+ status=1
+ echo "${result}"
+ fi
+
+ return ${status}
+}
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/95379cbfc51cfa63376061b0db61564b4be1c460
More information about the anaconda-patches
mailing list