Netvirt CSIT with controller based DHCP 60/53560/9
authorAlon Kochba <alonko@hpe.com>
Mon, 20 Mar 2017 13:08:52 +0000 (15:08 +0200)
committerJamo Luhrsen <jluhrsen@redhat.com>
Sun, 2 Apr 2017 14:19:43 +0000 (14:19 +0000)
Change-Id: I56e124e320993d9d5617911402e6b54638ae1735
Signed-off-by: Alon Kochba <alonko@hpe.com>
csit/scripts/set_dhcp_mode.sh [new file with mode: 0644]

diff --git a/csit/scripts/set_dhcp_mode.sh b/csit/scripts/set_dhcp_mode.sh
new file mode 100644 (file)
index 0000000..84d158e
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+ODL_DHCP_ENABLED=${ODL_DHCP_SERVICE_ENABLED:-false}
+
+cat > ${WORKSPACE}/set_dhcp_mode.sh <<EOF
+
+    mkdir -p /tmp/${BUNDLEFOLDER}/etc/opendaylight/datastore/initial/config/
+    export CONFFILE=\`find /tmp/${BUNDLEFOLDER} -name "*dhcpservice*config.xml"\`
+    cp \$CONFFILE /tmp/${BUNDLEFOLDER}/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml
+    sed -i s/false/${ODL_DHCP_ENABLED}/ /tmp/${BUNDLEFOLDER}/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml
+    cat /tmp/${BUNDLEFOLDER}/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml
+
+EOF
+
+echo "Copying config files to ODL Controller folder"
+for i in `seq 1 ${NUM_ODL_SYSTEM}`
+do
+        CONTROLLERIP=ODL_SYSTEM_${i}_IP
+
+        echo "Setting Controller based DHCP mode to ${ODL_DHCP_ENABLED} on ${!CONTROLLERIP}"
+        scp ${WORKSPACE}/set_dhcp_mode.sh ${!CONTROLLERIP}:/tmp/
+        ssh ${!CONTROLLERIP} 'bash /tmp/set_dhcp_mode.sh'
+
+done