Rally test case troubleshooting 59/6359/1
authorJuha Kosonen <juha.kosonen@nokia.com>
Tue, 12 Jan 2016 13:15:45 +0000 (13:15 +0000)
committerMorgan Richomme <morgan.richomme@orange.com>
Tue, 12 Jan 2016 14:10:40 +0000 (14:10 +0000)
Minor changes to some of the failed scenarios in rally_cert.

JIRA: FUNCTEST-110

Change-Id: I25d1a80d295bea0004a3bf5f42161080c44091e9
Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
(cherry picked from commit 236f391ce99bc5e1d4a56ec5ea65705895bf39d9)

testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
testcases/VIM/OpenStack/CI/rally_cert/macro/macro.yaml
testcases/VIM/OpenStack/CI/rally_cert/scenario/opnfv-cinder.yaml
testcases/VIM/OpenStack/CI/rally_cert/scenario/opnfv-glance.yaml
testcases/VIM/OpenStack/CI/rally_cert/scenario/opnfv-heat.yaml
testcases/VIM/OpenStack/CI/rally_cert/scenario/opnfv-keystone.yaml
testcases/VIM/OpenStack/CI/rally_cert/scenario/opnfv-neutron.yaml
testcases/VIM/OpenStack/CI/rally_cert/scenario/opnfv-nova.yaml
testcases/VIM/OpenStack/CI/rally_cert/scenario/opnfv-vm.yaml
testcases/VIM/OpenStack/CI/rally_cert/scenario/templates/server_with_volume.yaml.template

index 18f91b8..d44100e 100755 (executable)
@@ -25,6 +25,7 @@ import sys
 import novaclient.v2.client as novaclient
 from glanceclient import client as glanceclient
 from keystoneclient.v2_0 import client as keystoneclient
+from neutronclient.v2_0 import client as neutronclient
 
 """ tests configuration """
 tests = ['authenticate', 'glance', 'cinder', 'heat', 'keystone',
@@ -32,21 +33,27 @@ tests = ['authenticate', 'glance', 'cinder', 'heat', 'keystone',
 parser = argparse.ArgumentParser()
 parser.add_argument("repo_path", help="Path to the repository")
 parser.add_argument("test_name",
-                    help="Module name to be tested"
+                    help="Module name to be tested"
                          "Possible values are : "
                          "[ {d[0]} | {d[1]} | {d[2]} | {d[3]} | {d[4]} | "
-                         "{d[5]} | {d[6]} | {d[7]}] "
+                         "{d[5]} | {d[6]} | {d[7]} | {d[8]} | {d[9]} | "
+                         "{d[10]} ] "
                          "The 'all' value "
-                         "performs all the possible tests scenarios"
+                         "performs all possible test scenarios"
                          .format(d=tests))
 
 parser.add_argument("-d", "--debug", help="Debug mode",  action="store_true")
 parser.add_argument("-r", "--report",
                     help="Create json result file",
                     action="store_true")
+parser.add_argument("-s", "--smoke",
+                    help="Smoke test mode",
+                    action="store_true")
 
 args = parser.parse_args()
 
+client_dict = {}
+
 sys.path.append(args.repo_path + "testcases/")
 import functest_utils
 
@@ -89,6 +96,10 @@ RESULTS_DIR = functest_yaml.get("general").get("directories"). \
 TEST_DB = functest_yaml.get("results").get("test_db_url")
 FLOATING_NETWORK = functest_yaml.get("general"). \
     get("openstack").get("neutron_public_net_name")
+FLOATING_SUBNET_CIDR = functest_yaml.get("general"). \
+    get("openstack").get("neutron_public_subnet_cidr")
+PRIVATE_NETWORK = functest_yaml.get("general"). \
+    get("openstack").get("neutron_private_net_name")
 
 GLANCE_IMAGE_NAME = functest_yaml.get("general"). \
     get("openstack").get("image_name")
@@ -98,7 +109,6 @@ GLANCE_IMAGE_FORMAT = functest_yaml.get("general"). \
     get("openstack").get("image_disk_format")
 GLANCE_IMAGE_PATH = functest_yaml.get("general"). \
     get("directories").get("dir_functest_data") + "/" + GLANCE_IMAGE_FILENAME
-GLANCE_IMAGE_LOCATION = "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img"
 
 
 def push_results_to_db(payload):
@@ -154,11 +164,14 @@ def task_succeed(json_raw):
 
 def build_task_args(test_file_name):
     task_args = {'service_list': [test_file_name]}
-    task_args['smoke'] = False
+    task_args['smoke'] = args.smoke
     task_args['image_name'] = GLANCE_IMAGE_NAME
     task_args['flavor_name'] = FLAVOR_NAME
-    task_args['glance_image_location'] = GLANCE_IMAGE_LOCATION
+    task_args['glance_image_location'] = GLANCE_IMAGE_PATH
     task_args['floating_network'] = FLOATING_NETWORK
+    task_args['floating_subnet_cidr'] = FLOATING_SUBNET_CIDR
+    task_args['netid'] = functest_utils.get_network_id(client_dict['neutron'],
+                                    PRIVATE_NETWORK).encode('ascii', 'ignore')
     task_args['tmpl_dir'] = TEMPLATE_DIR
     task_args['sup_dir'] = SUPPORT_DIR
     task_args['users_amount'] = USERS_AMOUNT
@@ -247,6 +260,8 @@ def main():
 
     creds_nova = functest_utils.get_credentials("nova")
     nova_client = novaclient.Client(**creds_nova)
+    creds_neutron = functest_utils.get_credentials("neutron")
+    neutron_client = neutronclient.Client(**creds_neutron)
     creds_keystone = functest_utils.get_credentials("keystone")
     keystone_client = keystoneclient.Client(**creds_keystone)
     glance_endpoint = keystone_client.service_catalog.url_for(service_type='image',
@@ -254,6 +269,8 @@ def main():
     glance_client = glanceclient.Client(1, glance_endpoint,
                                         token=keystone_client.auth_token)
 
+    client_dict['neutron'] = neutron_client
+
     logger.debug("Creating image '%s' from '%s'..." % (GLANCE_IMAGE_NAME, GLANCE_IMAGE_PATH))
     image_id = functest_utils.create_glance_image(glance_client,
                                             GLANCE_IMAGE_NAME,GLANCE_IMAGE_PATH)
@@ -272,8 +289,6 @@ def main():
     if args.test_name == "all":
         for test_name in tests:
             if not (test_name == 'all' or
-                    test_name == 'heat' or
-                    test_name == 'smoke' or
                     test_name == 'vm'):
                 print(test_name)
                 run_task(test_name)
index e6542f3..48c0333 100644 (file)
             security_groups: -1
 {%- endmacro %}
 
-{%- macro unlimited_neutron() %}
-{% if "neutron" in service_list %}
+{%- macro unlimited_neutron(secgroups=false) %}
           neutron:
             network: -1
             port: -1
             subnet: -1
-{% endif %}
+            {%- if secgroups %}
+            security_group: -1
+            security_group_rule: -1
+            {%- endif %}
 {%- endmacro %}
 
 {%- macro glance_args(location, container="bare", type="qcow2") %}
index 3c64e26..723db65 100644 (file)
@@ -2,6 +2,8 @@
     -
       args:
         {{ vm_params(image_name,flavor_name,1) }}
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         quotas:
   CinderVolumes.create_nested_snapshots_and_attach_volume:
     -
       args:
-        nested_level:
-          max: 1
-          min: 1
+        nested_level: 1
         size:
           max: 1
           min: 1
         servers:
           {{ vm_params(image_name,flavor_name,none)|indent(2,true) }}
           servers_per_tenant: 1
+          auto_assign_nic: true
+        network: {}
         {% endcall %}
       runner:
         {{ constant_runner(concurrency=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
           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=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
               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=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
           min: 1
           max: 5
       context:
-        {{ user_context(tenants_amount, users_amount, use_existing_users) }}
+        {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        quotas:
+          {{ unlimited_volumes() }}
+        {% endcall %}
       runner:
         {{ constant_runner(concurrency=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
       sla:
       args:
         detailed: True
       context:
-        {{ user_context(tenants_amount, users_amount, use_existing_users) }}
+        {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        quotas:
+          {{ unlimited_volumes() }}
         volumes:
           size: 1
           volumes_per_tenant: 4
+        {% endcall %}
       runner:
         {{ constant_runner(concurrency=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
       sla:
index c9cf9a0..b5eb7f3 100644 (file)
       args:
         {{ glance_args(location=glance_image_location) }}
         flavor:
-            name: "{{flavor_name}}"
+            name: {{ flavor_name }}
         number_instances: 2
+        nics:
+          - net-id: {{ netid }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
+        quotas:
+          {{ unlimited_nova() }}
       runner:
         {{ constant_runner(concurrency=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
       sla:
         {{ no_failures_sla() }}
+
index 3689cc4..6debb41 100644 (file)
     -
       args:
         template_path: "{{ tmpl_dir }}/server_with_ports.yaml.template"
+        parameters:
+          public_net: {{ floating_network }}
+          image: {{ image_name }}
+          flavor: {{ flavor_name }}
+          cidr: {{ floating_subnet_cidr }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
     -
       args:
         template_path: "{{ tmpl_dir }}/server_with_volume.yaml.template"
+        parameters:
+          image: {{ image_name }}
+          flavor: {{ flavor_name }}
+          network_id: {{ netid }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
       runner:
         {{ constant_runner(concurrency=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
       sla:
-        {{ no_failures_sla() }}
\ No newline at end of file
+        {{ no_failures_sla() }}
+
index a6a637f..50cbecf 100644 (file)
@@ -18,8 +18,6 @@
 
   KeystoneBasic.create_and_list_tenants:
     -
-      args:
-        name_length: 10
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
@@ -56,8 +54,6 @@
 
   KeystoneBasic.create_update_and_delete_tenant:
     -
-      args:
-        name_length: 10
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
@@ -67,8 +63,6 @@
 
   KeystoneBasic.create_user:
     -
-      args:
-        name_length: 10
       runner:
         {{ constant_runner(concurrency=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
       sla:
@@ -76,8 +70,6 @@
 
   KeystoneBasic.create_tenant:
     -
-      args:
-        name_length: 10
       runner:
         {{ constant_runner(concurrency=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
       sla:
@@ -85,8 +77,6 @@
 
   KeystoneBasic.create_and_list_users:
     -
-      args:
-        name_length: 10
       runner:
         {{ constant_runner(concurrency=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
       sla:
@@ -95,7 +85,6 @@
   KeystoneBasic.create_tenant_with_users:
     -
       args:
-        name_length: 10
         users_per_tenant: 10
       runner:
         {{ constant_runner(concurrency=2*controllers_amount,times=10*controllers_amount, is_smoke=smoke) }}
index 4f4a633..152c748 100644 (file)
@@ -21,6 +21,7 @@
         ports_per_network: 1
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        network: {}
         quotas:
           neutron:
             network: -1
@@ -41,6 +42,7 @@
         subnets_per_network: 1
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        network: {}
         quotas:
           neutron:
             network: -1
@@ -62,6 +64,7 @@
         subnets_per_network: 1
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        network: {}
         quotas:
           neutron:
             network: -1
@@ -95,6 +98,7 @@
         ports_per_network: 1
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        network: {}
         quotas:
           neutron:
             network: -1
         subnets_per_network: 1
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        network: {}
         quotas:
           neutron:
             network: -1
         subnets_per_network: 1
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        network: {}
         quotas:
           neutron:
             network: -1
         network_create_args: {}
         network_update_args:
           admin_state_up: false
-          name: "_updated"
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         quotas:
           admin_state_up: false
           device_id: "dummy_id"
           device_owner: "dummy_owner"
-          name: "_port_updated"
         ports_per_network: 1
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        network: {}
         quotas:
           neutron:
             network: -1
         router_create_args: {}
         router_update_args:
           admin_state_up: false
-          name: "_router_updated"
         subnet_cidr_start: "1.1.0.0/30"
         subnet_create_args: {}
         subnets_per_network: 1
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        network: {}
         quotas:
           neutron:
             network: -1
         subnet_create_args: {}
         subnet_update_args:
           enable_dhcp: false
-          name: "_subnet_updated"
         subnets_per_network: 1
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        network: {}
         quotas:
           neutron:
             network: -1
       sla:
         {{ no_failures_sla() }}
 
-  Quotas.neutron_update:
-    -
-      args:
-        max_quota: 1024
-      context:
-        {{ user_context(tenants_amount, users_amount, use_existing_users) }}
-      runner:
-        {{ constant_runner(concurrency=2*controllers_amount, times=10*controllers_amount, is_smoke=smoke) }}
-      sla:
-        {{ no_failures_sla() }}
\ No newline at end of file
index 76a3375..d4bddbd 100644 (file)
@@ -2,6 +2,9 @@
     -
       args:
         {{ vm_params(image_name, flavor_name) }}
+        server_kwargs:
+            nics:
+              - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network:
@@ -53,6 +56,8 @@
           -
             rescue_unrescue: 1
         {{ vm_params(image_name, flavor_name) }}
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network:
@@ -71,6 +76,8 @@
     -
       args:
         {{ vm_params(image_name, flavor_name) }}
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network:
@@ -90,6 +97,8 @@
       args:
         detailed: true
         {{ vm_params(image_name, flavor_name) }}
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network:
           name: {{ image_name }}
         to_image:
           name: {{ image_name }}
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network:
       args:
         {{ vm_params(image_name, flavor_name) }}
         volume_size: 5
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network:
       args:
         {{ vm_params(image_name, flavor_name) }}
         force_delete: false
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network:
     -
       args:
         {{ vm_params(image_name, flavor_name) }}
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network:
         {{ vm_params(image_name, flavor_name) }}
         security_group_count: 10
         rules_per_security_group: 10
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network:
           start_cidr: "100.1.0.0/25"
+        quotas:
+          {{ unlimited_nova() }}
+          {{ unlimited_neutron(secgroups=true) }}
         {% endcall %}
       runner:
         {{ constant_runner(concurrency=2*controllers_amount, times=10*controllers_amount, is_smoke=smoke) }}
     - args:
         {{ vm_params(image_name, flavor_name) }}
         block_migration: false
+        nics:
+          - net-id: {{ netid }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
   NovaServers.boot_and_migrate_server:
     - args:
         {{ vm_params(image_name, flavor_name) }}
+        nics:
+          - net-id: {{ netid }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
       args:
         {{ vm_params(image_name, flavor_name) }}
         volume_size: 10
+        nics:
+          - net-id: {{ netid }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
     -
       args:
         {{ vm_params(image_name, flavor_name) }}
+        nics:
+          - net-id: {{ netid }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
         {{ vm_params(image_name, flavor_name) }}
         size: 10
         block_migration: false
+        boot_server_kwargs:
+            nics:
+              - net-id: {{ netid }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
         block_migration: false
         volume_size: 10
         force_delete: false
+        nics:
+          - net-id: {{ netid }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
         security_group_count: 10
         rules_per_security_group: 10
       context:
-        {{ user_context(tenants_amount, users_amount, use_existing_users) }}
+        {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        quotas:
+          {{ unlimited_neutron(secgroups=true) }}
+        {% endcall %}
       runner:
         {{ constant_runner(concurrency=2*controllers_amount, times=10*controllers_amount, is_smoke=smoke) }}
       sla:
         security_group_count: 10
         rules_per_security_group: 10
       context:
-        {{ user_context(tenants_amount, users_amount, use_existing_users) }}
+        {% call user_context(tenants_amount, users_amount, use_existing_users) %}
+        quotas:
+          {{ unlimited_neutron(secgroups=true) }}
+        {% endcall %}
       runner:
         {{ constant_runner(concurrency=2*controllers_amount, times=10*controllers_amount, is_smoke=smoke) }}
       sla:
         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=2*controllers_amount, times=10*controllers_amount, is_smoke=smoke) }}
           name: "m1.small"
         confirm: true
         force_delete: false
+        nics:
+          - net-id: {{ netid }}
       context:
         {{ user_context(tenants_amount, users_amount, use_existing_users) }}
       runner:
index ae3230f..17ce20c 100644 (file)
@@ -4,9 +4,12 @@
         {{ vm_params(image_name, flavor_name) }}
         floating_network: {{ floating_network }}
         force_delete: false
-        interpreter: /bin/sh
-        script: {{ sup_dir }}/instance_dd_test.sh
-        username: admin
+        command:
+          interpreter: /bin/sh
+          script_file: {{ sup_dir }}/instance_dd_test.sh
+        username: cirros
+        nics:
+          - net-id: {{ netid }}
       context:
         {% call user_context(tenants_amount, users_amount, use_existing_users) %}
         network: {}
       sla:
         {{ no_failures_sla() }}
 
-  VMTasks.boot_runcommand_delete:
     -
       args:
         {{ vm_params(image_name, flavor_name) }}
         fixed_network: private
         floating_network: {{ floating_network }}
         force_delete: false
-        interpreter: /bin/sh
-        script: {{ sup_dir }}/instance_dd_test.sh
+        command:
+          interpreter: /bin/sh
+          script_file: {{ sup_dir }}/instance_dd_test.sh
         use_floatingip: true
-        username: admin
+        username: cirros
+        nics:
+          - net-id: {{ netid }}
         volume_args:
           size: 2
       context:
index 23c8827..826ca9d 100644 (file)
@@ -19,6 +19,8 @@ parameters:
     constraints:
       - range: { min: 1, max: 1024 }
         description: must be between 1 and 1024 Gb.
+  network_id:
+    type: string
 
 resources:
   server:
@@ -26,6 +28,8 @@ resources:
     properties:
       image: {get_param: image}
       flavor: {get_param: flavor}
+      networks:
+        - network: { get_param: network_id }
   cinder_volume:
     type: OS::Cinder::Volume
     properties: