Merge "Get daisy installer IP"
authorJose Lausuch <jalausuch@suse.com>
Mon, 16 Oct 2017 09:14:23 +0000 (09:14 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 16 Oct 2017 09:14:23 +0000 (09:14 +0000)
jjb/functest/functest-env-presetup.sh

index 7a9b09d..cd15d71 100755 (executable)
@@ -27,5 +27,23 @@ if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
         echo "No available installer VM exists and no credentials provided...exiting"
         exit 1
     fi
+
+elif [[ ${INSTALLER_TYPE} == 'daisy' ]]; then
+    echo "Gathering IP information for Daisy installer VM"
+    if sudo virsh list | grep daisy; then
+        echo "Installer VM detected"
+
+        bridge_name=$(sudo virsh domiflist daisy | grep vnet | awk '{print $3}')
+        echo "Bridge is $bridge_name"
+
+        installer_mac=$(sudo virsh domiflist daisy | grep vnet | \
+                      grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
+        export INSTALLER_IP=$(/usr/sbin/arp -e -i $bridge_name | grep ${installer_mac} | awk {'print $1'})
+
+        echo "Installer ip is ${INSTALLER_IP}"
+    else
+        echo "No available installer VM exists...exiting"
+        exit 1
+    fi
 fi