summaryrefslogtreecommitdiffstats
path: root/jjb/functest/functest-env-presetup.sh
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2017-10-16 10:38:10 +0800
committerAlex Yang <yangyang1@zte.com.cn>2017-10-16 10:38:10 +0800
commit3da2c957aa30d445f87dd12d300ed3789742e337 (patch)
tree46348e4e3344d8b9d26a5abe07b4b168e5c8f5f0 /jjb/functest/functest-env-presetup.sh
parent2dab5a73f0ab1376d924559e2809be0bffe33103 (diff)
Get daisy installer IP
Now the job functest-daisy-baremetal-daily-master runs on zte-pod3, but the INSTALLER_IP in [1] belongs to zte-pod2. Use virsh and arp commands to get the real INSTALLER_IP. [1] https://build.opnfv.org/ci/view/functest/job/functest-daisy-baremetal-daily-master/151/console Change-Id: I9e297b8f7a240437f81b4c3e2eab5949ac9d5e51 Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'jjb/functest/functest-env-presetup.sh')
-rwxr-xr-xjjb/functest/functest-env-presetup.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/jjb/functest/functest-env-presetup.sh b/jjb/functest/functest-env-presetup.sh
index 7a9b09d2c..cd15d7194 100755
--- a/jjb/functest/functest-env-presetup.sh
+++ b/jjb/functest/functest-env-presetup.sh
@@ -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