[ONOS-7544]: FUNCnetconf test fix: config format & added nodes check
Change-Id: I766ad9309f3a735ff33be2b46703e0bca5b961cb
diff --git a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.params b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.params
index e233dc5..fc3e23a 100644
--- a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.params
+++ b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.params
@@ -25,6 +25,7 @@
<wrapper2>netconf</wrapper2>
<wrapper3>topo</wrapper3>
<topology></topology>
+ <iface></iface>
</DEPENDENCY>
<ENV>
diff --git a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
index 566cb2b..d374b15 100644
--- a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
@@ -54,6 +54,7 @@
main.dependencyPath = main.testOnDirectory + \
main.params[ 'DEPENDENCY' ][ 'path' ]
# main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
+ main.iface = main.params[ 'DEPENDENCY' ][ 'iface' ]
main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
@@ -106,6 +107,12 @@
- Connect to cli
"""
main.testSetUp.ONOSSetUp( main.Cluster, True )
+ time.sleep( main.startUpSleep )
+ utilities.assert_equals(expect=True,
+ actual=main.Cluster.nodesCheck(),
+ onpass="Nodes check successful.",
+ onfail="Nodes check failed.")
+
def CASE19( self, main ):
"""
diff --git a/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py b/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py
index b8e7054..121eb67 100644
--- a/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py
@@ -48,14 +48,7 @@
"""
startResult = main.FALSE
try:
- main.ONOSbench.handle.sendline( "" )
- main.ONOSbench.handle.expect( "\$" )
- main.ONOSbench.handle.sendline( "ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'" )
- main.ONOSbench.handle.expect( "\$1 }'" )
- main.ONOSbench.handle.expect( "\$" )
- main.configDeviceIp = main.ONOSbench.handle.before
- main.configDeviceIp = main.configDeviceIp.split()
- main.configDeviceIp = main.configDeviceIp[ 0 ]
+ main.configDeviceIp = main.ONOSbench.getIpAddr( iface=main.iface )
main.log.info( "Device to be configured: " + str( main.configDeviceIp ) )
main.ONOSbench.handle.sendline( "sudo ofc-server" )
main.ONOSbench.handle.expect( "\$" )
@@ -76,13 +69,21 @@
"""
createCfgResult = main.FALSE
# TODO, add ability to set Manufacturer, Hardware and Software versions
- main.cfgJson = '{ "devices":{ "netconf:' + main.configDeviceIp + ":" +\
- main.configDevicePort + '":' + '{ "basic":{ "driver":"' +\
- main.configDriver + '" } } }, "apps": { "' +\
- main.configApps + '":{ "netconf_devices":[ { "username":' +\
- main.configName + ', "password":' + main.configPass +\
- ', "ip":"' + main.configDeviceIp + '", "port":' +\
- main.configPort + '} ] } } }'
+ main.cfgJson = '{' \
+ '"devices": {' \
+ '"netconf:' + main.configDeviceIp + ':' + main.configDevicePort + '": {' \
+ '"netconf": {' \
+ '"ip": "' + main.configDeviceIp + '",' \
+ '"port": ' + main.configPort + ',' \
+ '"username": ' + main.configName + ',' \
+ '"password": ' + main.configPass + \
+ '},' \
+ '"basic": {' \
+ '"driver": "' + main.configDriver + '"' \
+ '}' \
+ '}' \
+ '}' \
+ '}'
try:
file = open( os.path.dirname( main.testFile ) + "/dependencies/netconfConfig.json", 'w' )
# These lines can cause errors during the configuration process because