Add check of external network before running any test
authorjose.lausuch <jose.lausuch@ericsson.com>
Mon, 11 Jan 2016 09:52:10 +0000 (10:52 +0100)
committerjose.lausuch <jose.lausuch@ericsson.com>
Mon, 11 Jan 2016 09:52:10 +0000 (10:52 +0100)
Change-Id: I3ab58d924a8e53f2e6375c1c7fa77361d91b5efb
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
testcases/VIM/OpenStack/CI/libraries/check_os.sh

index 3cc0ee1..88c7607 100755 (executable)
@@ -71,4 +71,21 @@ do
 done
 
 echo "OpenStack services are OK."
+
+echo "Checking External network..."
+networks=($(neutron net-list | tail -n +4 | head -n -1 | awk '{print $2}'))
+is_external=False
+for net in "${networks[@]}"
+do
+    is_external=$(neutron net-show $net|grep "router:external"|awk '{print $4}')
+    if [ $is_external == "True" ]; then
+        echo "External network found: $net"
+        break
+    fi
+done
+if [ $is_external == "False" ]; then
+    echo "ERROR: There are no external networks in the deployment."
+    exit 1
+fi
+
 exit 0