From 3da2c957aa30d445f87dd12d300ed3789742e337 Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Mon, 16 Oct 2017 10:38:10 +0800 Subject: 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 --- jjb/functest/functest-env-presetup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'jjb/functest') 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 -- cgit 1.2.3-korg