Add onos_sfc scenario 03/17803/5
authorwuwenbin2 <wuwenbin2@huawei.com>
Fri, 29 Jul 2016 09:18:53 +0000 (17:18 +0800)
committerwuwenbin2 <wuwenbin2@huawei.com>
Sat, 30 Jul 2016 01:56:44 +0000 (09:56 +0800)
JIRA:ONOSFW-172

Change-Id: I019edf79f8d343f794aa7af151d8e30c18e2c5f6
Signed-off-by: wuwenbin2 <wuwenbin2@huawei.com>
ci/exec_test.sh
ci/testcases.yaml
testcases/Controllers/ONOS/Sfc/Sfc.py
testcases/Controllers/ONOS/Teston/onosfunctest.py

index c48bde9..cd5ae18 100755 (executable)
@@ -121,6 +121,9 @@ function run_test(){
         "onos")
             python ${FUNCTEST_REPO_DIR}/testcases/Controllers/ONOS/Teston/onosfunctest.py
         ;;
+        "onos_sfc")
+            python ${FUNCTEST_REPO_DIR}/testcases/Controllers/ONOS/Teston/onosfunctest.py -t sfc
+        ;;
         "promise")
             python ${FUNCTEST_REPO_DIR}/testcases/features/promise.py $report
             sleep 10 # to let the instances terminate
index befcdd4..315969a 100644 (file)
@@ -198,6 +198,16 @@ tiers:
                 dependencies:
                     installer: 'fuel'
                     scenario: 'odl_l2-sfc'
+            -
+                name: onos_sfc
+                criteria: 'status == "PASS"'
+                blocking: true
+                description: >-
+                    Test Suite for onos-sfc to test sfc function.
+                dependencies:
+                    installer: ''
+                    scenario: 'onos-sfc'
+
     -
         name: openstack
         order: 4
index 6b1973e..a520198 100644 (file)
@@ -226,4 +226,9 @@ class Sfc:
                                                    'status': status})
     except:
         logger.error("Error pushing results into Database")
+
+    if status == "FAIL":
+        EXIT_CODE = -1
+        exit(EXIT_CODE)
+
     print("############################END OF SCRIPT ######################")
index 35ced61..2790e69 100755 (executable)
@@ -18,6 +18,7 @@ import datetime
 import os
 import re
 import time
+import argparse
 
 from neutronclient.v2_0 import client as neutronclient
 
@@ -25,6 +26,11 @@ import functest.utils.functest_logger as ft_logger
 import functest.utils.functest_utils as functest_utils
 import functest.utils.openstack_utils as openstack_utils
 
+parser = argparse.ArgumentParser()
+parser.add_argument("-t", "--testcase", help="Testcase name")
+args = parser.parse_args()
+
+
 """ logging configuration """
 logger = ft_logger.Logger("onos").getLogger()
 
@@ -215,11 +221,9 @@ def SetSfcConf():
     logger.info("Modify configuration for SFC")
 
 
-def main():
+def OnosTest():
     start_time = time.time()
     stop_time = start_time
-    # DownloadCodes()
-    # if args.installer == "joid":
     if INSTALLER_TYPE == "joid":
         logger.debug("Installer is Joid")
         SetOnosIpForJoid()
@@ -254,13 +258,19 @@ def main():
     except:
         logger.error("Error pushing results into Database")
 
-    if DEPLOY_SCENARIO == "os-onos-sfc-ha":
+    if status == "FAIL":
+        EXIT_CODE = -1
+        exit(EXIT_CODE)
+
+
+def main():
+
+    if args.testcase == "sfc":
         CreateImage()
         SetSfcConf()
         SfcTest()
-
-    # CleanOnosTest()
-
+    else:
+        OnosTest()
 
 if __name__ == '__main__':
     main()