Use buck for tests
- use buck instead of maven
- cleanup output when building cluster.json file
- swap the correct nodes in swap nodes test
(cherry picked from commit 4b66b32e5057d84175195a9c5a823e59cb66fa67)
Change-Id: If5981567115fd3acdc353f4a2ee620f5e0a29716
diff --git a/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
index 94d5515..8b5add6 100644
--- a/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
@@ -193,7 +193,7 @@
main.log.wiki(graphs)
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.buckBuild()
utilities.assert_equals( expect=main.TRUE, actual=packageResult,
onpass="ONOS package successful",
onfail="ONOS package failed" )
diff --git a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
index 0da776c..a85d949 100644
--- a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
+++ b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
@@ -205,7 +205,7 @@
dstDir,
pwd=main.ONOSbench.pwd,
direction="from" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.buckBuild()
utilities.assert_equals( expect=main.TRUE, actual=packageResult,
onpass="ONOS package successful",
onfail="ONOS package failed" )
diff --git a/TestON/tests/HA/HAkillNodes/HAkillNodes.py b/TestON/tests/HA/HAkillNodes/HAkillNodes.py
index c8df1f9..147f183 100644
--- a/TestON/tests/HA/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HA/HAkillNodes/HAkillNodes.py
@@ -212,7 +212,7 @@
dstDir,
pwd=main.ONOSbench.pwd,
direction="from" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.buckBuild()
utilities.assert_equals( expect=main.TRUE, actual=packageResult,
onpass="ONOS package successful",
onfail="ONOS package failed" )
diff --git a/TestON/tests/HA/HAsanity/HAsanity.py b/TestON/tests/HA/HAsanity/HAsanity.py
index c8ae7d9..fd850fc 100644
--- a/TestON/tests/HA/HAsanity/HAsanity.py
+++ b/TestON/tests/HA/HAsanity/HAsanity.py
@@ -194,7 +194,7 @@
main.log.wiki(graphs)
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.buckBuild()
utilities.assert_equals( expect=main.TRUE, actual=packageResult,
onpass="ONOS package successful",
onfail="ONOS package failed" )
diff --git a/TestON/tests/HA/HAscaling/HAscaling.py b/TestON/tests/HA/HAscaling/HAscaling.py
index b0bc126..4fd29f3 100644
--- a/TestON/tests/HA/HAscaling/HAscaling.py
+++ b/TestON/tests/HA/HAscaling/HAscaling.py
@@ -238,14 +238,20 @@
main.log.warn( sed )
main.log.warn( repr( sed ) )
handle.sendline( sed )
+ handle.expect( metaFile )
+ output = handle.before
handle.expect( "\$" )
- main.log.debug( repr( handle.before ) )
+ output += handle.before
+ main.log.debug( repr( output ) )
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.buckBuild()
utilities.assert_equals( expect=main.TRUE, actual=packageResult,
onpass="ONOS package successful",
onfail="ONOS package failed" )
+ if not packageResult:
+ main.cleanup()
+ main.exit()
main.step( "Installing ONOS package" )
onosInstallResult = main.TRUE
diff --git a/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py b/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
index bd581ae..be59032 100644
--- a/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
+++ b/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
@@ -183,7 +183,7 @@
cellResult = main.ONOSbench.setCell( "SingleHA" )
verifyResult = main.ONOSbench.verifyCell()
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.buckBuild()
utilities.assert_equals( expect=main.TRUE, actual=packageResult,
onpass="ONOS package successful",
onfail="ONOS package failed" )
diff --git a/TestON/tests/HA/HAstopNodes/HAstopNodes.py b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
index 9b0f7a7..a3b818f 100644
--- a/TestON/tests/HA/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
@@ -205,7 +205,7 @@
dstDir,
pwd=main.ONOSbench.pwd,
direction="from" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.buckBuild()
utilities.assert_equals( expect=main.TRUE, actual=packageResult,
onpass="ONOS package successful",
onfail="ONOS package failed" )
diff --git a/TestON/tests/HA/HAswapNodes/HAswapNodes.py b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
index 0065ecf..5c8d694 100644
--- a/TestON/tests/HA/HAswapNodes/HAswapNodes.py
+++ b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
@@ -232,14 +232,20 @@
main.log.warn( sed )
main.log.warn( repr( sed ) )
handle.sendline( sed )
+ handle.expect( metaFile )
+ output = handle.before
handle.expect( "\$" )
- main.log.debug( repr( handle.before ) )
+ output += handle.before
+ main.log.debug( repr( output ) )
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.buckBuild()
utilities.assert_equals( expect=main.TRUE, actual=packageResult,
onpass="ONOS package successful",
onfail="ONOS package failed" )
+ if not packageResult:
+ main.cleanup()
+ main.exit()
main.step( "Installing ONOS package" )
onosInstallResult = main.TRUE
@@ -1839,7 +1845,7 @@
main.log.warn( main.ONOSbench.checkLogs( node.ip_address ) )
main.step( "Generate new metadata file" )
- old = [ main.activeNodes[0], main.activeNodes[-1] ]
+ old = [ main.activeNodes[1], main.activeNodes[-2] ]
new = range( main.ONOSbench.maxNodes )[-2:]
assert len( old ) == len( new ), "Length of nodes to swap don't match"
handle = main.ONOSbench.handle