Apex, Functest: Fixes VM renaming scheme for apex 31/12431/1
authorTim Rozet <trozet@redhat.com>
Mon, 18 Apr 2016 18:09:39 +0000 (14:09 -0400)
committerTim Rozet <trozet@redhat.com>
Mon, 18 Apr 2016 18:09:39 +0000 (14:09 -0400)
In master, the installer VM has been renamed to undercloud.

Change-Id: Ic695dd39e481e51e38c8b601cadd497bf2a8bc1d

jjb/functest/functest-ci-jobs.yml

index c9bf07d..d691140 100644 (file)
             # labconfig is used only for joid
             labconfig=""
             if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
-                instack_mac=$(sudo virsh domiflist instack | grep default | \
-                              grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
+                if virsh list | grep instack; then
+                    instack_mac=$(sudo virsh domiflist instack | grep default | \
+                                  grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
+                elif virsh list | grep undercloud; then
+                    instack_mac=$(sudo virsh domiflist undercloud | grep default | \
+                                  grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
+                else
+                    echo "No available installer VM exists...exiting"
+                    exit 1
+                fi
                 INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'})
                 sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
                 sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable