From 11a6a0598b14f39a9eaa927336b20d7f4b644036 Mon Sep 17 00:00:00 2001 From: Illia Khudoshyn Date: Thu, 2 Jun 2016 14:43:41 +0000 Subject: [PATCH] [CI]Prepare for gate job testing existing users context * Create projects and users and register new rally deployment with existing users. * Add rally CI job for neutron tests using 'existing_users' context. This patch does not affect CI yet. Added features will be activated after corresponding patch to openstack-infra. Change-Id: Idea14c927eeb829f848fd87f38ea6f860828b5c0 --- rally-jobs/rally-neutron-existing-users.yaml | 348 +++++++++++++++++++ tests/ci/osresources.py | 2 + tests/ci/rally-gate.sh | 44 ++- 3 files changed, 393 insertions(+), 1 deletion(-) create mode 100644 rally-jobs/rally-neutron-existing-users.yaml diff --git a/rally-jobs/rally-neutron-existing-users.yaml b/rally-jobs/rally-neutron-existing-users.yaml new file mode 100644 index 00000000..4f9d2cdc --- /dev/null +++ b/rally-jobs/rally-neutron-existing-users.yaml @@ -0,0 +1,348 @@ +{% set image_name = "^cirros.*uec$" %} +{% set smoke = 0 %} + +--- + NeutronNetworks.create_and_list_networks: + - + args: + network_create_args: + runner: + type: "constant" + times: {{smoke or 40}} + concurrency: {{smoke or 20}} + sla: + failure_rate: + max: 20 + + NeutronNetworks.create_and_list_subnets: + - + args: + network_create_args: + subnet_create_args: + subnet_cidr_start: "1.1.0.0/30" + subnets_per_network: 2 + runner: + type: "constant" + times: {{smoke or 20 }} + concurrency: {{smoke or 10}} + context: + network: {} + sla: + failure_rate: + max: 20 + + NeutronSecurityGroup.create_and_list_security_groups: + - + args: + security_group_create_args: {} + runner: + type: "constant" + times: {{smoke or 20 }} + concurrency: {{smoke or 10}} + sla: + failure_rate: + max: 20 + + NeutronSecurityGroup.create_and_delete_security_groups: + - + args: + security_group_create_args: {} + runner: + type: "constant" + times: {{smoke or 20 }} + concurrency: {{smoke or 10}} + sla: + failure_rate: + max: 20 + + NeutronSecurityGroup.create_and_update_security_groups: + - + args: + security_group_create_args: {} + security_group_update_args: {} + runner: + type: "constant" + times: {{smoke or 20 }} + concurrency: {{smoke or 10}} + sla: + failure_rate: + max: 20 + + NeutronNetworks.create_and_list_floating_ips: + - + args: + floating_network: "public" + floating_ip_args: {} + runner: + type: "constant" + times: {{smoke or 40}} + concurrency: {{smoke or 20}} + sla: + failure_rate: + max: 0 + + NeutronNetworks.create_and_list_routers: + - + args: + network_create_args: + subnet_create_args: + subnet_cidr_start: "1.1.0.0/30" + subnets_per_network: 2 + router_create_args: + runner: + type: "constant" + times: {{smoke or 15}} + concurrency: {{smoke or 5}} + context: + network: {} + sla: + failure_rate: + max: 20 + + NeutronNetworks.create_and_list_ports: + - + args: + network_create_args: + port_create_args: + ports_per_network: 4 + runner: + type: "constant" + times: {{smoke or 15}} + concurrency: {{smoke or 5}} + context: + network: {} + sla: + failure_rate: + max: 20 + + NeutronLoadbalancerV1.create_and_list_healthmonitors: + - + args: + healthmonitor_create_args: {} + runner: + type: "constant" + times: {{smoke or 20}} + concurrency: {{smoke or 10}} + sla: + failure_rate: + max: 0 + + NeutronLoadbalancerV1.create_and_delete_healthmonitors: + - + args: + healthmonitor_create_args: {} + runner: + type: "constant" + times: {{smoke or 20}} + concurrency: {{smoke or 10}} + sla: + failure_rate: + max: 0 + + NeutronLoadbalancerV1.create_and_update_healthmonitors: + - + args: + healthmonitor_create_args: {} + healthmonitor_update_args: + admin_state_up: False + runner: + type: "constant" + times: {{smoke or 20}} + concurrency: {{smoke or 10}} + sla: + failure_rate: + max: 0 + + NeutronNetworks.create_and_update_networks: + - + args: + network_create_args: {} + network_update_args: + admin_state_up: False + name: "_updated" + runner: + type: "constant" + times: {{smoke or 20}} + concurrency: {{smoke or 10}} + sla: + failure_rate: + max: 20 + + NeutronNetworks.create_and_update_subnets: + - + args: + network_create_args: {} + subnet_create_args: {} + subnet_cidr_start: "1.4.0.0/16" + subnets_per_network: 2 + subnet_update_args: + enable_dhcp: False + name: "_subnet_updated" + runner: + type: "constant" + times: {{smoke or 20}} + concurrency: {{smoke or 10}} + context: + network: {} + sla: + failure_rate: + max: 20 + + NeutronNetworks.create_and_update_routers: + - + args: + network_create_args: {} + subnet_create_args: {} + subnet_cidr_start: "1.1.0.0/30" + subnets_per_network: 2 + router_create_args: {} + router_update_args: + admin_state_up: False + name: "_router_updated" + runner: + type: "constant" + times: {{smoke or 15}} + concurrency: {{smoke or 5}} + context: + network: {} + sla: + failure_rate: + max: 20 + + NeutronNetworks.create_and_delete_networks: + - + args: + network_create_args: {} + runner: + type: "constant" + times: {{smoke or 20}} + concurrency: {{smoke or 10}} + sla: + failure_rate: + max: 20 + + NeutronNetworks.create_and_delete_subnets: + - + args: + network_create_args: {} + subnet_create_args: {} + subnet_cidr_start: "1.1.0.0/30" + subnets_per_network: 2 + runner: + type: "constant" + times: {{smoke or 20}} + concurrency: {{smoke or 10}} + context: + network: {} + sla: + failure_rate: + max: 20 + + NeutronNetworks.create_and_delete_floating_ips: + - + args: + floating_network: "public" + floating_ip_args: {} + runner: + type: "constant" + times: {{smoke or 40}} + concurrency: {{smoke or 20}} + sla: + failure_rate: + max: 0 + + NeutronNetworks.create_and_delete_ports: + - + args: + network_create_args: {} + port_create_args: {} + ports_per_network: 10 + runner: + type: "constant" + times: {{smoke or 8}} + concurrency: {{smoke or 4}} + context: + network: {} + sla: + failure_rate: + max: 20 + + NeutronNetworks.create_and_update_ports: + - + args: + network_create_args: {} + port_create_args: {} + ports_per_network: 5 + port_update_args: + admin_state_up: False + device_id: "dummy_id" + device_owner: "dummy_owner" + name: "_port_updated" + runner: + type: "constant" + times: {{smoke or 20}} + concurrency: {{smoke or 10}} + context: + network: {} + sla: + failure_rate: + max: 20 + + Quotas.neutron_update: + - + args: + max_quota: 1024 + runner: + type: "constant" + times: {{smoke or 10}} + concurrency: {{smoke or 2}} + sla: + failure_rate: + max: 0 + + NovaSecGroup.create_and_delete_secgroups: + - + args: + security_group_count: 5 + rules_per_security_group: 5 + runner: + type: "constant" + times: {{smoke or 4}} + concurrency: {{smoke or 4}} + sla: + failure_rate: + max: 0 + + NovaSecGroup.create_and_list_secgroups: + - + args: + security_group_count: 5 + rules_per_security_group: 5 + runner: + type: "constant" + times: {{smoke or 4}} + concurrency: {{smoke or 4}} + sla: + failure_rate: + max: 0 + + VMTasks.boot_runcommand_delete: + - + args: + flavor: + name: "m1.tiny" + image: + name: {{image_name}} + command: + script_file: "~/.rally/extra/instance_dd_test.sh" + interpreter: "/bin/sh" + username: "cirros" + runner: + type: "constant" + times: {{smoke or 4}} + concurrency: {{smoke or 2}} + context: + network: {} + sla: + failure_rate: + max: 0 diff --git a/tests/ci/osresources.py b/tests/ci/osresources.py index 65878df6..898ae8bf 100755 --- a/tests/ci/osresources.py +++ b/tests/ci/osresources.py @@ -308,6 +308,8 @@ def main(): "config"])) config.update(config.pop("admin")) del config["type"] + if "users" in config: + del config["users"] resources = CloudResources(**config) diff --git a/tests/ci/rally-gate.sh b/tests/ci/rally-gate.sh index 6154f8c4..b426fefb 100755 --- a/tests/ci/rally-gate.sh +++ b/tests/ci/rally-gate.sh @@ -52,9 +52,51 @@ fi env set -o pipefail rally deployment use --deployment devstack + +# NOTE(ikhudoshyn): Create additional users and register a new env +# so that we could run scenarios using 'existing_users' context +if [ "$DEVSTACK_GATE_PREPOPULATE_USERS" -eq "1" ]; then + source ~/.rally/openrc admin admin + openstack --version + + openstack --os-interface admin project create rally-test-project-1 + openstack --os-interface admin user create --project rally-test-project-1 --password rally-test-password-1 rally-test-user-1 + + openstack --os-interface admin project create rally-test-project-2 + openstack --os-interface admin user create --project rally-test-project-2 --password rally-test-password-2 rally-test-user-2 + + set +e + NEUTRON_EXISTS=$(openstack --os-interface admin service list | grep neutron) + set -e + if [ "$NEUTRON_EXISTS" ]; then + OS_QUOTA_STR="--networks -1 --subnets -1 --routers -1 --vips -1 --floating-ips -1 --subnetpools -1 --secgroups -1 --secgroup-rules -1 --ports -1 --health-monitors -1" + openstack --os-interface admin quota set $OS_QUOTA_STR rally-test-project-1 + openstack --os-interface admin quota set $OS_QUOTA_STR rally-test-project-2 + fi + + DEPLOYMENT_CONFIG_FILE=~/.rally/with-existing-users-config + + rally deployment config > $DEPLOYMENT_CONFIG_FILE + sed -i '1a "users": [\ + {\ + "username": "rally-test-user-1",\ + "password": "rally-test-password-1",\ + "tenant_name": "rally-test-project-1",\ + },\ + {\ + "username": "rally-test-user-2",\ + "password": "rally-test-password-2",\ + "tenant_name": "rally-test-project-2"\ + }\ + ],\ +' $DEPLOYMENT_CONFIG_FILE + + rally deployment create --name devstask-with-users --filename $DEPLOYMENT_CONFIG_FILE +fi + rally deployment config rally --debug deployment check -source ~/.rally/openrc +source ~/.rally/openrc demo demo if rally deployment check | grep 'nova' | grep 'Available' > /dev/null; then nova flavor-create m1.nano 42 64 0 1 fi