Add option to look for IP based on iface
Change-Id: Icc186386b73f262224aad273040ace9ff5ce1bd4
diff --git a/TestON/tests/HA/HAswapNodes/HAswapNodes.params b/TestON/tests/HA/HAswapNodes/HAswapNodes.params
index 7253612..d3729a4 100644
--- a/TestON/tests/HA/HAswapNodes/HAswapNodes.params
+++ b/TestON/tests/HA/HAswapNodes/HAswapNodes.params
@@ -19,7 +19,10 @@
#CASE17: Check for basic functionality with distributed primitives
<testcases>1,[2,8,21,3,8,4,5,14,16,17]*1,6,8,3,7,4,15,17,9,8,4,10,8,4,11,8,4,12,8,4,13</testcases>
- <serverPort>8000</serverPort>
+ <server>
+ <port>8000</port>
+ <interface>eth0</interface>
+ </server>
<apps></apps>
<ONOS_Configuration>
<org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator>
diff --git a/TestON/tests/HA/HAswapNodes/HAswapNodes.py b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
index 30efbbd..8ea1490 100644
--- a/TestON/tests/HA/HAswapNodes/HAswapNodes.py
+++ b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
@@ -130,7 +130,7 @@
killResults = killResults and killed
main.step( "Setup server for cluster metadata file" )
- port = main.params['serverPort']
+ port = main.params['server']['port']
rootDir = os.path.dirname( main.testFile ) + "/dependencies"
main.log.debug( "Root dir: {}".format( rootDir ) )
status = main.Server.start( main.ONOSbench,
@@ -221,7 +221,8 @@
onfail="Copy backup config file failed" )
# we need to modify the onos-service file to use remote metadata file
# url for cluster metadata file
- ip = main.ONOSbench.getIpAddr()
+ iface = main.params['server'].get( 'interface' )
+ ip = main.ONOSbench.getIpAddr( iface=iface )
metaFile = "cluster.json"
javaArgs = r"-Donos.cluster.metadata.uri=http:\/\/{}:{}\/{}".format( ip, port, metaFile )
main.log.warn( javaArgs )