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/FUNC/FUNCbgpls/FUNCbgpls.py b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
index db60aad..4780ff9 100755
--- a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
+++ b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
@@ -120,7 +120,7 @@
                                  onfail="MCI failed" )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.buckBuild()
         utilities.assert_equals( expect=main.TRUE,
                                      actual=packageResult,
                                      onpass="Successfully created ONOS package",
diff --git a/TestON/tests/FUNC/FUNCflow/FUNCflow.py b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
index 54c81a5..47b536c 100644
--- a/TestON/tests/FUNC/FUNCflow/FUNCflow.py
+++ b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
@@ -145,7 +145,7 @@
                                  onfail="Failed to apply cell to environment " )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage( )
+        packageResult = main.ONOSbench.buckBuild()
         stepResult = packageResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
diff --git a/TestON/tests/FUNC/FUNCintent/FUNCintent.py b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
index 989fd56..6b690d9 100644
--- a/TestON/tests/FUNC/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
@@ -187,7 +187,7 @@
                                  onfail="Failed to apply cell to environment " )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.buckBuild()
         stepResult = packageResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
diff --git a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
index 7a9d295..ee0937f 100644
--- a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
+++ b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
@@ -211,7 +211,7 @@
                                  onfail="Failed to apply cell to environment " )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.buckBuild()
         stepResult = packageResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -1833,4 +1833,4 @@
                                  onpass=main.assertReturnString,
                                  onfail=main.assertReturnString )
 
-        main.intentFunction.report( main )
\ No newline at end of file
+        main.intentFunction.report( main )
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
index 450516a..72fa1df 100755
--- a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
@@ -166,7 +166,7 @@
                                  onfail="Failed to apply cell to environment " )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.buckBuild()
         stepResult = packageResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
diff --git a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
index e311bf9..120d112 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
+++ b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
@@ -157,7 +157,7 @@
                                  onfail="Failed to apply cell to environment " )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.buckBuild()
         stepResult = packageResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
diff --git a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
index 9135daf..09a56c2 100644
--- a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
@@ -194,7 +194,7 @@
                                  onfail="Failed to apply cell to environment " )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.buckBuild()
         stepResult = packageResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
diff --git a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
index 2c4b0ca..4fa0f10 100644
--- a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
+++ b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
@@ -152,7 +152,7 @@
                                  onfail="Failed to apply cell to environment " )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.buckBuild()
         stepResult = packageResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
diff --git a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
index f71d921..82274d0 100644
--- a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
+++ b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
@@ -117,7 +117,7 @@
                                  onfail="MCI failed" )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.buckBuild()
         utilities.assert_equals( expect=main.TRUE,
                                      actual=packageResult,
                                      onpass="Successfully created ONOS package",
diff --git a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
index cf6cdc1..e35ac4e 100644
--- a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
+++ b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
@@ -129,7 +129,7 @@
                                  onfail="MCI failed" )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        packageResult = main.ONOSbench.buckBuild()
         utilities.assert_equals( expect=main.TRUE,
                                  actual=packageResult,
                                  onpass="Successfully created ONOS package",