Merge "Finish work on renaming namespace to platform"

This commit is contained in:
Jenkins 2017-10-13 13:39:22 +00:00 committed by Gerrit Code Review
commit b4818170d5
8 changed files with 75 additions and 72 deletions

View File

@ -231,9 +231,9 @@ class PluginsReferenceDirective(rst.Directive):
if info["description"]: if info["description"]:
section_obj.extend(utils.parse_text(info["description"])) section_obj.extend(utils.parse_text(info["description"]))
if info["namespace"]: if info["platform"]:
section_obj.append(utils.paragraph( section_obj.append(utils.paragraph(
"**Namespace**: %s" % info["namespace"])) "**Platform**: %s" % info["platform"]))
if base_name: if base_name:
ref_prefix = "%s-%s-" % (base_name, plugin_cls.get_name()) ref_prefix = "%s-%s-" % (base_name, plugin_cls.get_name())

View File

@ -126,7 +126,7 @@ Statements of plugin bases:
- Each plugin base is unique entity; - Each plugin base is unique entity;
- Names of plugin bases can't conflict with each other; - Names of plugin bases can't conflict with each other;
- Names of two or more plugins in one plugin base can't conflict with each - Names of two or more plugins in one plugin base can't conflict with each
other(in case of same namespace). other(in case of same platform).
- Names of two or more plugins in different plugin base can conflict - Names of two or more plugins in different plugin base can conflict
Current list of plugin bases: Current list of plugin bases:

View File

@ -44,23 +44,25 @@ information about them:
$ rally plugin show create_meter_and_get_stats $ rally plugin show create_meter_and_get_stats
--------------------------------------------------------------------------------
Create a meter and fetch its statistics.
--------------------------------------------------------------------------------
NAME NAME
CeilometerStats.create_meter_and_get_stats CeilometerStats.create_meter_and_get_stats
NAMESPACE PLATFORM
default openstack
MODULE MODULE
rally.plugins.openstack.scenarios.ceilometer.stats rally.plugins.openstack.scenarios.ceilometer.stats
DESCRIPTION DESCRIPTION
Meter is first created and then statistics is fetched for the same Meter is first created and then statistics is fetched for the same
using GET /v2/meters/(meter_name)/statistics. using GET /v2/meters/(meter_name)/statistics.
PARAMETERS PARAMETERS
+--------+------------------------------------------------+ +--------+-----------------------------------------------+
| name | description | | name | description |
+--------+------------------------------------------------+ +--------+-----------------------------------------------+
| kwargs | contains optional arguments to create a meter | | kwargs | contains optional arguments to create a meter |
| | | +--------+-----------------------------------------------+
+--------+------------------------------------------------+
In case if multiple plugins were found, all matched elements are listed: In case if multiple plugins were found, all matched elements are listed:
@ -69,14 +71,14 @@ In case if multiple plugins were found, all matched elements are listed:
$ rally plugin show NovaKeypair $ rally plugin show NovaKeypair
Multiple plugins found: Multiple plugins found:
+-------------------------------------------------+-----------+-------------------------------------------------------+ +-------------+-------------------------------------------------+-----------+-------------------------------------------------------+
| name | namespace | title | | Plugin base | Name | Platform | Title |
+-------------------------------------------------+-----------+-------------------------------------------------------+ +-------------+-------------------------------------------------+-----------+-------------------------------------------------------+
| NovaKeypair.boot_and_delete_server_with_keypair | default | Boot and delete server with keypair. | | Scenario | NovaKeypair.boot_and_delete_server_with_keypair | openstack | Boot and delete server with keypair. |
| NovaKeypair.create_and_delete_keypair | default | Create a keypair with random name and delete keypair. | | Scenario | NovaKeypair.create_and_delete_keypair | openstack | Create a keypair with random name and delete keypair. |
| NovaKeypair.create_and_list_keypairs | default | Create a keypair with random name and list keypairs. | | Scenario | NovaKeypair.create_and_get_keypair | openstack | Create a keypair and get the keypair details. |
+-------------------------------------------------+-----------+-------------------------------------------------------+ | Scenario | NovaKeypair.create_and_list_keypairs | openstack | Create a keypair with random name and list keypairs. |
+-------------+-------------------------------------------------+-----------+-------------------------------------------------------+
CLI: rally plugin list CLI: rally plugin list
---------------------- ----------------------
@ -87,29 +89,33 @@ This command can be used to list filtered by name list of plugins.
$ rally plugin list --name Keystone $ rally plugin list --name Keystone
+--------------------------------------------------+-----------+-----------------------------------------------------------------+ +-------------+----------------------------------------------------+-----------+-----------------------------------------------------------------+
| name | namespace | title | | Plugin base | Name | Platform | Title |
+--------------------------------------------------+-----------+-----------------------------------------------------------------+ +-------------+----------------------------------------------------+-----------+-----------------------------------------------------------------+
| Authenticate.keystone | default | Check Keystone Client. | | OSClient | keystone | openstack | Wrapper for KeystoneClient which hides OpenStack auth details. |
| KeystoneBasic.add_and_remove_user_role | default | Create a user role add to a user and disassociate. | | Scenario | Authenticate.keystone | openstack | Check Keystone Client. |
| KeystoneBasic.create_add_and_list_user_roles | default | Create user role, add it and list user roles for given user. | | Scenario | KeystoneBasic.add_and_remove_user_role | openstack | Create a user role add to a user and disassociate. |
| KeystoneBasic.create_and_delete_ec2credential | default | Create and delete keystone ec2-credential. | | Scenario | KeystoneBasic.authenticate_user_and_validate_token | openstack | Authenticate and validate a keystone token. |
| KeystoneBasic.create_and_delete_role | default | Create a user role and delete it. | | Scenario | KeystoneBasic.create_add_and_list_user_roles | openstack | Create user role, add it and list user roles for given user. |
| KeystoneBasic.create_and_delete_service | default | Create and delete service. | | Scenario | KeystoneBasic.create_and_delete_ec2credential | openstack | Create and delete keystone ec2-credential. |
| KeystoneBasic.create_and_list_ec2credentials | default | Create and List all keystone ec2-credentials. | | Scenario | KeystoneBasic.create_and_delete_role | openstack | Create a user role and delete it. |
| KeystoneBasic.create_and_list_services | default | Create and list services. | | Scenario | KeystoneBasic.create_and_delete_service | openstack | Create and delete service. |
| KeystoneBasic.create_and_list_tenants | default | Create a keystone tenant with random name and list all tenants. | | Scenario | KeystoneBasic.create_and_get_role | openstack | Create a user role and get it detailed information. |
| KeystoneBasic.create_and_list_users | default | Create a keystone user with random name and list all users. | | Scenario | KeystoneBasic.create_and_list_ec2credentials | openstack | Create and List all keystone ec2-credentials. |
| KeystoneBasic.create_delete_user | default | Create a keystone user with random name and then delete it. | | Scenario | KeystoneBasic.create_and_list_roles | openstack | Create a role, then list all roles. |
| KeystoneBasic.create_tenant | default | Create a keystone tenant with random name. | | Scenario | KeystoneBasic.create_and_list_services | openstack | Create and list services. |
| KeystoneBasic.create_tenant_with_users | default | Create a keystone tenant and several users belonging to it. | | Scenario | KeystoneBasic.create_and_list_tenants | openstack | Create a keystone tenant with random name and list all tenants. |
| KeystoneBasic.create_update_and_delete_tenant | default | Create, update and delete tenant. | | Scenario | KeystoneBasic.create_and_list_users | openstack | Create a keystone user with random name and list all users. |
| KeystoneBasic.create_user | default | Create a keystone user with random name. | | Scenario | KeystoneBasic.create_and_update_user | openstack | Create user and update the user. |
| KeystoneBasic.create_user_set_enabled_and_delete | default | Create a keystone user, enable or disable it, and delete it. | | Scenario | KeystoneBasic.create_delete_user | openstack | Create a keystone user with random name and then delete it. |
| KeystoneBasic.create_user_update_password | default | Create user and update password for that user. | | Scenario | KeystoneBasic.create_tenant | openstack | Create a keystone tenant with random name. |
| KeystoneBasic.get_entities | default | Get instance of a tenant, user, role and service by id's. | | Scenario | KeystoneBasic.create_tenant_with_users | openstack | Create a keystone tenant and several users belonging to it. |
+--------------------------------------------------+-----------+-----------------------------------------------------------------+ | Scenario | KeystoneBasic.create_update_and_delete_tenant | openstack | Create, update and delete tenant. |
| Scenario | KeystoneBasic.create_user | openstack | Create a keystone user with random name. |
| Scenario | KeystoneBasic.create_user_set_enabled_and_delete | openstack | Create a keystone user, enable or disable it, and delete it. |
| Scenario | KeystoneBasic.create_user_update_password | openstack | Create user and update password for that user. |
| Scenario | KeystoneBasic.get_entities | openstack | Get instance of a tenant, user, role and service by id's. |
+-------------+----------------------------------------------------+-----------+-----------------------------------------------------------------+
.. references: .. references:
.. _source code: https://github.com/openstack/rally/tree/master/rally/plugins/ .. _source code: https://github.com/openstack/rally/tree/master/rally/plugins/

View File

@ -31,8 +31,8 @@ _rally()
OPTS["deployment_recreate"]="--filename --deployment" OPTS["deployment_recreate"]="--filename --deployment"
OPTS["deployment_show"]="--deployment" OPTS["deployment_show"]="--deployment"
OPTS["deployment_use"]="--deployment" OPTS["deployment_use"]="--deployment"
OPTS["plugin_list"]="--name --namespace --plugin-base" OPTS["plugin_list"]="--name --platform --plugin-base"
OPTS["plugin_show"]="--name --namespace" OPTS["plugin_show"]="--name --platform"
OPTS["task_abort"]="--uuid --soft" OPTS["task_abort"]="--uuid --soft"
OPTS["task_delete"]="--force --uuid" OPTS["task_delete"]="--force --uuid"
OPTS["task_detailed"]="--uuid --iterations-data" OPTS["task_detailed"]="--uuid --iterations-data"
@ -50,13 +50,13 @@ _rally()
OPTS["task_validate"]="--deployment --task --task-args --task-args-file" OPTS["task_validate"]="--deployment --task --task-args --task-args-file"
OPTS["verify_add-verifier-ext"]="--id --source --version --extra-settings" OPTS["verify_add-verifier-ext"]="--id --source --version --extra-settings"
OPTS["verify_configure-verifier"]="--id --deployment-id --reconfigure --extend --override --show" OPTS["verify_configure-verifier"]="--id --deployment-id --reconfigure --extend --override --show"
OPTS["verify_create-verifier"]="--name --type --namespace --source --version --system-wide --extra-settings --no-use" OPTS["verify_create-verifier"]="--name --type --platform --source --version --system-wide --extra-settings --no-use"
OPTS["verify_delete"]="--uuid" OPTS["verify_delete"]="--uuid"
OPTS["verify_delete-verifier"]="--id --deployment-id --force" OPTS["verify_delete-verifier"]="--id --deployment-id --force"
OPTS["verify_delete-verifier-ext"]="--id --name" OPTS["verify_delete-verifier-ext"]="--id --name"
OPTS["verify_import"]="--id --deployment-id --file --run-args --no-use" OPTS["verify_import"]="--id --deployment-id --file --run-args --no-use"
OPTS["verify_list"]="--id --deployment-id --tag --status" OPTS["verify_list"]="--id --deployment-id --tag --status"
OPTS["verify_list-plugins"]="--namespace" OPTS["verify_list-plugins"]="--platform"
OPTS["verify_list-verifier-exts"]="--id" OPTS["verify_list-verifier-exts"]="--id"
OPTS["verify_list-verifier-tests"]="--id --pattern" OPTS["verify_list-verifier-tests"]="--id --pattern"
OPTS["verify_list-verifiers"]="--status" OPTS["verify_list-verifiers"]="--status"

View File

@ -31,7 +31,7 @@ AVAILABLE_SETS = (list(consts.TempestTestSets) +
list(consts.TempestScenarioTestSets)) list(consts.TempestScenarioTestSets))
@manager.configure(name="tempest", namespace="openstack", @manager.configure(name="tempest", platform="openstack",
default_repo="https://git.openstack.org/openstack/tempest", default_repo="https://git.openstack.org/openstack/tempest",
context={"tempest": {}, "testr": {}}) context={"tempest": {}, "testr": {}})
class TempestManager(testr.TestrLauncher): class TempestManager(testr.TestrLauncher):

View File

@ -96,11 +96,11 @@ class TestTaskSamples(unittest.TestCase):
original_get_credentials_for = deployment.get_credentials_for original_get_credentials_for = deployment.get_credentials_for
creds_cache = {} creds_cache = {}
def get_credentials_for(namespace): def get_credentials_for(platform):
if namespace not in creds_cache: if platform not in creds_cache:
creds_cache[namespace] = original_get_credentials_for( creds_cache[platform] = original_get_credentials_for(
namespace) platform)
return creds_cache[namespace] return creds_cache[platform]
deployment.get_credentials_for = get_credentials_for deployment.get_credentials_for = get_credentials_for

View File

@ -20,14 +20,11 @@ from tests.functional import utils
class PluginTestCase(unittest.TestCase): class PluginTestCase(unittest.TestCase):
def setUp(self):
super(PluginTestCase, self).setUp()
def test_show_one(self): def test_show_one(self):
rally = utils.Rally() rally = utils.Rally()
result = rally("plugin show Dummy.dummy") result = rally("plugin show Dummy.dummy")
self.assertIn("NAME", result) self.assertIn("NAME", result)
self.assertIn("NAMESPACE", result) self.assertIn("PLATFORM", result)
self.assertIn("Dummy.dummy", result) self.assertIn("Dummy.dummy", result)
self.assertIn("MODULE", result) self.assertIn("MODULE", result)
@ -43,18 +40,18 @@ class PluginTestCase(unittest.TestCase):
rally = utils.Rally() rally = utils.Rally()
name = "Dummy666666" name = "Dummy666666"
result = rally("plugin show %s" % name) result = rally("plugin show %s" % name)
self.assertIn("There is no plugin: %s" % name, result) self.assertIn("Plugin %s not found" % name, result)
def test_show_not_found_in_specific_namespace(self): def test_show_not_found_in_specific_platform(self):
rally = utils.Rally() rally = utils.Rally()
name = "Dummy" name = "Dummy"
namespace = "non_existing" platform = "non_existing"
result = rally( result = rally(
"plugin show --name %(name)s --namespace %(namespace)s" "plugin show --name %(name)s --platform %(platform)s"
% {"name": name, "namespace": namespace}) % {"name": name, "platform": platform})
self.assertIn( self.assertIn(
"There is no plugin: %(name)s in %(namespace)s namespace" "Plugin %(name)s@%(platform)s not found"
% {"name": name, "namespace": namespace}, % {"name": name, "platform": platform},
result) result)
def test_list(self): def test_list(self):
@ -64,12 +61,12 @@ class PluginTestCase(unittest.TestCase):
self.assertIn("Dummy.dummy_exception", result) self.assertIn("Dummy.dummy_exception", result)
self.assertIn("Dummy.dummy_random_fail_in_atomic", result) self.assertIn("Dummy.dummy_random_fail_in_atomic", result)
def test_list_not_found_namespace(self): def test_list_not_found_platform(self):
rally = utils.Rally() rally = utils.Rally()
result = rally("plugin list --namespace some") result = rally("plugin list --platform some")
self.assertIn("There is no plugin namespace: some", result) self.assertIn("Platform some not found", result)
def test_list_not_found_name(self): def test_list_not_found_name(self):
rally = utils.Rally() rally = utils.Rally()
result = rally("plugin list Dummy2222") result = rally("plugin list Dummy2222")
self.assertIn("There is no plugin: Dummy2222", result) self.assertIn("Plugin Dummy2222 not found", result)

View File

@ -1843,9 +1843,9 @@ class FakeUserContext(FakeContext):
class FakeDeployment(dict): class FakeDeployment(dict):
def __init__(self, **kwargs): def __init__(self, **kwargs):
namespace = kwargs.pop("namespace", "openstack") platform = kwargs.pop("platform", "openstack")
kwargs["credentials"] = { kwargs["credentials"] = {
namespace: [{"admin": kwargs.pop("admin", None), platform: [{"admin": kwargs.pop("admin", None),
"users": kwargs.pop("users", [])}], "users": kwargs.pop("users", [])}],
"default": [{"admin": None, "users": []}]} "default": [{"admin": None, "users": []}]}
dict.__init__(self, **kwargs) dict.__init__(self, **kwargs)
@ -1854,8 +1854,8 @@ class FakeDeployment(dict):
def get_platforms(self): def get_platforms(self):
return [platform for platform in self["credentials"]] return [platform for platform in self["credentials"]]
def get_credentials_for(self, namespace): def get_credentials_for(self, platform):
return self["credentials"][namespace][0] return self["credentials"][platform][0]
def verify_connections(self): def verify_connections(self):
pass pass