Merge "Record the test cases passed in tempest"
authorCedric Ollivier <cedric.ollivier@orange.com>
Thu, 10 Aug 2017 09:23:50 +0000 (09:23 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Thu, 10 Aug 2017 09:23:50 +0000 (09:23 +0000)
29 files changed:
build.sh
docker/Dockerfile
docker/components/Dockerfile [new file with mode: 0644]
docker/components/hooks/post_checkout [new file with mode: 0644]
docker/components/testcases.yaml [new file with mode: 0644]
docker/features/Dockerfile [new file with mode: 0644]
docker/features/hooks/post_checkout [new file with mode: 0644]
docker/features/testcases.yaml [new file with mode: 0644]
docker/features/thirdparty-requirements.txt [new file with mode: 0644]
docker/healthcheck/hooks/build [deleted file]
docker/healthcheck/hooks/post_checkout [new file with mode: 0644]
docker/smoke/Dockerfile
docker/smoke/hooks/build [deleted file]
docker/smoke/hooks/post_checkout [new file with mode: 0644]
docker/smoke/testcases.yaml
docker/smoke/thirdparty-requirements.txt
functest/ci/config_functest.yaml
functest/ci/testcases.yaml
functest/opnfv_tests/openstack/tempest/conf_utils.py
functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml [new file with mode: 0644]
functest/opnfv_tests/openstack/vping/ping.sh
functest/opnfv_tests/sdn/odl/odl.py
functest/opnfv_tests/sdn/onos/teston/adapters/connection.py
functest/opnfv_tests/sdn/onos/teston/adapters/environment.py
functest/tests/unit/core/test_feature.py
functest/tests/unit/openstack/tempest/test_conf_utils.py
functest/tests/unit/vnf/ims/test_cloudify_ims.py
functest/tests/unit/vnf/ims/test_orchestra_ims.py
functest/tests/unit/vnf/rnc/__init__.py [deleted file]

index dbc79e0..77ea98b 100644 (file)
--- a/build.sh
+++ b/build.sh
@@ -3,11 +3,17 @@
 set -e
 
 repo=${repo:-opnfv}
+dirs="\
+docker/core \
+docker/healthcheck \
+docker/smoke \
+docker/features \
+docker/components"
 
 (cd docker && docker build -t "${repo}/functest" .)
 docker push "${repo}/functest"
 
-for dir in docker/core docker/healthcheck docker/smoke; do
+for dir in ${dirs}; do
     (cd ${dir} && docker build -t "${repo}/functest-${dir##**/}" .)
     docker push "${repo}/functest-${dir##**/}"
 done
index 924da68..89cf86a 100644 (file)
@@ -84,15 +84,15 @@ RUN wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/uppe
     rm thirdparty-requirements.txt upper-constraints.txt
 
 # OPNFV repositories
-RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/copper ${REPOS_DIR}/copper
-RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/domino ${REPOS_DIR}/domino
+RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/copper /src/copper
+RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/domino /src/domino
 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/doctor ${REPOS_DIR}/doctor
 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/promise ${REPOS_DIR}/promise
 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/netready ${REPOS_DIR}/netready
-RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/fds ${REPOS_DIR}/fds
+RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/fds /src/fds
 
 # other repositories
-RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git ${REPOS_DIR}/odl_test
+RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test
 RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_VNFS_DIR}/vims-test
 RUN git clone --depth 1 -b $VROUTER_TAG https://github.com/oolorg/opnfv-functest-vrouter.git ${REPOS_VNFS_DIR}/vrouter
 RUN git clone --depth 1 https://github.com/wuwenbin2/OnosSystemTest.git ${REPOS_DIR}/onos
diff --git a/docker/components/Dockerfile b/docker/components/Dockerfile
new file mode 100644 (file)
index 0000000..8923e4c
--- /dev/null
@@ -0,0 +1,4 @@
+FROM opnfv/functest-core
+
+COPY testcases.yaml /usr/lib/python2.7/site-packages/functest/ci/testcases.yaml
+CMD ["bash","-c","prepare_env start && run_tests -t all"]
diff --git a/docker/components/hooks/post_checkout b/docker/components/hooks/post_checkout
new file mode 100644 (file)
index 0000000..20a6d4b
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-core"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile
+
+exit $?
diff --git a/docker/components/testcases.yaml b/docker/components/testcases.yaml
new file mode 100644 (file)
index 0000000..1604161
--- /dev/null
@@ -0,0 +1,56 @@
+tiers:
+    -
+        name: components
+        order: 3
+        ci_loop: 'weekly'
+        description : >-
+            Extensive testing of OpenStack API.
+        testcases:
+            -
+                case_name: tempest_full_parallel
+                project_name: functest
+                criteria: 80
+                blocking: false
+                description: >-
+                    The list of test cases is generated by
+                    Tempest automatically and depends on the parameters of
+                    the OpenStack deplopyment.
+                dependencies:
+                    installer: '^((?!netvirt).)*$'
+                    scenario: ''
+                run:
+                    module: 'functest.opnfv_tests.openstack.tempest.tempest'
+                    class: 'TempestFullParallel'
+
+            -
+                case_name: tempest_custom
+                project_name: functest
+                criteria: 100
+                blocking: false
+                description: >-
+                    The test case allows running a customized list of tempest
+                    test cases defined in a file under
+                    <dir_functest_repo>/functest/opnfv_tests/openstack/
+                      /tempest/custom_tests/test_list.txt
+                    The file is empty and can be customized with the desired tests.
+                dependencies:
+                    installer: 'unknown'
+                    scenario: 'unknown'
+                run:
+                    module: 'functest.opnfv_tests.openstack.tempest.tempest'
+                    class: 'TempestCustom'
+
+            -
+                case_name: rally_full
+                project_name: functest
+                criteria: 90
+                blocking: false
+                description: >-
+                    This test case runs the full suite of scenarios of the OpenStack
+                    Rally suite using several threads and iterations.
+                dependencies:
+                    installer: '^((?!netvirt).)*$'
+                    scenario: ''
+                run:
+                    module: 'functest.opnfv_tests.openstack.rally.rally'
+                    class: 'RallyFull'
\ No newline at end of file
diff --git a/docker/features/Dockerfile b/docker/features/Dockerfile
new file mode 100644 (file)
index 0000000..73f4d2c
--- /dev/null
@@ -0,0 +1,19 @@
+FROM opnfv/functest-core
+
+ARG BRANCH=master
+ARG OPENSTACK_TAG=stable/ocata
+
+COPY thirdparty-requirements.txt thirdparty-requirements.txt
+RUN apk --no-cache add --virtual .build-deps --update \
+        python-dev build-base linux-headers libffi-dev \
+        openssl-dev libjpeg-turbo-dev git && \
+    pip install --no-cache-dir --src /src \
+        -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG \
+        -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
+        -rthirdparty-requirements.txt && \
+    git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/domino /src/domino && \
+    git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/copper /src/copper && \
+    rm -r thirdparty-requirements.txt /src/domino/.git /src/copper/.git && \
+    apk del .build-deps
+COPY testcases.yaml /usr/lib/python2.7/site-packages/functest/ci/testcases.yaml
+CMD ["bash","-c","prepare_env start && run_tests -t all"]
diff --git a/docker/features/hooks/post_checkout b/docker/features/hooks/post_checkout
new file mode 100644 (file)
index 0000000..20a6d4b
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-core"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile
+
+exit $?
diff --git a/docker/features/testcases.yaml b/docker/features/testcases.yaml
new file mode 100644 (file)
index 0000000..48b1468
--- /dev/null
@@ -0,0 +1,110 @@
+tiers:
+    -
+        name: features
+        order: 2
+        ci_loop: '(daily)|(weekly)'
+        description : >-
+            Test suites from feature projects
+            integrated in functest
+        testcases:
+            -
+                case_name: bgpvpn
+                project_name: sdnvpn
+                criteria: 100
+                blocking: false
+                description: >-
+                    Test suite from SDNVPN project.
+                dependencies:
+                    installer: '(fuel)|(apex)|(netvirt)'
+                    scenario: 'bgpvpn'
+                run:
+                    module: 'functest.core.feature'
+                    class: 'BashFeature'
+                    args:
+                        cmd: 'run_sdnvpn_tests.py'
+
+            -
+                case_name: security_scan
+                enabled: false
+                project_name: securityscanning
+                criteria: 100
+                blocking: false
+                description: >-
+                    Simple Security Scan
+                dependencies:
+                    installer: 'apex'
+                    scenario: '^((?!fdio).)*$'
+                run:
+                    module: 'functest.core.feature'
+                    class: 'BashFeature'
+                    args:
+                        cmd: '. /home/opnfv/functest/conf/stackrc && security_scan --config /usr/local/etc/securityscanning/config.ini'
+
+            -
+                case_name: copper
+                enabled: false
+                project_name: copper
+                criteria: 100
+                blocking: false
+                description: >-
+                    Test suite for policy management based on OpenStack Congress
+                dependencies:
+                    installer: 'apex'
+                    scenario: '^((?!fdio).)*$'
+                run:
+                    module: 'functest.core.feature'
+                    class: 'BashFeature'
+                    args:
+                        cmd: 'cd /src/copper/tests && bash run.sh && cd -'
+
+            -
+                case_name: functest-odl-sfc
+                enabled: false
+                project_name: sfc
+                criteria: 100
+                blocking: false
+                description: >-
+                    Test suite for odl-sfc to test two chains and two SFs
+                dependencies:
+                    installer: '(apex)|(fuel)'
+                    scenario: 'odl_l2-sfc'
+                run:
+                    module: 'functest.core.feature'
+                    class: 'BashFeature'
+                    args:
+                        cmd: 'run_sfc_tests.py'
+
+            -
+                case_name: domino-multinode
+                enabled: false
+                project_name: domino
+                criteria: 100
+                blocking: false
+                description: >-
+                    Test suite from Domino project.
+                dependencies:
+                    installer: ''
+                    scenario: ''
+                run:
+                    module: 'functest.core.feature'
+                    class: 'BashFeature'
+                    args:
+                        cmd: 'cd /src/domino && ./tests/run_multinode.sh'
+
+            -
+                case_name: barometercollectd
+                enabled: false
+                project_name: barometer
+                criteria: 100
+                blocking: false
+                description: >-
+                    Test suite for the Barometer project. Separate tests verify the
+                    proper configuration and functionality of the following
+                    collectd plugins Ceilometer, Hugepages, Memory RAS (mcelog),
+                    and OVS Events
+                dependencies:
+                    installer: 'fuel'
+                    scenario: 'kvm_ovs_dpdk_bar'
+                run:
+                     module: 'baro_tests.barometer'
+                     class: 'BarometerCollectd'
diff --git a/docker/features/thirdparty-requirements.txt b/docker/features/thirdparty-requirements.txt
new file mode 100644 (file)
index 0000000..ee2e5e9
--- /dev/null
@@ -0,0 +1,4 @@
+baro_tests
+sdnvpn
+securityscanning
+sfc
diff --git a/docker/healthcheck/hooks/build b/docker/healthcheck/hooks/build
deleted file mode 100644 (file)
index e5d15b5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-from="${DOCKER_REPO%/*}/functest-core"
-sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile &&
-    docker build -t "${IMAGE_NAME}" .
-
-exit $?
diff --git a/docker/healthcheck/hooks/post_checkout b/docker/healthcheck/hooks/post_checkout
new file mode 100644 (file)
index 0000000..20a6d4b
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-core"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile
+
+exit $?
index 22ff2eb..223ed64 100644 (file)
@@ -2,6 +2,7 @@ FROM opnfv/functest-core
 
 ARG BRANCH=master
 ARG OPENSTACK_TAG=stable/ocata
+ARG ODL_TAG=release/beryllium-sr4
 
 COPY thirdparty-requirements.txt thirdparty-requirements.txt
 RUN apk --no-cache add --virtual .build-deps --update \
@@ -11,9 +12,12 @@ RUN apk --no-cache add --virtual .build-deps --update \
         -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG \
         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
         -rthirdparty-requirements.txt && \
+    git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test && \
+    git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/fds /src/fds && \
     ln -s /src/tempest /src/refstack-client/.tempest && \
     virtualenv --system-site-packages /src/tempest/.venv && \
-    rm -r thirdparty-requirements.txt /src/refstack-client/.git && \
+    rm -r thirdparty-requirements.txt /src/refstack-client/.git /src/odl_test/.git \
+        /src/fds/.git && \
     apk del .build-deps
 COPY testcases.yaml /usr/lib/python2.7/site-packages/functest/ci/testcases.yaml
 CMD ["bash","-c","prepare_env start && run_tests -t all"]
diff --git a/docker/smoke/hooks/build b/docker/smoke/hooks/build
deleted file mode 100644 (file)
index e5d15b5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-from="${DOCKER_REPO%/*}/functest-core"
-sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile &&
-    docker build -t "${IMAGE_NAME}" .
-
-exit $?
diff --git a/docker/smoke/hooks/post_checkout b/docker/smoke/hooks/post_checkout
new file mode 100644 (file)
index 0000000..20a6d4b
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-core"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile
+
+exit $?
index 69ea038..772196a 100644 (file)
@@ -84,6 +84,67 @@ tiers:
                     module: 'functest.opnfv_tests.openstack.refstack_client.refstack_client'
                     class: 'RefstackClient'
 
+            -
+                case_name: odl
+                project_name: functest
+                criteria: 100
+                blocking: true
+                description: >-
+                    Test Suite for the OpenDaylight SDN Controller. It
+                    integrates some test suites from upstream using
+                    Robot as the test framework.
+                dependencies:
+                    installer: ''
+                    scenario: 'odl'
+                run:
+                    module: 'functest.opnfv_tests.sdn.odl.odl'
+                    class: 'ODLTests'
+                    args:
+                        suites:
+                            -  /src/odl_test/csit/suites/integration/basic
+                            -  /src/odl_test/csit/suites/openstack/neutron
+
+            -
+                case_name: odl_netvirt
+                project_name: functest
+                criteria: 100
+                blocking: false
+                description: >-
+                    Test Suite for the OpenDaylight SDN Controller when
+                    the NetVirt features are installed. It integrates
+                    some test suites from upstream using Robot as the
+                    test framework.
+                dependencies:
+                    installer: 'apex'
+                    scenario: 'os-odl_l3-nofeature'
+                run:
+                    module: 'functest.opnfv_tests.sdn.odl.odl'
+                    class: 'ODLTests'
+                    args:
+                        suites:
+                            -  /src/odl_test/csit/suites/integration/basic
+                            -  /src/odl_test/csit/suites/openstack/neutron
+                            -  /src/odl_test/csit/suites/openstack/connectivity
+
+            -
+                case_name: fds
+                project_name: functest
+                criteria: 100
+                blocking: false
+                description: >-
+                    Test Suite for the OpenDaylight SDN Controller when GBP features are
+                    installed. It integrates some test suites from upstream using
+                    Robot as the test framework.
+                dependencies:
+                    installer: 'apex'
+                    scenario: 'odl.*-fdio'
+                run:
+                    module: 'functest.opnfv_tests.sdn.odl.odl'
+                    class: 'ODLTests'
+                    args:
+                        suites:
+                            -  /src/fds/testing/robot
+
             -
                 case_name: snaps_smoke
                 project_name: functest
index be1980f..b298601 100644 (file)
@@ -1,8 +1 @@
-baro_tests
-sdnvpn
-opera
-securityscanning
-sfc
-tosca-parser>=0.7.0 # Apache-2.0
-heat-translator>=0.4.0 # Apache-2.0
 refstack-client
index e26b313..31ce4b9 100644 (file)
@@ -10,9 +10,8 @@ general:
         repo_netready:      /home/opnfv/repos/netready
         repo_barometer:     /home/opnfv/repos/barometer
         repo_doctor:        /home/opnfv/repos/doctor
-        repo_copper:        /home/opnfv/repos/copper
-        repo_domino:        /home/opnfv/repos/domino
-        repo_fds:           /home/opnfv/repos/fds
+        repo_odl_test:      /src/odl_test
+        repo_fds:           /src/fds
         repo_securityscan:  /home/opnfv/repos/securityscanning
         repo_vrouter:       /home/opnfv/repos/vnfs/vrouter
         functest:           /home/opnfv/functest
index 0f8dff0..99c0cc2 100644 (file)
@@ -162,8 +162,8 @@ tiers:
                     class: 'ODLTests'
                     args:
                         suites:
-                            -  /home/opnfv/repos/odl_test/csit/suites/integration/basic
-                            -  /home/opnfv/repos/odl_test/csit/suites/openstack/neutron
+                            -  /src/odl_test/csit/suites/integration/basic
+                            -  /src/odl_test/csit/suites/openstack/neutron
 
             -
                 case_name: odl_netvirt
@@ -183,9 +183,9 @@ tiers:
                     class: 'ODLTests'
                     args:
                         suites:
-                            -  /home/opnfv/repos/odl_test/csit/suites/integration/basic
-                            -  /home/opnfv/repos/odl_test/csit/suites/openstack/neutron
-                            -  /home/opnfv/repos/odl_test/csit/suites/openstack/connectivity
+                            -  /src/odl_test/csit/suites/integration/basic
+                            -  /src/odl_test/csit/suites/openstack/neutron
+                            -  /src/odl_test/csit/suites/openstack/connectivity
 
             -
                 case_name: fds
@@ -204,7 +204,7 @@ tiers:
                     class: 'ODLTests'
                     args:
                         suites:
-                            -  /home/opnfv/repos/fds/testing/robot
+                            -  /src/fds/testing/robot
 
             -
                 case_name: onos
@@ -297,7 +297,7 @@ tiers:
                     module: 'functest.core.feature'
                     class: 'BashFeature'
                     args:
-                        cmd: 'cd /usr/local/lib/python2.7/dist-packages/sdnvpn/test/functest && python ./run_tests.py'
+                        cmd: 'run_sdnvpn_tests.py'
 
             -
                 case_name: security_scan
@@ -331,7 +331,7 @@ tiers:
                     module: 'functest.core.feature'
                     class: 'BashFeature'
                     args:
-                        cmd: 'cd /home/opnfv/repos/copper/tests && bash run.sh && cd -'
+                        cmd: 'cd /src/copper/tests && bash run.sh && cd -'
 
             -
                 case_name: multisite
@@ -363,7 +363,7 @@ tiers:
                     module: 'functest.core.feature'
                     class: 'BashFeature'
                     args:
-                        cmd: 'cd /usr/local/lib/python2.7/dist-packages/sfc/tests/functest && python ./run_tests.py'
+                        cmd: 'run_sfc_tests.py'
 
             -
                 case_name: onos_sfc
@@ -411,7 +411,7 @@ tiers:
                     module: 'functest.core.feature'
                     class: 'BashFeature'
                     args:
-                        cmd: 'cd /home/opnfv/repos/domino && ./tests/run_multinode.sh'
+                        cmd: 'cd /src/domino && ./tests/run_multinode.sh'
 
             -
                 case_name: gluon_vping
index d494db5..2313ec0 100644 (file)
@@ -15,6 +15,8 @@ import re
 import shutil
 import subprocess
 
+import yaml
+
 from functest.utils.constants import CONST
 import functest.utils.functest_utils as ft_utils
 import functest.utils.openstack_utils as os_utils
@@ -38,6 +40,8 @@ TEMPEST_RAW_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_raw_list.txt')
 TEMPEST_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_list.txt')
 REFSTACK_RESULTS_DIR = os.path.join(CONST.__getattribute__('dir_results'),
                                     'refstack')
+TEMPEST_CONF_YAML = pkg_resources.resource_filename(
+    'functest', 'opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml')
 
 CI_INSTALLER_TYPE = CONST.__getattribute__('INSTALLER_TYPE')
 CI_INSTALLER_IP = CONST.__getattribute__('INSTALLER_IP')
@@ -328,6 +332,19 @@ def configure_tempest_update_params(tempest_conf_file,
             config.set(service, 'endpoint_type',
                        CONST.__getattribute__('OS_ENDPOINT_TYPE'))
 
+    logger.debug('Add/Update required params defined in tempest_conf.yaml '
+                 'into tempest.conf file')
+    with open(TEMPEST_CONF_YAML) as f:
+        conf_yaml = yaml.safe_load(f)
+    if not conf_yaml:
+        sections = config.sections()
+        for section in conf_yaml:
+            if section not in sections:
+                config.add_section(section)
+            sub_conf = conf_yaml.get(section)
+            for key, value in sub_conf.items():
+                config.set(section, key, value)
+
     with open(tempest_conf_file, 'wb') as config_file:
         config.write(config_file)
 
diff --git a/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml b/functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml
new file mode 100644 (file)
index 0000000..b47a973
--- /dev/null
@@ -0,0 +1,13 @@
+# This is an empty configuration file to be filled up with the desired options
+# to generate a custom tempest.conf
+# Examples:
+# network-feature-enabled:
+#     port_security: True
+
+# volume-feature-enabled:
+#     api_v1: False
+
+# validation:
+#     image_ssh_user: root
+#     ssh_timeout: 300
+
index 693b868..15f5e84 100644 (file)
@@ -1,13 +1,10 @@
 #!/bin/sh
 
-while true; do
- ping -c 1 $1 2>&1 >/dev/null
- RES=$?
- if [ "Z$RES" = "Z0" ] ; then
-  echo 'vPing OK'
- break
- else
-  echo 'vPing KO'
- fi
- sleep 1
-done
\ No newline at end of file
+
+ping -c 1 $1 2>&1 >/dev/null
+RES=$?
+if [ "Z$RES" = "Z0" ] ; then
+    echo 'vPing OK'
+else
+    echo 'vPing KO'
+fi
index 5724012..841da83 100644 (file)
@@ -66,8 +66,7 @@ class ODLResultVisitor(robot.api.ResultVisitor):
 class ODLTests(testcase.TestCase):
     """ODL test runner."""
 
-    odl_test_repo = os.path.join(
-        constants.CONST.__getattribute__('dir_repos'), 'odl_test')
+    odl_test_repo = constants.CONST.__getattribute__('dir_repo_odl_test')
     neutron_suite_dir = os.path.join(odl_test_repo,
                                      "csit/suites/openstack/neutron")
     basic_suite_dir = os.path.join(odl_test_repo,
index dfaa5cc..a6d192e 100644 (file)
@@ -64,7 +64,7 @@ class Connection(Foundation):
         """
         os.getenv only returns current user value
         GetEnvValue returns a environment value of
-            current handle
+        current handle
         eg: GetEnvValue(handle,'HOME')
         """
         envhandle = handle
index cb75b5c..875a2dc 100644 (file)
@@ -1,11 +1,11 @@
 """
 Description:
-    This file is used to setup the running environment
-    Include Download code,setup environment variable
-            Set onos running config
-            Set user name/password
-            Onos-push-keys and so on
-    lanqinglong@huawei.com
+This file is used to setup the running environment
+Include Download code,setup environment variable
+Set onos running config
+Set user name/password
+Onos-push-keys and so on
+lanqinglong@huawei.com
 
 #
 # All rights reserved. This program and the accompanying materials
@@ -17,7 +17,7 @@ Description:
 
 import logging
 import pexpect
-import pxssh
+from pexpect import pxssh
 import re
 import os
 import sys
@@ -196,10 +196,10 @@ class Environment(Connection):
 
     def ChangeTestCasePara(self, testcase, user, password):
         """
-        When running test script, there's something need
-        to change in every test folder's *.param & *.topo files
-        user: onos&compute node user
-        password: onos&compute node password
+        When running test script, there\'s something need
+        to change in every test folder\'s \*.param & \*.topo files
+        user: onos\&compute node user
+        password: onos\&compute node password
         """
         self.logger.info("Now Changing " + testcase + " name&password")
         if self.masterusername == 'root':
index 988981e..553a5df 100644 (file)
@@ -22,8 +22,8 @@ class FeatureTestingBase(unittest.TestCase):
 
     _case_name = "foo"
     _project_name = "bar"
-    _repo = "dir_repo_copper"
-    _cmd = "cd /home/opnfv/repos/foo/tests && bash run.sh && cd -"
+    _repo = "dir_repo_bar"
+    _cmd = "cd /home/opnfv/repos/bar/tests && bash run.sh && cd -"
     _output_file = '/home/opnfv/functest/results/foo.log'
     feature = None
 
index 3790496..79ef991 100644 (file)
@@ -261,8 +261,11 @@ class OSTempestConfUtilsTesting(unittest.TestCase):
                        'write') as mwrite, \
             mock.patch('__builtin__.open', mock.mock_open()), \
             mock.patch('functest.opnfv_tests.openstack.tempest.'
-                       'conf_utils.backup_tempest_config'):
+                       'conf_utils.backup_tempest_config'), \
+            mock.patch('functest.utils.functest_utils.yaml.safe_load') \
+                as mock_yaml:
             CONST.__setattr__('OS_ENDPOINT_TYPE', None)
+            mock_yaml.return_value = mock.Mock()
             conf_utils.\
                 configure_tempest_update_params('test_conf_file',
                                                 IMAGE_ID=image_id,
index 537c514..f0483c6 100644 (file)
@@ -13,6 +13,8 @@ import mock
 from functest.core import vnf
 from functest.opnfv_tests.vnf.ims import cloudify_ims
 
+from snaps.openstack.os_credentials import OSCreds
+
 
 class CloudifyImsTesting(unittest.TestCase):
 
@@ -79,8 +81,11 @@ class CloudifyImsTesting(unittest.TestCase):
     @mock.patch('snaps.openstack.create_image.OpenStackImage.create')
     def test_prepare_bad_auth_url(self, *args):
         with self.assertRaises(Exception):
-            self.ims_vnf.prepare()
-        args[0].assert_not_called()
+            self.ims_vnf.image_creator(
+                OSCreds(username='user', password='pass', auth_url='url',
+                        project_name='project', identity_api_version=3),
+                mock.Mock())
+            args[0].assert_not_called()
 
     def test_prepare_missing_param(self):
         with self.assertRaises(vnf.VnfPreparationException):
index 2199973..5a1efc7 100644 (file)
@@ -154,7 +154,7 @@ class OrchestraImsTesting(unittest.TestCase):
         """Testing prepare function with bad auth url"""
         with self.assertRaises(Exception):
             self.ims_vnf.prepare()
-        args[0].assert_not_called()
+            args[0].assert_not_called()
 
     def test_prepare_missing_param(self):
         """Testing prepare function with missing param"""
diff --git a/functest/tests/unit/vnf/rnc/__init__.py b/functest/tests/unit/vnf/rnc/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000