diff --git a/rally/plugins/openstack/scenarios/nova/keypairs.py b/rally/plugins/openstack/scenarios/nova/keypairs.py index 47fd88b6..ab20a629 100644 --- a/rally/plugins/openstack/scenarios/nova/keypairs.py +++ b/rally/plugins/openstack/scenarios/nova/keypairs.py @@ -58,7 +58,7 @@ class NovaKeypair(utils.NovaScenario): @validation.required_openstack(users=True) @scenario.configure(context={"cleanup": ["nova"]}) def boot_and_delete_server_with_keypair(self, image, flavor, - server_kwargs=None, + boot_server_kwargs=None, **kwargs): """Boot and delete server with keypair. @@ -70,15 +70,16 @@ class NovaKeypair(utils.NovaScenario): :param image: ID of the image to be used for server creation :param flavor: ID of the flavor to be used for server creation - :param server_kwargs: Optional additional arguments for VM creation + :param boot_server_kwargs: Optional additional arguments for VM + creation :param kwargs: Optional additional arguments for keypair creation """ - server_kwargs = server_kwargs or {} + boot_server_kwargs = boot_server_kwargs or {} keypair = self._create_keypair(**kwargs) server = self._boot_server(image, flavor, key_name=keypair, - **server_kwargs) + **boot_server_kwargs) self._delete_server(server) self._delete_keypair(keypair) diff --git a/samples/tasks/scenarios/cinder/create-and-update-volume.json b/samples/tasks/scenarios/cinder/create-and-update-volume.json index 215ec44e..50e49ac7 100644 --- a/samples/tasks/scenarios/cinder/create-and-update-volume.json +++ b/samples/tasks/scenarios/cinder/create-and-update-volume.json @@ -2,6 +2,7 @@ "CinderVolumes.create_and_update_volume": [ { "args": { + "create_volume_kwargs": {}, "update_volume_kwargs": { "display_name": "name_updated", "display_description": "desc_updated" diff --git a/samples/tasks/scenarios/cinder/create-and-update-volume.yaml b/samples/tasks/scenarios/cinder/create-and-update-volume.yaml index bce928f1..05867c78 100644 --- a/samples/tasks/scenarios/cinder/create-and-update-volume.yaml +++ b/samples/tasks/scenarios/cinder/create-and-update-volume.yaml @@ -5,6 +5,7 @@ update_volume_kwargs: display_name: "name_updated" display_description: "desc_updated" + create_volume_kwargs: {} size: 1 runner: type: "constant" diff --git a/samples/tasks/scenarios/nova/boot-and-delete-server-with-keypairs.json b/samples/tasks/scenarios/nova/boot-and-delete-server-with-keypairs.json index 097144cc..b6e9dc9b 100644 --- a/samples/tasks/scenarios/nova/boot-and-delete-server-with-keypairs.json +++ b/samples/tasks/scenarios/nova/boot-and-delete-server-with-keypairs.json @@ -8,7 +8,8 @@ }, "image": { "name": "^cirros.*uec$" - } + }, + "boot_server_kwargs": {} }, "runner": { "type": "constant", diff --git a/samples/tasks/scenarios/nova/boot-and-delete-server-with-keypairs.yaml b/samples/tasks/scenarios/nova/boot-and-delete-server-with-keypairs.yaml index 3cfa388f..f28be813 100644 --- a/samples/tasks/scenarios/nova/boot-and-delete-server-with-keypairs.yaml +++ b/samples/tasks/scenarios/nova/boot-and-delete-server-with-keypairs.yaml @@ -7,6 +7,7 @@ name: "{{flavor_name}}" image: name: "^cirros.*uec$" + boot_server_kwargs: {} runner: type: "constant" times: 5 diff --git a/samples/tasks/scenarios/nova/boot-server-attach-created-volume-and-live-migrate.json b/samples/tasks/scenarios/nova/boot-server-attach-created-volume-and-live-migrate.json index 62e34641..4b0aad88 100644 --- a/samples/tasks/scenarios/nova/boot-server-attach-created-volume-and-live-migrate.json +++ b/samples/tasks/scenarios/nova/boot-server-attach-created-volume-and-live-migrate.json @@ -10,7 +10,9 @@ }, "flavor": { "name": "{{flavor_name}}" - } + }, + "boot_server_kwargs": {}, + "create_volume_kwargs": {} }, "runner": { "type": "constant", diff --git a/samples/tasks/scenarios/nova/boot-server-attach-created-volume-and-live-migrate.yaml b/samples/tasks/scenarios/nova/boot-server-attach-created-volume-and-live-migrate.yaml index 3c8bc1da..42c9f99c 100644 --- a/samples/tasks/scenarios/nova/boot-server-attach-created-volume-and-live-migrate.yaml +++ b/samples/tasks/scenarios/nova/boot-server-attach-created-volume-and-live-migrate.yaml @@ -8,6 +8,8 @@ NovaServers.boot_server_attach_created_volume_and_live_migrate: name: "^cirros.*uec$" size: 10 block_migration: false + boot_server_kwargs: {} + create_volume_kwargs: {} runner: type: "constant" times: 5 diff --git a/tests/unit/plugins/openstack/scenarios/nova/test_keypairs.py b/tests/unit/plugins/openstack/scenarios/nova/test_keypairs.py index fe4c7464..9b6e2758 100644 --- a/tests/unit/plugins/openstack/scenarios/nova/test_keypairs.py +++ b/tests/unit/plugins/openstack/scenarios/nova/test_keypairs.py @@ -57,7 +57,7 @@ class NovaKeypairTestCase(test.ScenarioTestCase): } scenario.boot_and_delete_server_with_keypair( - "img", 1, server_kwargs=fake_server_args, + "img", 1, boot_server_kwargs=fake_server_args, fake_arg1="foo", fake_arg2="bar") scenario._create_keypair.assert_called_once_with(