Update and enable Cloudify-based testcases 31/66931/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Mon, 11 Feb 2019 05:45:34 +0000 (06:45 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Mon, 11 Feb 2019 15:02:59 +0000 (16:02 +0100)
It switches from the Cloudify virtual machine to the community
container which allows deploying vyos_vrouter and cloudify_ims.

Last stable Cloudify OpenStack plugin (2.4.17) is now deployed.
It also updates the Cloudify python package to latest release.

It adds a delay before deleting the blueprint which may be
improved in a second change (it allows enabling the testcase in
the stable release).

Change-Id: Ie48a2c9d2badab0d7ba0b9e7845f453fad335ef7
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 97dde581982b9d49122aee3630328fb6064c8609)

docker/vnf/Dockerfile
docker/vnf/testcases.yaml
functest/ci/download_images.sh
functest/ci/testcases.yaml
functest/core/cloudify.py
functest/opnfv_tests/vnf/ims/cloudify_ims.py
functest/opnfv_tests/vnf/router/cloudify_vrouter.py
upper-constraints.txt

index 198f098..16ef796 100644 (file)
@@ -4,9 +4,10 @@ ARG BRANCH=stable/hunter
 ARG OPENSTACK_TAG=stable/rocky
 ARG VIMS_TEST_TAG=release-130
 ARG QUAFF_TAG=59213d6d8ee29433552bb75f505cdc96b0b18909
-ARG CLOUDIFY_VIMS_TAG=fraser
+ARG CLOUDIFY_VIMS_TAG=gambia
 ARG HEAT_VIMS_TAG=release-130
 ARG VROUTER_TAG=fraser
+ARG VROUTER_BP_TAG=b16be2bfc4acabfec015300d294762b2da56c3a8
 ARG JUJU_TAG=tags/juju-2.3.9
 ARG JUJU_WAIT_TAG=2.6.4
 ARG ABOT_CHARM=opnfv-fraser
@@ -46,7 +47,7 @@ RUN apk --no-cache add --update \
         git checkout FETCH_HEAD) && \
     git init /src/opnfv-vnf-vyos-blueprint && \
     (cd /src/opnfv-vnf-vyos-blueprint && \
-        git fetch --tags https://github.com/oolorg/opnfv-vnf-vyos-blueprint.git $VROUTER_TAG && \
+        git fetch --tags https://github.com/oolorg/opnfv-vnf-vyos-blueprint.git $VROUTER_BP_TAG && \
         git checkout FETCH_HEAD) && \
     mkdir -p /home/opnfv/functest/data/router && \
     git init /home/opnfv/functest/data/router/opnfv-vnf-data && \
index 61bcd07..9822a51 100644 (file)
@@ -20,7 +20,6 @@ tiers:
                 project_name: functest
                 criteria: 100
                 blocking: false
-                enabled: false
                 description: >-
                     This test case deploys an OpenSource vIMS solution from
                     Clearwater using the Cloudify orchestrator. It also runs
@@ -45,7 +44,6 @@ tiers:
                 project_name: functest
                 criteria: 100
                 blocking: false
-                enabled: false
                 description: >-
                     This test case is vRouter testing.
                 run:
index 71da9a9..366699d 100644 (file)
@@ -10,7 +10,6 @@ http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
 https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img
 https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
 https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
-http://repository.cloudifysource.org/cloudify/18.10.4/community-release/cloudify-manager-community-18.10.4.qcow2
 http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-aarch64-disk.img
 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
index e99b961..0b75c28 100644 (file)
@@ -546,7 +546,6 @@ tiers:
                 project_name: functest
                 criteria: 100
                 blocking: false
-                enabled: false
                 description: >-
                     This test case deploys an OpenSource vIMS solution from
                     Clearwater using the Cloudify orchestrator. It also runs
@@ -573,7 +572,6 @@ tiers:
                 project_name: functest
                 criteria: 100
                 blocking: false
-                enabled: false
                 description: >-
                     This test case is vRouter testing.
                 run:
index d9b3398..ac8e267 100644 (file)
@@ -27,15 +27,17 @@ class Cloudify(singlevm.SingleVm2):
     __logger = logging.getLogger(__name__)
 
     filename = ('/home/opnfv/functest/images/'
-                'cloudify-manager-community-18.10.4.qcow2')
+                'ubuntu-16.04-server-cloudimg-amd64-disk1.img')
     flavor_ram = 4096
     flavor_vcpus = 2
     flavor_disk = 40
-    username = 'centos'
+    username = 'ubuntu'
     ssh_connect_loops = 12
     create_server_timeout = 600
     ports = [80, 443, 5671, 53333]
 
+    cloudify_container = "cloudifyplatform/community:19.01.24"
+
     def __init__(self, **kwargs):
         """Initialize Cloudify testcase object."""
         if "case_name" not in kwargs:
@@ -54,10 +56,20 @@ class Cloudify(singlevm.SingleVm2):
         """
         Deploy Cloudify Manager.
         """
+        (_, stdout, stderr) = self.ssh.exec_command(
+            "sudo wget https://get.docker.com/ -O script.sh && "
+            "sudo chmod +x script.sh && "
+            "sudo ./script.sh && "
+            "sudo docker run --name cfy_manager_local -d "
+            "--restart unless-stopped -v /sys/fs/cgroup:/sys/fs/cgroup:ro "
+            "--tmpfs /run --tmpfs /run/lock --security-opt seccomp:unconfined "
+            "--cap-add SYS_ADMIN --network=host {}".format(
+                self.cloudify_container))
+        self.__logger.debug("output:\n%s", stdout.read())
+        self.__logger.debug("error:\n%s", stderr.read())
         self.cfy_client = CloudifyClient(
             host=self.fip.floating_ip_address,
-            username='admin', password='admin', tenant='default_tenant',
-            api_version='v3')
+            username='admin', password='admin', tenant='default_tenant')
         self.__logger.info("Attemps running status of the Manager")
         secret_key = "foo"
         secret_value = "bar"
index bbb1969..7008235 100644 (file)
@@ -44,6 +44,12 @@ class CloudifyIms(cloudify.Cloudify):
     quota_security_group_rule = 100
     quota_port = 50
 
+    cop_yaml = ("https://github.com/cloudify-cosmo/cloudify-openstack-plugin/"
+                "releases/download/2.14.7/plugin.yaml")
+    cop_wgn = ("https://github.com/cloudify-cosmo/cloudify-openstack-plugin/"
+               "releases/download/2.14.7/cloudify_openstack_plugin-2.14.7-py27"
+               "-none-linux_x86_64-centos-Core.wgn")
+
     def __init__(self, **kwargs):
         """Initialize CloudifyIms testcase object."""
         if "case_name" not in kwargs:
@@ -152,10 +158,14 @@ class CloudifyIms(cloudify.Cloudify):
         scpc = scp.SCPClient(self.ssh.get_transport())
         scpc.put(self.key_filename, remote_path='~/cloudify_ims.pem')
         (_, stdout, stderr) = self.ssh.exec_command(
-            "sudo cp ~/cloudify_ims.pem /etc/cloudify/ && "
-            "sudo chmod 444 /etc/cloudify/cloudify_ims.pem && "
-            "sudo yum install -y gcc python-devel python-cmd2 && "
-            "cfy status")
+            "sudo docker exec cfy_manager_local "
+            "cfy plugins upload -y {} {} && "
+            "sudo docker cp ~/cloudify_ims.pem "
+            "cfy_manager_local:/etc/cloudify/ && "
+            "sudo docker exec cfy_manager_local "
+            "chmod 444 /etc/cloudify/cloudify_ims.pem && "
+            "sudo docker exec cfy_manager_local cfy status".format(
+                self.cop_yaml, self.cop_wgn))
         self.__logger.info("output:\n%s", stdout.read())
         self.__logger.info("error:\n%s", stderr.read())
 
@@ -293,6 +303,7 @@ class CloudifyIms(cloudify.Cloudify):
                 self.cfy_client, execution, self.__logger)
             self.cfy_client.deployments.delete(
                 self.vnf['descriptor'].get('name'))
+            time.sleep(10)
             self.cfy_client.blueprints.delete(
                 self.vnf['descriptor'].get('name'))
         except Exception:  # pylint: disable=broad-except
index a0145b8..39268d8 100644 (file)
@@ -40,6 +40,12 @@ class CloudifyVrouter(cloudify.Cloudify):
     flavor_alt_vcpus = 1
     flavor_alt_disk = 50
 
+    cop_yaml = ("https://github.com/cloudify-cosmo/cloudify-openstack-plugin/"
+                "releases/download/2.14.7/plugin.yaml")
+    cop_wgn = ("https://github.com/cloudify-cosmo/cloudify-openstack-plugin/"
+               "releases/download/2.14.7/cloudify_openstack_plugin-2.14.7-py27"
+               "-none-linux_x86_64-centos-Core.wgn")
+
     def __init__(self, **kwargs):
         if "case_name" not in kwargs:
             kwargs["case_name"] = "vyos_vrouter"
@@ -118,10 +124,14 @@ class CloudifyVrouter(cloudify.Cloudify):
         scpc = scp.SCPClient(self.ssh.get_transport())
         scpc.put(self.key_filename, remote_path='~/cloudify_ims.pem')
         (_, stdout, stderr) = self.ssh.exec_command(
-            "sudo cp ~/cloudify_ims.pem /etc/cloudify/ && "
-            "sudo chmod 444 /etc/cloudify/cloudify_ims.pem && "
-            "sudo yum install -y gcc python-devel python-cmd2 && "
-            "cfy status")
+            "sudo docker exec cfy_manager_local "
+            "cfy plugins upload -y {} {} && "
+            "sudo docker cp ~/cloudify_ims.pem "
+            "cfy_manager_local:/etc/cloudify/ && "
+            "sudo docker exec cfy_manager_local "
+            "chmod 444 /etc/cloudify/cloudify_ims.pem && "
+            "sudo docker exec cfy_manager_local cfy status".format(
+                self.cop_yaml, self.cop_wgn))
         self.__logger.info("output:\n%s", stdout.read())
         self.__logger.info("error:\n%s", stderr.read())
 
@@ -240,6 +250,7 @@ class CloudifyVrouter(cloudify.Cloudify):
                 self.cfy_client, execution, self.__logger)
             self.cfy_client.deployments.delete(
                 self.vnf['descriptor'].get('name'))
+            time.sleep(10)
             self.cfy_client.blueprints.delete(
                 self.vnf['descriptor'].get('name'))
         except Exception:  # pylint: disable=broad-except
index 5a538fd..596cd50 100644 (file)
@@ -10,7 +10,7 @@ git+https://gerrit.opnfv.org/gerrit/clover#egg=clover
 git+https://gerrit.opnfv.org/gerrit/parser#egg=nfv-heattranslator&subdirectory=tosca2heat/heat-translator
 git+https://gerrit.opnfv.org/gerrit/parser#egg=nfv-toscaparser&subdirectory=tosca2heat/tosca-parser
 -e git+https://gerrit.opnfv.org/gerrit/parser#egg=nfv-parser
-cloudify-rest-client===4.3.2
+cloudify-rest-client===4.3.3
 robotframework===3.0.2
 robotframework-httplibrary===0.4.2
 robotframework-requests===0.4.7