[ONOS-6800] onosNetCFG driver function should not append ".json" to the file name
Change-Id: I16eeaa908a99a8e1c8f58bea00dba00d11367e89
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 46d978f..aa2b563 100755
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -2474,12 +2474,12 @@
return main.TRUE if onosStatus else main.FALSE
- def onosNetCfg( self, controllerIps, path, fileName ):
+ def onosNetCfg( self, controllerIp, path, fileName ):
"""
Push a specified json file to ONOS through the onos-netcfg service
Required:
- controllerIps - the Ips of the ONOS nodes in the cluster
+ controllerIp - the Ip of the ONOS node in the cluster
path - the location of the file to be sent
fileName - name of the json file to be sent
@@ -2487,16 +2487,15 @@
there is an error.
"""
try:
- for ip in controllerIps:
- cmd = "onos-netcfg {0} {1}{2}.json".format( ip, path, fileName )
- main.log.info( "Sending: " + cmd )
- main.ONOSbench.handle.sendline( cmd )
- handle = self.handle.before
- if "Error" in handle:
- main.log.error( self.name + ": " + self.handle.before )
- return main.FALSE
- else:
- self.handle.expect( self.prompt )
+ cmd = "onos-netcfg {0} {1}{2}".format( controllerIp, path, fileName )
+ main.log.info( "Sending: " + cmd )
+ main.ONOSbench.handle.sendline( cmd )
+ handle = self.handle.before
+ if "Error" in handle:
+ main.log.error( self.name + ": " + self.handle.before )
+ return main.FALSE
+ else:
+ self.handle.expect( self.prompt )
return main.TRUE
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
diff --git a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
index c7ae463..aae4b15 100644
--- a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
+++ b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
@@ -222,8 +222,12 @@
"""
main.case( "Mininet with Linc-OE startup" )
main.step( "Push TopoDDriver.json to ONOS through onos-netcfg" )
- topoResult = main.ONOSbench.onosNetCfg( controllerIps=main.activeONOSip, path=main.dependencyPath,
- fileName="TopoDDriver" )
+ topoResult = True
+ for ip in main.activeONOSip:
+ topoResult = topoResult and \
+ main.ONOSbench.onosNetCfg(controllerIp=ip, path=main.dependencyPath,
+ fileName="TopoDDriver.json")
+
#Exit if topology did not load properly
if not topoResult:
main.cleanup()