summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/functest_sim.sh17
-rwxr-xr-xscripts/resource_cleanup.sh2
2 files changed, 15 insertions, 4 deletions
diff --git a/scripts/functest_sim.sh b/scripts/functest_sim.sh
index 5c22e64..5bdded2 100755
--- a/scripts/functest_sim.sh
+++ b/scripts/functest_sim.sh
@@ -1,9 +1,17 @@
+##############################################################################
+# Copyright (c) 2017 Juraj Linkes (Cisco) and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
#!/bin/bash
# NETWORK AND SUBNET
echo "Creating network with subnet"
neutron net-create test-net
neutron subnet-create --name test-subnet test-net 192.168.20.0/24
-net_id=`neutron net-list | grep test-net | cut -f 2 -d " "`
+net_id=$(neutron net-list | grep test-net | cut -f 2 -d " ")
# ATTACH NETWORK TO ROUTER
echo "Attaching external and tenant networks to router"
@@ -32,5 +40,8 @@ nova add-secgroup test-vm2 test-secgroup
# FLOATING IP
echo "Creating and associating floating IP for the first VM"
-floatingip_id=`neutron floatingip-create external | grep " id " | tr -s " " | cut -f 4 -d " "`
-neutron floatingip-associate $floatingip_id `neutron port-list | grep 192.168.20.3 | cut -d " " -f 2`
+floatingip_id=$(neutron floatingip-create external | grep " id " |
+ tr -s " " | cut -f 4 -d " ")
+neutron floatingip-associate $floatingip_id $(neutron port-list |
+ grep $(nova show test-vm1 | grep "test-net network" |
+ grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+") | cut -d " " -f 2)
diff --git a/scripts/resource_cleanup.sh b/scripts/resource_cleanup.sh
index 0344dfa..93d41c9 100755
--- a/scripts/resource_cleanup.sh
+++ b/scripts/resource_cleanup.sh
@@ -199,7 +199,7 @@ clean_overcloud_resource() {
then
if [[ $(grep -c vpp-exec /etc/vpp/startup.conf) -eq 0 ]]
then
- sed '/unix {/ a \ \ exec /etc/vpp/vpp-exec' /etc/vpp/startup.conf
+ sed -i '/unix {/ a \ \ exec /etc/vpp/vpp-exec' /etc/vpp/startup.conf
fi
INTERFACES=$(grep -Eo "[^ ]*GigabitEthernet[^ ]+" /etc/vpp/vpp-exec | uniq | sort)
else