[PATCH] Fix the validate functions in the btrfs kickstart_tests.

Chris Lumens clumens at redhat.com
Fri Jul 17 19:55:58 UTC 2015


This function is passed a directory containing the disk images, and not the
path to the disk images itself.  Use the same code I'm using elsewhere.

Also, btrfs-1.ks needs to shutdown at the end of installation.
---
 tests/kickstart_tests/btrfs-1.ks | 2 +-
 tests/kickstart_tests/btrfs-1.sh | 5 +++--
 tests/kickstart_tests/btrfs-2.sh | 5 +++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/kickstart_tests/btrfs-1.ks b/tests/kickstart_tests/btrfs-1.ks
index 03eeeae..eb8f45f 100644
--- a/tests/kickstart_tests/btrfs-1.ks
+++ b/tests/kickstart_tests/btrfs-1.ks
@@ -19,7 +19,7 @@ keyboard us
 lang en
 timezone America/New_York
 rootpw qweqwe
-#shutdown
+shutdown
 
 %packages
 @core
diff --git a/tests/kickstart_tests/btrfs-1.sh b/tests/kickstart_tests/btrfs-1.sh
index dd83fb0..9b0c90a 100755
--- a/tests/kickstart_tests/btrfs-1.sh
+++ b/tests/kickstart_tests/btrfs-1.sh
@@ -20,12 +20,13 @@
 . ${KSTESTDIR}/functions.sh
 
 validate() {
-    img=$1
+    disksdir=$1
+    args=$(for d in ${disksdir}/*img; do echo -a ${d}; done)
 
     # There should be a /root/root/RESULT file with results in it.  Check
     # its contents and decide whether the test finally succeeded or
     # not.
-    result=$(virt-cat -a ${img} -m /dev/sda2 /root/root/RESULT)
+    result=$(virt-cat ${args} -m /dev/sda2 /root/root/RESULT)
     if [[ $? != 0 ]]; then
         status=1
         echo '*** /root/RESULT does not exist in VM image.'
diff --git a/tests/kickstart_tests/btrfs-2.sh b/tests/kickstart_tests/btrfs-2.sh
index dd83fb0..9b0c90a 100755
--- a/tests/kickstart_tests/btrfs-2.sh
+++ b/tests/kickstart_tests/btrfs-2.sh
@@ -20,12 +20,13 @@
 . ${KSTESTDIR}/functions.sh
 
 validate() {
-    img=$1
+    disksdir=$1
+    args=$(for d in ${disksdir}/*img; do echo -a ${d}; done)
 
     # There should be a /root/root/RESULT file with results in it.  Check
     # its contents and decide whether the test finally succeeded or
     # not.
-    result=$(virt-cat -a ${img} -m /dev/sda2 /root/root/RESULT)
+    result=$(virt-cat ${args} -m /dev/sda2 /root/root/RESULT)
     if [[ $? != 0 ]]; then
         status=1
         echo '*** /root/RESULT does not exist in VM image.'
-- 
2.4.3



More information about the anaconda-patches mailing list