summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2017-09-13 21:10:40 +0800
committerZhijiang Hu <hu.zhijiang@zte.com.cn>2017-09-25 06:07:18 +0000
commit6c26da419ff6fd6f82377e8e19187af37fe8d783 (patch)
tree0eb0259e41adc2d6b6c61dd5412f72dae351b20c /ci
parent459282da6a51520ed3a255f80569a437881a047a (diff)
Use pxe bridge to replace the bridge in VM template
1. Eliminate hard code about pxe bridge 2. Replace the bridge in daisy VM template with the pxe bridge provided by jenkins Change-Id: I7a8463181847417d10705ce9ff4db6e68d505c6d Signed-off-by: Alex Yang <yangyang1@zte.com.cn> (cherry picked from commit 56975272e92efa3f5f6f719028dc147c1d90e9ce)
Diffstat (limited to 'ci')
-rwxr-xr-xci/deploy/deploy.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh
index e60cdd54..2b987f7d 100755
--- a/ci/deploy/deploy.sh
+++ b/ci/deploy/deploy.sh
@@ -365,6 +365,15 @@ function clean_up_target_vnetworks()
done
}
+function update_pxe_bridge()
+{
+ bridge_name=$(grep "<source * bridge" $BMDEPLOY_DAISY_SERVER_VM | awk -F "'" '{print $2}') || True
+ if [ ${bridge_name} ] && [ ${bridge_name} != ${BRIDGE} ] && [ ! -z ${bridge_name} ]; then
+ echo "Use $BRIDGE to replace the bridge in $BMDEPLOY_DAISY_SERVER_VM"
+ sed -i -e "/source * bridge/{s/source.*$/source bridge=\'$BRIDGE\'\/>/;}" $BMDEPLOY_DAISY_SERVER_VM
+ fi
+}
+
function create_daisy_vm_and_networks()
{
echo "====== Create Daisy VM ======"
@@ -372,6 +381,7 @@ function create_daisy_vm_and_networks()
if [ $IS_BARE == 0 ];then
create_node $VMDELOY_DAISY_SERVER_NET daisy1 $VMDEPLOY_DAISY_SERVER_VM daisy
else
+ update_pxe_bridge
virsh define $BMDEPLOY_DAISY_SERVER_VM
virsh start daisy
fi