summaryrefslogtreecommitdiffstats
path: root/testcases/Controllers/ONOS
diff options
context:
space:
mode:
authorlanqinglong <lanqinglong@huawei.com>2016-01-28 18:06:07 +0800
committerMorgan Richomme <morgan.richomme@orange.com>2016-01-28 10:10:47 +0000
commit755d64d0e25e5354b6fd50fdfc55c66068ba3cdf (patch)
tree3a67445b4d0870956998b4134fad2a36602485f5 /testcases/Controllers/ONOS
parent74a3a087033a3607c675f8d812f9d9940d32686a (diff)
change for get joid onos ip
(cherry picked from commit 03ec0a88e72ed6c2fdc2995d0c93d2c61f847ae3) Change-Id: Ic6d420d855615ddf53de707c19771fffaba47bbf
Diffstat (limited to 'testcases/Controllers/ONOS')
-rw-r--r--testcases/Controllers/ONOS/Teston/CI/onosfunctest.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py b/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py
index 64b8ac1de..eb2c7936c 100644
--- a/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py
+++ b/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py
@@ -21,7 +21,11 @@ import logging
import yaml
import datetime
import re
+import argparse
+parser = argparse.ArgumentParser()
+parser.add_argument("-i", "--installer", help="Installer type")
+args = parser.parse_args()
""" logging configuration """
logger = logging.getLogger('onos')
@@ -97,7 +101,14 @@ def GetResult():
def SetOnosIp():
cmd = "keystone catalog --service network | grep publicURL"
cmd_output = os.popen(cmd).read()
- print cmd_output
+ OC1=re.search(r"\d+\.\d+\.\d+\.\d+",cmd_output).group()
+ os.environ['OC1'] = OC1
+ time.sleep(2)
+ logger.debug( "ONOS IP is " + OC1)
+
+def SetOnosIpForJoid():
+ cmd = "env | grep SDN_CONTROLLER"
+ cmd_output = os.popen(cmd).read()
OC1=re.search(r"\d+\.\d+\.\d+\.\d+",cmd_output).group()
os.environ['OC1'] = OC1
time.sleep(2)
@@ -113,7 +124,11 @@ def CleanOnosTest():
def main():
DownloadCodes()
- SetOnosIp()
+ if args.installer == "joid":
+ logger.debug( "Installer is Joid")
+ SetOnosIpForJoid()
+ else:
+ SetOnosIp()
RunScript("FUNCvirNetNB")
RunScript("FUNCvirNetNBL3")