summaryrefslogtreecommitdiffstats
path: root/tests/adhoc
diff options
context:
space:
mode:
authorblsaws <bryan.sullivan@att.com>2016-08-18 18:57:28 -0700
committerblsaws <bryan.sullivan@att.com>2016-08-18 18:57:28 -0700
commitdb9723db63b2c17e1624151caaa32626adaacc45 (patch)
treeb99c02b91cd557180cf0586f18bbc39b7471bf75 /tests/adhoc
parent60a43e0ec19066230ce5f18c559b4677553f999f (diff)
Align get external net function
JIRA: COPPER-4 Change-Id: Ifb0dec68f632af03dfd1debced90cab0b8f7ba5b Signed-off-by: blsaws <bryan.sullivan@att.com>
Diffstat (limited to 'tests/adhoc')
-rw-r--r--tests/adhoc/smoke01.sh17
1 files changed, 6 insertions, 11 deletions
diff --git a/tests/adhoc/smoke01.sh b/tests/adhoc/smoke01.sh
index a7790d5..60fb878 100644
--- a/tests/adhoc/smoke01.sh
+++ b/tests/adhoc/smoke01.sh
@@ -53,17 +53,12 @@ fi
# Find external network if any, and details
function get_external_net () {
- echo "Find external network"
- LINE=4
- ID=$(openstack network list | awk "NR==$LINE{print \$2}")
- while [[ $ID ]]
- do
- if [[ $(openstack network show $ID | awk "/ router/ { print \$4 }") == "External" ]]; then break; fi
- ((LINE+=1))
- ID=$(openstack network list | awk "NR==$LINE{print \$2}")
- done
- if [[ $ID ]]; then
- EXTERNAL_NETWORK_NAME=$(openstack network show $ID | awk "/ name / { print \$4 }")
+ network_ids=($(neutron net-list|grep -v "+"|grep -v name|awk '{print $2}'))
+ for id in ${network_ids[@]}; do
+ [[ $(neutron net-show ${id}|grep 'router:external'|grep -i "true") != "" ]] && ext_net_id=${id}
+ done
+ if [[ $ext_net_id ]]; then
+ EXTERNAL_NETWORK_NAME=$(openstack network show $ext_net_id | awk "/ name / { print \$4 }")
EXTERNAL_SUBNET_ID=$(openstack network show $EXTERNAL_NETWORK_NAME | awk "/ subnets / { print \$4 }")
else
echo "External network not found"