diff options
-rw-r--r-- | docker/Dockerfile | 2 | ||||
-rwxr-xr-x | docs/com/pres/testapi.html | 43 | ||||
-rw-r--r-- | testcases/Controllers/ONOS/Teston/adapters/environment.py | 2 | ||||
-rw-r--r-- | testcases/Controllers/ONOS/Teston/onosfunctest.py | 14 | ||||
-rw-r--r-- | testcases/vIMS/vIMS.py | 14 |
5 files changed, 46 insertions, 29 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 874a0638f..ae1343c2d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -75,7 +75,7 @@ RUN git clone https://github.com/openstack/tempest.git ${repos_dir}/tempest RUN git clone https://git.opendaylight.org/gerrit/p/integration/test.git ${repos_dir}/odl_test RUN git clone -b stable https://github.com/boucherv-orange/clearwater-live-test ${repos_dir}/vims-test RUN git clone https://github.com/openstack/networking-bgpvpn ${repos_dir}/bgpvpn -RUN git clone https://gerrit.onosproject.org/OnosSystemTest ${repos_dir}/onos +RUN git clone https://github.com/wuwenbin2/OnosSystemTest.git ${repos_dir}/onos RUN git clone https://github.com/opnfv/promise ${repos_dir}/promise RUN git clone https://gerrit.opnfv.org/gerrit/ovno ${repos_dir}/ovno diff --git a/docs/com/pres/testapi.html b/docs/com/pres/testapi.html index 0f51251d3..c27c21ded 100755 --- a/docs/com/pres/testapi.html +++ b/docs/com/pres/testapi.html @@ -77,10 +77,15 @@ * Many locations (in VM, Jumphost, external DB,...) </section> <section data-markdown> + <script type='text/template'> ## Achieve using testAPI * Uniform API: testAPI * Uniform format: JSON * Universal Location: http://testresults.opnfv.org + <aside class='notes'> + By using testAPI, we hope to provide a uniform way of collection and saving test results to a universal location + </aside> + </script> </section> <section data-markdown> @@ -122,15 +127,21 @@ </section> <section> <h2>Colorado refactoring</h2> - <ul>Unit tests + <ul> + <li>Unit tests</li> <li>Update of the data model</li> - <li>Swagger tornado framework for the doc</li> + <li>Tornado_swagger for the documentation</li> <li>URL and MongoDB collection renaming</li> - <li>Scripts to support backup/restore/update DB</li> + <li>Scripts to support databse backup/restore/update</li> <li>Support installation</li> + <aside class='notes'> + So you can discover and understand the capabilities of the service without + access to source code, documentation, or through network traffic inspection, + and also you can interact with the testAPI directly through swagger website. + </aside> </ul> <p class="fragment fade-up"><b>All done in Colorado!</b></p> - </section> + </section> </section> <section> @@ -141,12 +152,12 @@ <section> <h2> URI changes...</h2> <div style="text-align:left""> - <p> testresults.opnfv.org/test/testapi => <br>testresults.opnfv.org/test/api/v1 </p> + <p> testresults.opnfv.org/<span style="color:lightblue">testapi</span> => <br>testresults.opnfv.org/<span style="color:yellow">test/api/v1</span> </p> - <p> http://testresults.opnfv.org/test/api/v1/<b>pods</b></p> - <p> http://testresults.opnfv.org/test/api/v1/<b>projects</b></p> - <p> http://testresults.opnfv.org/test/api/v1/projects/qtip/<b>cases</b></p> - <p> http://testresults.opnfv.org/test/api/v1/<b>results</b></p> + <p> /test/api/v1/<b>pods</b></p> + <p> /test/api/v1/<b>projects</b></p> + <p> /test/api/v1/projects/qtip/<b>cases</b></p> + <p> /test/api/v1/<b>results</b></p> </div> </section> <section data-markdown> @@ -160,15 +171,21 @@ | Item | Brahmaputra | Colorado | | :--- | :--- | :--- | | date | creation_date | start_date and stop_date | - | version | used as scenario | git version | + | version | used as scenario | opnfv release version | </section> <section data-markdown> + <script type='text/template'> ## New fields for results | Item | Colorado | | :--- | :--- | | scenario | used for scenario | - | criteria | Pass/Failed | + | criteria | PASS/FAILED | | trust_indicator | between 0 and 1| + <aside class='notes'> + to detect if the test case is stable over time and further more to avoid + running it systematically and saving time for other long duration test cases + </aside> + </script> </section> <section data-markdown> ## One new filter for results @@ -206,8 +223,8 @@ OK </section> <section data-markdown> ## Roadmap - * Dockerized testAPI - * Integration with Kibana + * Dockerize testAPI + * Automatic update of testAPI * Command Line Interface * Automatic update for pods/projects/testcases </section> diff --git a/testcases/Controllers/ONOS/Teston/adapters/environment.py b/testcases/Controllers/ONOS/Teston/adapters/environment.py index 69c4c010c..231677333 100644 --- a/testcases/Controllers/ONOS/Teston/adapters/environment.py +++ b/testcases/Controllers/ONOS/Teston/adapters/environment.py @@ -268,7 +268,7 @@ class environment(connection): self.AddKnownHost(handle, self.OC2, "karaf", "karaf") self.AddKnownHost(handle, self.OC3, "karaf", "karaf") self.DownLoadCode(handle, - 'https://github.com/sunyulin/OnosSystemTest.git') + 'https://github.com/wuwenbin2/OnosSystemTest.git') # self.DownLoadCode(handle, 'https://gerrit.onosproject.org/onos') if self.masterusername == 'root': filepath = '/root/' diff --git a/testcases/Controllers/ONOS/Teston/onosfunctest.py b/testcases/Controllers/ONOS/Teston/onosfunctest.py index 058114bde..f97d415d2 100644 --- a/testcases/Controllers/ONOS/Teston/onosfunctest.py +++ b/testcases/Controllers/ONOS/Teston/onosfunctest.py @@ -45,7 +45,7 @@ if not os.path.exists(REPO_PATH): logger.error("Functest repository directory not found '%s'" % REPO_PATH) exit(-1) -ONOSCI_PATH = REPO_PATH + 'testcases/Controllers/ONOS/Teston/' +ONOSCI_PATH = ONOS_REPO_PATH + "/" starttime = datetime.datetime.now() HOME = os.environ['HOME'] + "/" @@ -57,12 +57,12 @@ def RunScript(testname): Parameters: testname: ONOS Testcase Name """ - runtest = ONOSCI_PATH + "OnosSystemTest/TestON/bin/cli.py run " + testname + runtest = ONOSCI_PATH + "onos/TestON/bin/cli.py run " + testname logger.debug("Run script " + testname) os.system(runtest) -def DownloadCodes(url="https://github.com/sunyulin/OnosSystemTest.git"): +def DownloadCodes(url="https://github.com/wuwenbin2/OnosSystemTest.git"): """ Download Onos Teston codes Parameters: @@ -74,7 +74,7 @@ def DownloadCodes(url="https://github.com/sunyulin/OnosSystemTest.git"): def GetResult(): - LOGPATH = ONOSCI_PATH + "OnosSystemTest/TestON/logs" + LOGPATH = ONOSCI_PATH + "onos/TestON/logs" cmd = "grep -rnh " + "Fail" + " " + LOGPATH Resultbuffer = os.popen(cmd).read() # duration = datetime.datetime.now() - starttime @@ -156,7 +156,7 @@ def SetOnosIpForJoid(): def CleanOnosTest(): - TESTONPATH = ONOSCI_PATH + "OnosSystemTest/" + TESTONPATH = ONOSCI_PATH + "onos/" cmd = "rm -rf " + TESTONPATH os.system(cmd) time.sleep(2) @@ -166,7 +166,7 @@ def CleanOnosTest(): def main(): start_time = time.time() stop_time = start_time - DownloadCodes() + # DownloadCodes() if args.installer == "joid": logger.debug("Installer is Joid") SetOnosIpForJoid() @@ -202,7 +202,7 @@ def main(): except: logger.error("Error pushing results into Database") - CleanOnosTest() + # CleanOnosTest() if __name__ == '__main__': diff --git a/testcases/vIMS/vIMS.py b/testcases/vIMS/vIMS.py index a35eba98d..20a61158e 100644 --- a/testcases/vIMS/vIMS.py +++ b/testcases/vIMS/vIMS.py @@ -26,8 +26,8 @@ import glanceclient.client as glclient import novaclient.client as nvclient from neutronclient.v2_0 import client as ntclient -from clearwater import * -from orchestrator import * +from clearwater import clearwater +from orchestrator import orchestrator import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as functest_utils @@ -89,6 +89,7 @@ CW_REQUIERMENTS = functest_yaml.get("vIMS").get( CFY_DEPLOYMENT_DURATION = 0 CW_DEPLOYMENT_DURATION = 0 +TESTCASE_START_TIME = time.time() RESULTS = {'orchestrator': {'duration': 0, 'result': ''}, 'vIMS': {'duration': 0, 'result': ''}, 'sig_test': {'duration': 0, 'result': ''}} @@ -117,14 +118,13 @@ def step_failure(step_name, error_msg): set_result(step_name, 0, error_msg) status = "FAIL" # in case of failure starting and stoping time are not correct - start_time = time.time() - stop_time = start_time + stop_time = time.time() if step_name == "sig_test": status = "PASS" functest_utils.push_results_to_db("functest", "vims", None, - start_time, + TESTCASE_START_TIME, stop_time, status, RESULTS) @@ -244,9 +244,9 @@ def test_clearwater(): logger.error("Unable to set test status") functest_utils.push_results_to_db("functest", - "vIMS", + "vims", logger, - start_time_ts, + TESTCASE_START_TIME, end_time_ts, status, RESULTS) |