summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.sh3
-rw-r--r--docker/Dockerfile2
-rw-r--r--docker/core/Dockerfile2
-rw-r--r--docker/features/Dockerfile4
-rw-r--r--docker/parser/Dockerfile17
-rw-r--r--docker/parser/hooks/post_checkout6
-rw-r--r--docker/restapi/Dockerfile38
-rw-r--r--docker/restapi/hooks/post_checkout6
-rw-r--r--docker/restapi/thirdparty-requirements.txt6
-rw-r--r--docker/smoke/Dockerfile8
-rw-r--r--docker/smoke/thirdparty-requirements.txt1
-rw-r--r--docker/vnf/Dockerfile9
-rw-r--r--docker/vnf/testcases.yaml2
-rw-r--r--functest/api/resources/v1/tasks.py6
-rw-r--r--functest/api/resources/v1/tiers.py14
-rw-r--r--functest/api/server.py1
-rw-r--r--functest/ci/check_deployment.py1
-rw-r--r--functest/ci/download_images.sh1
-rw-r--r--functest/ci/prepare_env.py9
-rw-r--r--functest/ci/run_tests.py1
-rw-r--r--functest/ci/testcases.yaml2
-rw-r--r--functest/cli/cli_base.py1
-rw-r--r--functest/opnfv_tests/openstack/rally/rally.py21
-rw-r--r--functest/opnfv_tests/openstack/rally/scenario/full/opnfv-cinder.yaml21
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py2
-rw-r--r--functest/opnfv_tests/vnf/ims/orchestra.yaml4
-rw-r--r--functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py6
-rw-r--r--functest/opnfv_tests/vnf/ims/orchestra_openims.py6
-rw-r--r--functest/tests/unit/openstack/rally/test_rally.py41
-rw-r--r--functest/tests/unit/utils/test_openstack_utils.py64
-rw-r--r--functest/utils/openstack_utils.py33
31 files changed, 115 insertions, 223 deletions
diff --git a/build.sh b/build.sh
index 36f1d5526..4a6d68a61 100644
--- a/build.sh
+++ b/build.sh
@@ -10,7 +10,8 @@ docker/smoke \
docker/features \
docker/components \
docker/vnf \
-docker/parser"
+docker/parser \
+docker/restapi"
(cd docker && docker build -t "${repo}/functest" .)
docker push "${repo}/functest"
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 6e5161c34..218d74417 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -79,7 +79,7 @@ RUN wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/uppe
> upper-constraints.txt && \
pip install --src /src -cupper-constraints.txt \
-chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
- -e git+https://github.com/openstack/requirements@stable/ocata#egg=openstack_requirements && \
+ -e git+https://github.com/openstack/requirements@$OPENSTACK_TAG#egg=openstack_requirements && \
git clone --depth 1 https://github.com/openstack/rally.git -b $RALLY_TAG /src/rally && \
update-requirements -s --source /src/openstack-requirements /src/rally && \
git clone --depth 1 https://github.com/openstack/refstack-client.git /src/refstack-client && \
diff --git a/docker/core/Dockerfile b/docker/core/Dockerfile
index c5766da30..04e32598e 100644
--- a/docker/core/Dockerfile
+++ b/docker/core/Dockerfile
@@ -15,7 +15,7 @@ RUN apk --no-cache add --update \
> upper-constraints.txt && \
pip install --no-cache-dir --src /src -cupper-constraints.txt \
-chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
- -e git+https://github.com/openstack/requirements@stable/ocata#egg=openstack_requirements && \
+ -e git+https://github.com/openstack/requirements@$OPENSTACK_TAG#egg=openstack_requirements && \
git clone --depth 1 https://github.com/openstack/rally.git -b $RALLY_TAG /src/rally && \
update-requirements -s --source /src/openstack-requirements /src/rally/ && \
pip install --no-cache-dir --src /src -cupper-constraints.txt \
diff --git a/docker/features/Dockerfile b/docker/features/Dockerfile
index c3b1b041d..8b0a2f60c 100644
--- a/docker/features/Dockerfile
+++ b/docker/features/Dockerfile
@@ -4,10 +4,10 @@ ARG BRANCH=master
ARG OPENSTACK_TAG=stable/ocata
COPY thirdparty-requirements.txt thirdparty-requirements.txt
-RUN apk --no-cache add --update nodejs nodejs-npm python3 && \
+RUN apk --no-cache add --update nodejs nodejs-npm python3 sshpass && \
apk --no-cache add --virtual .build-deps --update \
python-dev build-base linux-headers libffi-dev \
- openssl-dev libjpeg-turbo-dev git && \
+ openssl-dev libjpeg-turbo-dev && \
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 \
diff --git a/docker/parser/Dockerfile b/docker/parser/Dockerfile
index e0dc0d5cd..a28a1f5b0 100644
--- a/docker/parser/Dockerfile
+++ b/docker/parser/Dockerfile
@@ -11,18 +11,17 @@ RUN apk --no-cache add --update \
python-dev build-base linux-headers libffi-dev \
openssl-dev libjpeg-turbo-dev && \
wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
- sed /^heat-translator=/d | sed /^tosca-parser=/d \
+ sed /^heat-translator=/d | sed /^tosca-parser=/d | \
+ sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ \
> upper-constraints.txt && \
- pip install --src /src -cupper-constraints.txt \
+ pip install --no-cache-dir --src /src -cupper-constraints.txt \
-chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
- -e git+https://github.com/openstack/requirements@stable/ocata#egg=openstack_requirements && \
+ -e git+https://github.com/openstack/requirements@$OPENSTACK_TAG#egg=openstack_requirements && \
git clone --depth 1 https://github.com/openstack/rally.git -b $RALLY_TAG /src/rally && \
- update-requirements -s --source /src/openstack-requirements /src/rally && \
- pip install --src /src -cupper-constraints.txt \
- -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
- /src/rally && \
- pip install --no-cache-dir --src /src \
- -cupper-constraints.txt \
+ update-requirements -s --source /src/openstack-requirements /src/rally/ && \
+ pip install --no-cache-dir --src /src -cupper-constraints.txt \
+ -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH /src/rally && \
+ pip install --no-cache-dir --src /src -cupper-constraints.txt \
-chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
git+https://gerrit.opnfv.org/gerrit/functest@$BRANCH#egg=functest \
git+https://gerrit.opnfv.org/gerrit/parser#egg=heat-translator\&subdirectory=tosca2heat/heat-translator \
diff --git a/docker/parser/hooks/post_checkout b/docker/parser/hooks/post_checkout
new file mode 100644
index 000000000..20a6d4b95
--- /dev/null
+++ b/docker/parser/hooks/post_checkout
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-core"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile
+
+exit $?
diff --git a/docker/restapi/Dockerfile b/docker/restapi/Dockerfile
new file mode 100644
index 000000000..2c7560286
--- /dev/null
+++ b/docker/restapi/Dockerfile
@@ -0,0 +1,38 @@
+FROM opnfv/functest-core
+
+ARG BRANCH=master
+ARG OPENSTACK_TAG=stable/ocata
+ARG ODL_TAG=35e415b6873b39d72775c88a337e92dac26012e2
+ARG FDS_TAG=master
+ARG REFSTACK_TAG=4e187b07672dd1c41cb7c94658f1c91edebf53a2
+ARG VIMS_TAG=stable
+
+COPY thirdparty-requirements.txt thirdparty-requirements.txt
+RUN apk --no-cache add --update nodejs nodejs-npm python3 sshpass \
+ ruby ruby-bundler ruby-irb ruby-rdoc dnsmasq \
+ procps libxslt libxml2 zlib libffi && \
+ apk --no-cache add --virtual .build-deps --update \
+ python-dev build-base linux-headers libffi-dev \
+ openssl-dev libjpeg-turbo-dev \
+ ruby-dev g++ make libxslt-dev libxml2-dev zlib-dev libffi-dev && \
+ git clone --depth 1 https://github.com/openstack/refstack-client.git /src/refstack-client && \
+ (cd src/refstack-client && git checkout -b $REFSTACK_TAG) && \
+ update-requirements -s --source /src/openstack-requirements /src/refstack-client/ && \
+ 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 \
+ -e/src/refstack-client -rthirdparty-requirements.txt && \
+ git clone --depth 1 https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test && \
+ (cd src/odl_test && git checkout -b $ODL_TAG) && \
+ git clone --depth 1 -b $FDS_TAG https://gerrit.opnfv.org/gerrit/fds /src/fds && \
+ git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test /src/vims-test && \
+ ln -s /src/tempest /src/refstack-client/.tempest && \
+ virtualenv --system-site-packages /src/tempest/.venv && \
+ (cd /src/promise/source && npm install) && \
+ (cd /src/vims-test && bundle config build.nokogiri --use-system-libraries && bundle install --system) && \
+ npm -g install npm@latest && \
+ rm -r thirdparty-requirements.txt /src/refstack-client/.git /src/odl_test/.git \
+ /src/fds/.git /src/vims-test/.git && \
+ apk del .build-deps
+EXPOSE 5000
+CMD ["functest_restapi"]
diff --git a/docker/restapi/hooks/post_checkout b/docker/restapi/hooks/post_checkout
new file mode 100644
index 000000000..20a6d4b95
--- /dev/null
+++ b/docker/restapi/hooks/post_checkout
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-core"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile
+
+exit $?
diff --git a/docker/restapi/thirdparty-requirements.txt b/docker/restapi/thirdparty-requirements.txt
new file mode 100644
index 000000000..4a0b6ff88
--- /dev/null
+++ b/docker/restapi/thirdparty-requirements.txt
@@ -0,0 +1,6 @@
+baro_tests
+sdnvpn
+securityscanning
+sfc
+promise
+domino
diff --git a/docker/smoke/Dockerfile b/docker/smoke/Dockerfile
index abf1714b4..fe2f91917 100644
--- a/docker/smoke/Dockerfile
+++ b/docker/smoke/Dockerfile
@@ -6,7 +6,6 @@ ARG ODL_TAG=35e415b6873b39d72775c88a337e92dac26012e2
ARG FDS_TAG=master
ARG REFSTACK_TAG=4e187b07672dd1c41cb7c94658f1c91edebf53a2
-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 && \
@@ -17,17 +16,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 \
-e/src/refstack-client && \
- 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 https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test && \
(cd src/odl_test && git checkout -b $ODL_TAG) && \
git clone --depth 1 -b $FDS_TAG 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 /src/odl_test/.git \
- /src/fds/.git && \
+ rm -r /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/thirdparty-requirements.txt b/docker/smoke/thirdparty-requirements.txt
deleted file mode 100644
index b298601b7..000000000
--- a/docker/smoke/thirdparty-requirements.txt
+++ /dev/null
@@ -1 +0,0 @@
-refstack-client
diff --git a/docker/vnf/Dockerfile b/docker/vnf/Dockerfile
index d4f18c476..36e80d7e2 100644
--- a/docker/vnf/Dockerfile
+++ b/docker/vnf/Dockerfile
@@ -3,10 +3,13 @@ FROM opnfv/functest-core
ARG VIMS_TAG=stable
RUN apk --no-cache add --update \
- ruby ruby-dev ruby-bundler ruby-irb ruby-rdoc dnsmasq \
- procps git g++ make libxslt-dev libxml2-dev zlib-dev libffi-dev && \
+ ruby ruby-bundler ruby-irb ruby-rdoc dnsmasq \
+ procps libxslt libxml2 zlib libffi && \
+ apk --no-cache add --virtual .build-deps --update \
+ ruby-dev g++ make libxslt-dev libxml2-dev zlib-dev libffi-dev && \
git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test /src/vims-test && \
rm -r /src/vims-test/.git && \
- cd /src/vims-test && bundle config build.nokogiri --use-system-libraries && bundle install --system
+ cd /src/vims-test && bundle config build.nokogiri --use-system-libraries && bundle install --system && \
+ 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/vnf/testcases.yaml b/docker/vnf/testcases.yaml
index dea4a1eaf..c0eba8225 100644
--- a/docker/vnf/testcases.yaml
+++ b/docker/vnf/testcases.yaml
@@ -23,7 +23,6 @@ tiers:
-
case_name: orchestra_openims
project_name: functest
- enabled: false
criteria: 100
blocking: false
description: >-
@@ -38,7 +37,6 @@ tiers:
-
case_name: orchestra_clearwaterims
project_name: functest
- enabled: false
criteria: 100
blocking: false
description: >-
diff --git a/functest/api/resources/v1/tasks.py b/functest/api/resources/v1/tasks.py
index f099918f4..492141249 100644
--- a/functest/api/resources/v1/tasks.py
+++ b/functest/api/resources/v1/tasks.py
@@ -80,11 +80,15 @@ class V1TaskLog(ApiResource):
return api_utils.result_handler(status=1, data='No such task id')
task_log_dir = CONST.__getattribute__('dir_results')
+ # pylint: disable=maybe-no-member
+ index = int(self._get_args().get('index', 0))
try:
with open(os.path.join(task_log_dir,
'{}.log'.format(task_id)), 'r') as log_file:
+ log_file.seek(index)
data = log_file.readlines()
+ index = log_file.tell()
except OSError as err:
if err.errno == errno.ENOENT:
return api_utils.result_handler(
@@ -93,7 +97,7 @@ class V1TaskLog(ApiResource):
return api_utils.result_handler(
status=1, data='Error with log file')
- return_data = {'data': data}
+ return_data = {'data': data, 'index': index}
switcher = {'IN PROGRESS': 0, 'FAIL': 1, 'FINISHED': 2}
diff --git a/functest/api/resources/v1/tiers.py b/functest/api/resources/v1/tiers.py
index 4f4849e98..b58ab205e 100644
--- a/functest/api/resources/v1/tiers.py
+++ b/functest/api/resources/v1/tiers.py
@@ -31,7 +31,7 @@ class V1Tiers(ApiResource):
data = [i.strip() for i in data if i != '']
data_dict = dict()
for i in range(len(data) / 2):
- one_data = {data[i * 2]: data[i * 2 + 1]}
+ one_data = {data[i * 2].lstrip('- ').rstrip(':'): data[i * 2 + 1]}
if i == 0:
data_dict = one_data
else:
@@ -45,14 +45,15 @@ class V1Tier(ApiResource):
def get(self, tier_name): # pylint: disable=no-self-use
""" GET the info of one tier """
- testcases = Tier().gettests(tier_name)
- if not testcases:
+ tier_info = Tier().show(tier_name)
+ if not tier_info:
return api_utils.result_handler(
status=1,
data="The tier with name '%s' does not exist." % tier_name)
- tier_info = Tier().show(tier_name)
tier_info.__dict__.pop('name')
tier_info.__dict__.pop('tests_array')
+ tier_info.__dict__.pop('skipped_tests_array')
+ testcases = Tier().gettests(tier_name)
result = {'tier': tier_name, 'testcases': testcases}
result.update(tier_info.__dict__)
return jsonify(result)
@@ -63,10 +64,11 @@ class V1TestcasesinTier(ApiResource):
def get(self, tier_name): # pylint: disable=no-self-use
""" GET all testcases within given tier """
- testcases = Tier().gettests(tier_name)
- if not testcases:
+ tier_info = Tier().show(tier_name)
+ if not tier_info:
return api_utils.result_handler(
status=1,
data="The tier with name '%s' does not exist." % tier_name)
+ testcases = Tier().gettests(tier_name)
result = {'tier': tier_name, 'testcases': testcases}
return jsonify(result)
diff --git a/functest/api/server.py b/functest/api/server.py
index 1d47b0dcb..c6eb0b3ba 100644
--- a/functest/api/server.py
+++ b/functest/api/server.py
@@ -97,6 +97,7 @@ def main():
"""Entry point"""
logging.config.fileConfig(pkg_resources.resource_filename(
'functest', 'ci/logging.ini'))
+ logging.captureWarnings(True)
LOGGER.info('Starting Functest server')
api_add_resource()
init_db()
diff --git a/functest/ci/check_deployment.py b/functest/ci/check_deployment.py
index fe20dc8f1..13bb4c8bc 100644
--- a/functest/ci/check_deployment.py
+++ b/functest/ci/check_deployment.py
@@ -159,5 +159,6 @@ def main():
"""Entry point"""
logging.config.fileConfig(pkg_resources.resource_filename(
'functest', 'ci/logging.ini'))
+ logging.captureWarnings(True)
deployment = CheckDeployment()
return deployment.check_all()
diff --git a/functest/ci/download_images.sh b/functest/ci/download_images.sh
index 236b763c6..09a32848b 100644
--- a/functest/ci/download_images.sh
+++ b/functest/ci/download_images.sh
@@ -18,6 +18,7 @@ http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-kernel
https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-arm64-uefi1.img
http://cloud.centos.org/altarch/7/images/aarch64/CentOS-7-aarch64-GenericCloud.qcow2.xz
https://sourceforge.net/projects/ool-opnfv/files/vyos-1.1.7.img
+http://marketplace.openbaton.org:8080/api/v1/images/52e2ccc0-1dce-4663-894d-28aab49323aa/img
EOF
xz --decompress --force --keep ${1:-/home/opnfv/functest/images}/CentOS-7-aarch64-GenericCloud.qcow2.xz
diff --git a/functest/ci/prepare_env.py b/functest/ci/prepare_env.py
index a354dbe83..36d042968 100644
--- a/functest/ci/prepare_env.py
+++ b/functest/ci/prepare_env.py
@@ -37,14 +37,14 @@ pod_arch = os.getenv("POD_ARCH", None)
arch_filter = ['aarch64']
CONFIG_FUNCTEST_PATH = pkg_resources.resource_filename(
- 'functest', 'ci/config_functest.yaml')
+ 'functest', 'ci/config_functest.yaml')
CONFIG_PATCH_PATH = pkg_resources.resource_filename(
- 'functest', 'ci/config_patch.yaml')
+ 'functest', 'ci/config_patch.yaml')
CONFIG_AARCH64_PATCH_PATH = pkg_resources.resource_filename(
- 'functest', 'ci/config_aarch64_patch.yaml')
+ 'functest', 'ci/config_aarch64_patch.yaml')
RALLY_CONF_PATH = "/etc/rally/rally.conf"
RALLY_AARCH64_PATCH_PATH = pkg_resources.resource_filename(
- 'functest', 'ci/rally_aarch64_patch.conf')
+ 'functest', 'ci/rally_aarch64_patch.conf')
class PrepareEnvParser(object):
@@ -358,6 +358,7 @@ def prepare_env(**kwargs):
def main():
logging.config.fileConfig(pkg_resources.resource_filename(
'functest', 'ci/logging.ini'))
+ logging.captureWarnings(True)
parser = PrepareEnvParser()
args = parser.parse_args(sys.argv[1:])
return prepare_env(**args)
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py
index feafa89e6..a129ea737 100644
--- a/functest/ci/run_tests.py
+++ b/functest/ci/run_tests.py
@@ -264,6 +264,7 @@ class Runner(object):
def main():
logging.config.fileConfig(pkg_resources.resource_filename(
'functest', 'ci/logging.ini'))
+ logging.captureWarnings(True)
parser = RunTestsParser()
args = parser.parse_args(sys.argv[1:])
runner = Runner()
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml
index f9bf164b2..7d7c3eb12 100644
--- a/functest/ci/testcases.yaml
+++ b/functest/ci/testcases.yaml
@@ -432,7 +432,6 @@ tiers:
-
case_name: orchestra_openims
project_name: functest
- enabled: false
criteria: 100
blocking: false
description: >-
@@ -447,7 +446,6 @@ tiers:
-
case_name: orchestra_clearwaterims
project_name: functest
- enabled: false
criteria: 100
blocking: false
description: >-
diff --git a/functest/cli/cli_base.py b/functest/cli/cli_base.py
index 54b3e72b2..507179b17 100644
--- a/functest/cli/cli_base.py
+++ b/functest/cli/cli_base.py
@@ -25,6 +25,7 @@ CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
def cli():
logging.config.fileConfig(pkg_resources.resource_filename(
'functest', 'ci/logging.ini'))
+ logging.captureWarnings(True)
_env = CliEnv()
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py
index 64382ded8..8c482545d 100644
--- a/functest/opnfv_tests/openstack/rally/rally.py
+++ b/functest/opnfv_tests/openstack/rally/rally.py
@@ -66,7 +66,6 @@ class RallyBase(testcase.OSGCTestCase):
BLACKLIST_FILE = os.path.join(RALLY_DIR, "blacklist.txt")
TEMP_DIR = os.path.join(RALLY_DIR, "var")
- CINDER_VOLUME_TYPE_NAME = "volume_test"
RALLY_PRIVATE_NET_NAME = CONST.__getattribute__('rally_network_name')
RALLY_PRIVATE_SUBNET_NAME = CONST.__getattribute__('rally_subnet_name')
RALLY_PRIVATE_SUBNET_CIDR = CONST.__getattribute__('rally_subnet_cidr')
@@ -80,9 +79,7 @@ class RallyBase(testcase.OSGCTestCase):
self.scenario_dir = ''
self.nova_client = os_utils.get_nova_client()
self.neutron_client = os_utils.get_neutron_client()
- self.cinder_client = os_utils.get_cinder_client()
self.network_dict = {}
- self.volume_type = None
self.smoke = None
self.test_name = None
self.image_exists = None
@@ -448,20 +445,6 @@ class RallyBase(testcase.OSGCTestCase):
if self.test_name not in self.TESTS:
raise Exception("Test name '%s' is invalid" % self.test_name)
- volume_types = os_utils.list_volume_types(self.cinder_client,
- private=False)
- if volume_types:
- LOGGER.debug("Using existing volume type(s)...")
- else:
- LOGGER.debug('Creating volume type...')
- self.volume_type = os_utils.create_volume_type(
- self.cinder_client, self.CINDER_VOLUME_TYPE_NAME)
- if self.volume_type is None:
- raise Exception("Failed to create volume type '%s'" %
- self.CINDER_VOLUME_TYPE_NAME)
- LOGGER.debug("Volume type '%s' is created succesfully.",
- self.CINDER_VOLUME_TYPE_NAME)
-
LOGGER.debug('Getting or creating image...')
self.image_exists, self.image_id = os_utils.get_or_create_image(
self.GLANCE_IMAGE_NAME,
@@ -562,10 +545,6 @@ class RallyBase(testcase.OSGCTestCase):
self.case_name, success_rate)
def _clean_up(self):
- if self.volume_type:
- LOGGER.debug("Deleting volume type '%s'...", self.volume_type)
- os_utils.delete_volume_type(self.cinder_client, self.volume_type)
-
if not self.image_exists:
LOGGER.debug("Deleting image '%s' with ID '%s'...",
self.GLANCE_IMAGE_NAME, self.image_id)
diff --git a/functest/opnfv_tests/openstack/rally/scenario/full/opnfv-cinder.yaml b/functest/opnfv_tests/openstack/rally/scenario/full/opnfv-cinder.yaml
index e844e33f6..5f46f5192 100644
--- a/functest/opnfv_tests/openstack/rally/scenario/full/opnfv-cinder.yaml
+++ b/functest/opnfv_tests/openstack/rally/scenario/full/opnfv-cinder.yaml
@@ -101,7 +101,6 @@
CinderVolumes.create_snapshot_and_attach_volume:
-
args:
- volume_type: false
size:
min: 1
max: 5
@@ -119,26 +118,6 @@
{{ constant_runner(concurrency=concurrency, times=iterations, is_smoke=smoke) }}
sla:
{{ no_failures_sla() }}
- -
- args:
- volume_type: true
- size:
- min: 1
- max: 5
- context:
- {% call user_context(tenants_amount, users_amount, use_existing_users) %}
- quotas:
- {{ unlimited_volumes() }}
- servers:
- {{ vm_params(image_name,flavor_name,none)|indent(2,true) }}
- servers_per_tenant: 2
- auto_assign_nic: true
- network: {}
- {% endcall %}
- runner:
- {{ constant_runner(concurrency=concurrency, times=iterations, is_smoke=smoke) }}
- sla:
- {{ no_failures_sla() }}
CinderVolumes.create_volume:
-
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index c8c2c509c..f9548eb2c 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
@@ -412,7 +412,7 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
@energy.enable_recording
def run(self, **kwargs):
"""Execute CloudifyIms test case."""
- super(CloudifyIms, self).run(**kwargs)
+ return super(CloudifyIms, self).run(**kwargs)
# ----------------------------------------------------------
diff --git a/functest/opnfv_tests/vnf/ims/orchestra.yaml b/functest/opnfv_tests/vnf/ims/orchestra.yaml
index 4cd18e72b..457ca90e1 100644
--- a/functest/opnfv_tests/vnf/ims/orchestra.yaml
+++ b/functest/opnfv_tests/vnf/ims/orchestra.yaml
@@ -29,7 +29,7 @@ mano:
orchestra_openims:
name: OpenIMS
descriptor:
- url: http://marketplace.openbaton.org:8082/api/v1/nsds/fokus/OpenImsCore/3.2.0/json
+ url: http://marketplace.openbaton.org:8080/api/v1/nsds/fokus/OpenImsCore/3.2.0/json
requirements:
flavor:
name: m1.small
@@ -51,7 +51,7 @@ orchestra_openims:
orchestra_clearwaterims:
name: Clearwater IMS
descriptor:
- url: http://marketplace.openbaton.org:8082/api/v1/nsds/fokus/ClearwaterIMS/3.2.0/json
+ url: http://marketplace.openbaton.org:8080/api/v1/nsds/fokus/ClearwaterIMS/3.2.0/json
requirements:
flavor:
name: m1.small
diff --git a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
index c924a3470..5b2e585ed 100644
--- a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
+++ b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
@@ -130,6 +130,8 @@ def get_userdata(orchestrator=dict):
orchestrator['gvnfm']['userdata']['url'])
userdata += "sed -i '113i"'\ \ \ \ '"sleep 60' " \
"/etc/openbaton/openbaton-vnfm-generic-user-data.sh\n"
+ userdata += ("sed -i s/nfvo.marketplace.port=8082/nfvo.marketplace."
+ "port=8080/g /etc/openbaton/openbaton-nfvo.properties\n")
userdata += "echo \"Starting NFVO\"\n"
userdata += "service openbaton-nfvo restart\n"
userdata += "echo \"Starting Generic VNFM\"\n"
@@ -141,13 +143,13 @@ def get_userdata(orchestrator=dict):
class ClearwaterImsVnf(vnf.VnfOnBoarding):
"""Clearwater IMS VNF deployed with openBaton orchestrator"""
- logger = logging.getLogger(__name__)
+ # logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
if "case_name" not in kwargs:
kwargs["case_name"] = "orchestra_clearwaterims"
super(ClearwaterImsVnf, self).__init__(**kwargs)
- # self.logger = logging.getLogger("functest.ci.run_tests.orchestra")
+ self.logger = logging.getLogger("functest.ci.run_tests.orchestra")
self.logger.info("kwargs %s", (kwargs))
self.case_dir = pkg_resources.resource_filename(
diff --git a/functest/opnfv_tests/vnf/ims/orchestra_openims.py b/functest/opnfv_tests/vnf/ims/orchestra_openims.py
index aae35146f..fa700890c 100644
--- a/functest/opnfv_tests/vnf/ims/orchestra_openims.py
+++ b/functest/opnfv_tests/vnf/ims/orchestra_openims.py
@@ -130,6 +130,8 @@ def get_userdata(orchestrator=dict):
orchestrator['gvnfm']['userdata']['url'])
userdata += "sed -i '113i"'\ \ \ \ '"sleep 60' " \
"/etc/openbaton/openbaton-vnfm-generic-user-data.sh\n"
+ userdata += ("sed -i s/nfvo.marketplace.port=8082/nfvo.marketplace."
+ "port=8080/g /etc/openbaton/openbaton-nfvo.properties\n")
userdata += "echo \"Starting NFVO\"\n"
userdata += "service openbaton-nfvo restart\n"
userdata += "echo \"Starting Generic VNFM\"\n"
@@ -141,13 +143,13 @@ def get_userdata(orchestrator=dict):
class OpenImsVnf(vnf.VnfOnBoarding):
"""OpenIMS VNF deployed with openBaton orchestrator"""
- logger = logging.getLogger(__name__)
+ # logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
if "case_name" not in kwargs:
kwargs["case_name"] = "orchestra_openims"
super(OpenImsVnf, self).__init__(**kwargs)
- # self.logger = logging.getLogger("functest.ci.run_tests.orchestra")
+ self.logger = logging.getLogger("functest.ci.run_tests.orchestra")
self.logger.info("kwargs %s", (kwargs))
self.case_dir = pkg_resources.resource_filename(
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py
index 05311c3ff..95222ca8b 100644
--- a/functest/tests/unit/openstack/rally/test_rally.py
+++ b/functest/tests/unit/openstack/rally/test_rally.py
@@ -22,15 +22,12 @@ class OSRallyTesting(unittest.TestCase):
'get_nova_client', return_value=mock.Mock())
@mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
'get_neutron_client', return_value=mock.Mock())
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
- 'get_cinder_client', return_value=mock.Mock())
- def setUp(self, mock_func1, mock_func2, mock_func3):
+ def setUp(self, mock_func1, mock_func2):
self.rally_base = rally.RallyBase()
self.rally_base.network_dict['net_id'] = 'test_net_id'
self.polling_iter = 2
mock_func1.assert_called()
mock_func2.assert_called()
- mock_func3.assert_called()
@mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
'get_external_net', return_value=None)
@@ -288,51 +285,26 @@ class OSRallyTesting(unittest.TestCase):
self.rally_base._prepare_env()
@mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
- 'list_volume_types', return_value=None)
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
- 'create_volume_type', return_value=None)
- def test_prepare_env_volume_creation_failed(self, mock_list, mock_create):
- self.rally_base.TESTS = ['test1', 'test2']
- self.rally_base.test_name = 'test1'
- with self.assertRaises(Exception):
- self.rally_base._prepare_env()
- mock_list.assert_called()
- mock_create.assert_called()
-
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
- 'list_volume_types', return_value=None)
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
- 'create_volume_type', return_value=mock.Mock())
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
'get_or_create_image', return_value=(True, None))
- def test_prepare_env_image_missing(self, mock_get_img, mock_create_vt,
- mock_list_vt):
+ def test_prepare_env_image_missing(self, mock_get_img):
self.rally_base.TESTS = ['test1', 'test2']
self.rally_base.test_name = 'test1'
with self.assertRaises(Exception):
self.rally_base._prepare_env()
mock_get_img.assert_called()
- mock_create_vt.assert_called()
- mock_list_vt.assert_called()
@mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
- 'list_volume_types', return_value=None)
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
- 'create_volume_type', return_value=mock.Mock())
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
'get_or_create_image', return_value=(True, 'image_id'))
@mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
'create_shared_network_full', return_value=None)
def test_prepare_env_image_shared_network_creation_failed(
- self, mock_create_net, mock_get_img, mock_create_vt, mock_list_vt):
+ self, mock_create_net, mock_get_img):
self.rally_base.TESTS = ['test1', 'test2']
self.rally_base.test_name = 'test1'
with self.assertRaises(Exception):
self.rally_base._prepare_env()
mock_create_net.assert_called()
mock_get_img.assert_called()
- mock_create_vt.assert_called()
- mock_list_vt.assert_called()
@mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
'_run_task', return_value=mock.Mock())
@@ -352,18 +324,13 @@ class OSRallyTesting(unittest.TestCase):
mock_run_task.assert_any_call('test1')
@mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
- 'delete_volume_type')
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.os_utils.'
'delete_glance_image')
- def test_clean_up_default(self, mock_glance_method, mock_vol_method):
- self.rally_base.volume_type = mock.Mock()
+ def test_clean_up_default(self, mock_glance_method):
self.rally_base.cinder_client = mock.Mock()
self.rally_base.image_exists = False
self.rally_base.image_id = 1
self.rally_base.nova_client = mock.Mock()
self.rally_base._clean_up()
- mock_vol_method.assert_any_call(self.rally_base.cinder_client,
- self.rally_base.volume_type)
mock_glance_method.assert_any_call(self.rally_base.nova_client,
1)
diff --git a/functest/tests/unit/utils/test_openstack_utils.py b/functest/tests/unit/utils/test_openstack_utils.py
index 3bd7e3dd6..307cbe37d 100644
--- a/functest/tests/unit/utils/test_openstack_utils.py
+++ b/functest/tests/unit/utils/test_openstack_utils.py
@@ -135,25 +135,8 @@ class OSUtilsTesting(unittest.TestCase):
mock_obj.configure_mock(**attrs)
self.volume = mock_obj
- mock_obj = mock.Mock()
- attrs = {'id': 'volume_type_id',
- 'name': 'test_volume_type',
- 'is_public': True}
- mock_obj.configure_mock(**attrs)
- self.volume_types = [mock_obj]
-
- mock_obj = mock.Mock()
- attrs = {'id': 'volume_type_id',
- 'name': 'test_volume_type',
- 'is_public': False}
- mock_obj.configure_mock(**attrs)
- self.volume_types.append(mock_obj)
-
self.cinder_client = mock.Mock()
attrs = {'volumes.list.return_value': [self.volume],
- 'volume_types.list.return_value': self.volume_types,
- 'volume_types.create.return_value': self.volume_types[0],
- 'volume_types.delete.return_value': mock.Mock(),
'quotas.update.return_value': mock.Mock(),
'volumes.detach.return_value': mock.Mock(),
'volumes.force_delete.return_value': mock.Mock(),
@@ -1525,41 +1508,6 @@ class OSUtilsTesting(unittest.TestCase):
None)
self.assertTrue(mock_logger_error.called)
- def test_list_volume_types_default_private(self):
- self.assertEqual(openstack_utils.
- list_volume_types(self.cinder_client,
- public=False,
- private=True),
- [self.volume_types[1]])
-
- def test_list_volume_types_default_public(self):
- self.assertEqual(openstack_utils.
- list_volume_types(self.cinder_client,
- public=True,
- private=False),
- [self.volume_types[0]])
-
- @mock.patch('functest.utils.openstack_utils.logger.error')
- def test_list_volume_types_exception(self, mock_logger_error):
- self.assertEqual(openstack_utils.
- list_volume_types(Exception),
- None)
- self.assertTrue(mock_logger_error.called)
-
- def test_create_volume_type_default(self):
- self.assertEqual(openstack_utils.
- create_volume_type(self.cinder_client,
- 'test_volume_type'),
- self.volume_types[0])
-
- @mock.patch('functest.utils.openstack_utils.logger.error')
- def test_create_volume_type_exception(self, mock_logger_error):
- self.assertEqual(openstack_utils.
- create_volume_type(Exception,
- 'test_volume_type'),
- None)
- self.assertTrue(mock_logger_error.called)
-
def test_update_cinder_quota_default(self):
self.assertTrue(openstack_utils.
update_cinder_quota(self.cinder_client,
@@ -1597,18 +1545,6 @@ class OSUtilsTesting(unittest.TestCase):
forced=True))
self.assertTrue(mock_logger_error.called)
- def test_delete_volume_type_default(self):
- self.assertTrue(openstack_utils.
- delete_volume_type(self.cinder_client,
- self.volume_types[0]))
-
- @mock.patch('functest.utils.openstack_utils.logger.error')
- def test_delete_volume_type_exception(self, mock_logger_error):
- self.assertFalse(openstack_utils.
- delete_volume_type(Exception,
- self.volume_types[0]))
- self.assertTrue(mock_logger_error.called)
-
def test_get_tenants_default(self):
with mock.patch('functest.utils.openstack_utils.'
'is_keystone_v3', return_value=True):
diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py
index f211627a5..d8b1cf6f9 100644
--- a/functest/utils/openstack_utils.py
+++ b/functest/utils/openstack_utils.py
@@ -1274,29 +1274,6 @@ def get_volumes(cinder_client):
return None
-def list_volume_types(cinder_client, public=True, private=True):
- try:
- volume_types = cinder_client.volume_types.list()
- if not public:
- volume_types = [vt for vt in volume_types if not vt.is_public]
- if not private:
- volume_types = [vt for vt in volume_types if vt.is_public]
- return volume_types
- except Exception as e:
- logger.error("Error [list_volume_types(cinder_client)]: %s" % e)
- return None
-
-
-def create_volume_type(cinder_client, name):
- try:
- volume_type = cinder_client.volume_types.create(name)
- return volume_type
- except Exception as e:
- logger.error("Error [create_volume_type(cinder_client, '%s')]: %s"
- % (name, e))
- return None
-
-
def update_cinder_quota(cinder_client, tenant_id, vols_quota,
snapshots_quota, gigabytes_quota):
quotas_values = {"volumes": vols_quota,
@@ -1330,16 +1307,6 @@ def delete_volume(cinder_client, volume_id, forced=False):
return False
-def delete_volume_type(cinder_client, volume_type):
- try:
- cinder_client.volume_types.delete(volume_type)
- return True
- except Exception as e:
- logger.error("Error [delete_volume_type(cinder_client, '%s')]: %s"
- % (volume_type, e))
- return False
-
-
# *********************************************
# KEYSTONE
# *********************************************