Merge "[ci] Test openstack deployment without admin"

This commit is contained in:
Jenkins 2017-06-16 08:15:53 +00:00 committed by Gerrit Code Review
commit c1e48401da
6 changed files with 154 additions and 403 deletions

View File

@ -1,387 +1,131 @@
{% set flavor_name = "m1.tiny" %}
{% set image_name = "^cirros.*-disk$" %}
{% set cirros_image_url = "http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img" %}
{% set smoke = 0 %}
---
NeutronNetworks.create_and_list_networks:
version: 2
title: rally-neutron-existing-users.yaml
description: >
The task contains various scenarios that do not require admin user
subtasks:
-
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:
title: Test main Cinder actions
workloads:
-
name: CinderVolumes.create_volume
args:
size: 1
runner:
type: "constant"
times: 2
concurrency: 2
sla:
failure_rate:
max: 0
-
name: CinderVolumes.create_volume
args:
size: 1
image:
name: {{image_name}}
runner:
type: "constant"
times: 1
concurrency: 1
sla:
failure_rate:
max: 0
-
name: CinderVolumes.create_snapshot_and_attach_volume
args:
volume_type: "lvmdriver-1"
size:
min: 1
max: 1
runner:
type: "constant"
times: 2
concurrency: 2
context:
servers:
image:
name: {{image_name}}
flavor:
name: {{flavor_name}}
servers_per_tenant: 1
sla:
failure_rate:
max: 0
-
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:
title: Test main Nova actions
workloads:
-
name: NovaServers.boot_and_list_server
args:
flavor:
name: {{flavor_name}}
image:
name: {{image_name}}
detailed: True
runner:
type: "constant"
times: 2
concurrency: 2
sla:
failure_rate:
max: 0
-
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:
title: Test main Glance actions
workloads:
-
name: GlanceImages.create_and_delete_image
args:
image_location: "{{ cirros_image_url }}"
container_format: "bare"
disk_format: "qcow2"
runner:
type: "constant"
times: 1
concurrency: 1
sla:
failure_rate:
max: 0
-
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
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_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_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
NovaServers.boot_and_delete_server:
-
args:
flavor:
name: "m1.tiny"
image:
name: {{image_name}}
runner:
type: "constant"
times: 1
concurrency: 1
sla:
failure_rate:
max: 0
-
args:
auto_assign_nic: True
flavor:
name: "m1.tiny"
image:
name: {{image_name}}
runner:
type: "constant"
times: 1
concurrency: 1
context:
network:
start_cidr: "10.2.0.0/24"
networks_per_tenant: 2
sla:
failure_rate:
max: 0
VMTasks.boot_runcommand_delete:
-
args:
flavor:
name: "m1.tiny"
image:
name: {{image_name}}
command:
script_file: "~/.rally/extra/instance_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
-
args:
flavor:
name: "m1.tiny"
image:
name: {{image_name}}
command:
script_file: "~/.rally/extra/instance_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
-
args:
command:
remote_path: "./dd_test.sh"
flavor:
name: "m1.tiny"
username: "cirros"
runner:
type: "constant"
times: 1
concurrency: 1
context:
image_command_customizer:
command:
local_path: "/home/jenkins/.rally/extra/install_benchmark.sh"
remote_path: "./install_benchmark.sh"
flavor:
name: "m1.tiny"
image:
name: {{image_name}}
username: "cirros"
network: {}
VMTasks.dd_load_test:
-
args:
flavor:
name: "m1.tiny"
image:
name: {{image_name}}
floating_network: "public"
force_delete: false
command:
interpreter: "/bin/sh"
username: "cirros"
runner:
type: "constant"
times: 2
concurrency: 2
context:
users:
tenants: 3
users_per_tenant: 2
network: {}
title: Test main Neutron actions
workloads:
-
name: NeutronNetworks.create_and_list_networks
args:
network_create_args:
runner:
type: "constant"
times: 2
concurrency: 2
sla:
failure_rate:
max: 0
-
name: NeutronNetworks.create_and_list_subnets
args:
subnet_cidr_start: "1.1.0.0/30"
subnets_per_network: 2
runner:
type: "constant"
times: 2
concurrency: 2
sla:
failure_rate:
max: 0
-
name: NeutronNetworks.create_and_list_floating_ips
args:
floating_network: "public"
floating_ip_args: {}
runner:
type: "constant"
times: 2
concurrency: 2
sla:
failure_rate:
max: 0

View File

@ -22,8 +22,7 @@ from rally.plugins.openstack.scenarios.vm import utils as vm_utils
import rally.task.context as context
@validation.add("required_platform", platform="openstack", admin=True,
users=True)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="image_command_customizer", order=501)
class ImageCommandCustomizerContext(custom_image.BaseCustomImageGenerator):
"""Context class for generating image customized by a command execution.

View File

@ -511,8 +511,8 @@ def main():
if args.credentials:
config = json.load(args.credentials)
else:
out = subprocess.check_output(["rally", "deployment",
"config"])
out = subprocess.check_output(["rally", "deployment", "config",
"--deployment", "devstack"])
config = json.loads(out if six.PY2 else out.decode("utf-8"))
config = config["creds"]["openstack"]
config.update(config.pop("admin"))

View File

@ -71,24 +71,30 @@ function setUp () {
DEPLOYMENT_CONFIG_FILE=~/.rally/with-existing-users-config
rally deployment config > $DEPLOYMENT_CONFIG_FILE
sed -i '3a "users": [\
{\
"username": "rally-test-user-1",\
"password": "rally-test-password-1",\
"project_name": "rally-test-project-1",\
"user_domain_name": "Default",\
"project_domain_name": "Default"\
},\
{\
"username": "rally-test-user-2",\
"password": "rally-test-password-2",\
"project_name": "rally-test-project-2",\
"user_domain_name": "Default",\
"project_domain_name": "Default"\
}\
],\
' $DEPLOYMENT_CONFIG_FILE
echo '
{
"type": "ExistingCloud",
"creds": {
"openstack": {
"users": [
{"username": "rally-test-user-1",
"password": "rally-test-password-1",
"project_name": "rally-test-project-1",
"user_domain_name": "Default",
"project_domain_name": "Default"
},
{"username": "rally-test-user-2",
"password": "rally-test-password-2",
"project_name": "rally-test-project-2",
"user_domain_name": "Default",
"project_domain_name": "Default"
}],
"auth_url": "'$OS_AUTH_URL'",
"region_name": "RegionOne"
}
}
}
' > $DEPLOYMENT_CONFIG_FILE
rally deployment create --name devstask-with-users --filename $DEPLOYMENT_CONFIG_FILE
fi

View File

@ -1862,6 +1862,7 @@ class FakeTask(dict, object):
def __init__(self, task=None, temporary=False, **kwargs):
self.is_temporary = temporary
self.update_status = mock.Mock()
self.set_failed = mock.Mock()
self.set_validation_failed = mock.Mock()
task = task or {}

View File

@ -22,6 +22,7 @@ from rally import api
from rally.common.plugin import discover
from rally.common import yamlutils as yaml
from rally.task import engine
from tests.unit import fakes
from tests.unit import test
@ -60,9 +61,9 @@ class RallyJobsTestCase(test.TestCase):
task = task_inst.render_template(
task_template=task_file.read(), **args)
task = yaml.safe_load(task)
task_obj = fakes.FakeTask({"uuid": full_path})
eng = engine.TaskEngine(task, mock.MagicMock(),
mock.Mock())
eng = engine.TaskEngine(task, task_obj, mock.Mock())
eng.validate(only_syntax=True)
except Exception:
print(traceback.format_exc())