Finish work on renaming namespace to platform

CLI, Verifier, Docs and Tests are updated

Change-Id: I382bd1e1899b809743fad3250d66a036e7bac5f5
This commit is contained in:
Boris Pavlovic 2017-09-22 16:24:49 -07:00
parent 3f5c864d35
commit 3f8a49e873
8 changed files with 75 additions and 72 deletions

View File

@ -231,9 +231,9 @@ class PluginsReferenceDirective(rst.Directive):
if info["description"]:
section_obj.extend(utils.parse_text(info["description"]))
if info["namespace"]:
if info["platform"]:
section_obj.append(utils.paragraph(
"**Namespace**: %s" % info["namespace"]))
"**Platform**: %s" % info["platform"]))
if base_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;
- 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
other(in case of same namespace).
other(in case of same platform).
- Names of two or more plugins in different plugin base can conflict
Current list of plugin bases:

View File

@ -44,23 +44,25 @@ information about them:
$ rally plugin show create_meter_and_get_stats
--------------------------------------------------------------------------------
Create a meter and fetch its statistics.
--------------------------------------------------------------------------------
NAME
CeilometerStats.create_meter_and_get_stats
NAMESPACE
default
PLATFORM
openstack
MODULE
rally.plugins.openstack.scenarios.ceilometer.stats
DESCRIPTION
Meter is first created and then statistics is fetched for the same
using GET /v2/meters/(meter_name)/statistics.
PARAMETERS
+--------+------------------------------------------------+
+--------+-----------------------------------------------+
| name | description |
+--------+------------------------------------------------+
+--------+-----------------------------------------------+
| kwargs | contains optional arguments to create a meter |
| | |
+--------+------------------------------------------------+
+--------+-----------------------------------------------+
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
Multiple plugins found:
+-------------------------------------------------+-----------+-------------------------------------------------------+
| name | namespace | title |
+-------------------------------------------------+-----------+-------------------------------------------------------+
| NovaKeypair.boot_and_delete_server_with_keypair | default | Boot and delete server with keypair. |
| NovaKeypair.create_and_delete_keypair | default | Create a keypair with random name and delete keypair. |
| NovaKeypair.create_and_list_keypairs | default | Create a keypair with random name and list keypairs. |
+-------------------------------------------------+-----------+-------------------------------------------------------+
+-------------+-------------------------------------------------+-----------+-------------------------------------------------------+
| Plugin base | Name | Platform | Title |
+-------------+-------------------------------------------------+-----------+-------------------------------------------------------+
| Scenario | NovaKeypair.boot_and_delete_server_with_keypair | openstack | Boot and delete server with keypair. |
| Scenario | NovaKeypair.create_and_delete_keypair | openstack | Create a keypair with random name and delete keypair. |
| 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
----------------------
@ -87,29 +89,33 @@ This command can be used to list filtered by name list of plugins.
$ rally plugin list --name Keystone
+--------------------------------------------------+-----------+-----------------------------------------------------------------+
| name | namespace | title |
+--------------------------------------------------+-----------+-----------------------------------------------------------------+
| Authenticate.keystone | default | Check Keystone Client. |
| KeystoneBasic.add_and_remove_user_role | default | Create a user role add to a user and disassociate. |
| KeystoneBasic.create_add_and_list_user_roles | default | Create user role, add it and list user roles for given user. |
| KeystoneBasic.create_and_delete_ec2credential | default | Create and delete keystone ec2-credential. |
| KeystoneBasic.create_and_delete_role | default | Create a user role and delete it. |
| KeystoneBasic.create_and_delete_service | default | Create and delete service. |
| KeystoneBasic.create_and_list_ec2credentials | default | Create and List all keystone ec2-credentials. |
| KeystoneBasic.create_and_list_services | default | Create and list services. |
| KeystoneBasic.create_and_list_tenants | default | Create a keystone tenant with random name and list all tenants. |
| KeystoneBasic.create_and_list_users | default | Create a keystone user with random name and list all users. |
| KeystoneBasic.create_delete_user | default | Create a keystone user with random name and then delete it. |
| KeystoneBasic.create_tenant | default | Create a keystone tenant with random name. |
| KeystoneBasic.create_tenant_with_users | default | Create a keystone tenant and several users belonging to it. |
| KeystoneBasic.create_update_and_delete_tenant | default | Create, update and delete tenant. |
| KeystoneBasic.create_user | default | Create a keystone user with random name. |
| KeystoneBasic.create_user_set_enabled_and_delete | default | Create a keystone user, enable or disable it, and delete it. |
| KeystoneBasic.create_user_update_password | default | Create user and update password for that user. |
| KeystoneBasic.get_entities | default | Get instance of a tenant, user, role and service by id's. |
+--------------------------------------------------+-----------+-----------------------------------------------------------------+
+-------------+----------------------------------------------------+-----------+-----------------------------------------------------------------+
| Plugin base | Name | Platform | Title |
+-------------+----------------------------------------------------+-----------+-----------------------------------------------------------------+
| OSClient | keystone | openstack | Wrapper for KeystoneClient which hides OpenStack auth details. |
| Scenario | Authenticate.keystone | openstack | Check Keystone Client. |
| Scenario | KeystoneBasic.add_and_remove_user_role | openstack | Create a user role add to a user and disassociate. |
| Scenario | KeystoneBasic.authenticate_user_and_validate_token | openstack | Authenticate and validate a keystone token. |
| Scenario | KeystoneBasic.create_add_and_list_user_roles | openstack | Create user role, add it and list user roles for given user. |
| Scenario | KeystoneBasic.create_and_delete_ec2credential | openstack | Create and delete keystone ec2-credential. |
| Scenario | KeystoneBasic.create_and_delete_role | openstack | Create a user role and delete it. |
| Scenario | KeystoneBasic.create_and_delete_service | openstack | Create and delete service. |
| Scenario | KeystoneBasic.create_and_get_role | openstack | Create a user role and get it detailed information. |
| Scenario | KeystoneBasic.create_and_list_ec2credentials | openstack | Create and List all keystone ec2-credentials. |
| Scenario | KeystoneBasic.create_and_list_roles | openstack | Create a role, then list all roles. |
| Scenario | KeystoneBasic.create_and_list_services | openstack | Create and list services. |
| Scenario | KeystoneBasic.create_and_list_tenants | openstack | Create a keystone tenant with random name and list all tenants. |
| Scenario | KeystoneBasic.create_and_list_users | openstack | Create a keystone user with random name and list all users. |
| Scenario | KeystoneBasic.create_and_update_user | openstack | Create user and update the user. |
| Scenario | KeystoneBasic.create_delete_user | openstack | Create a keystone user with random name and then delete it. |
| Scenario | KeystoneBasic.create_tenant | openstack | Create a keystone tenant with random name. |
| 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:
.. _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_show"]="--deployment"
OPTS["deployment_use"]="--deployment"
OPTS["plugin_list"]="--name --namespace --plugin-base"
OPTS["plugin_show"]="--name --namespace"
OPTS["plugin_list"]="--name --platform --plugin-base"
OPTS["plugin_show"]="--name --platform"
OPTS["task_abort"]="--uuid --soft"
OPTS["task_delete"]="--force --uuid"
OPTS["task_detailed"]="--uuid --iterations-data"
@ -50,13 +50,13 @@ _rally()
OPTS["task_validate"]="--deployment --task --task-args --task-args-file"
OPTS["verify_add-verifier-ext"]="--id --source --version --extra-settings"
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-verifier"]="--id --deployment-id --force"
OPTS["verify_delete-verifier-ext"]="--id --name"
OPTS["verify_import"]="--id --deployment-id --file --run-args --no-use"
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-tests"]="--id --pattern"
OPTS["verify_list-verifiers"]="--status"

View File

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

View File

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

View File

@ -20,14 +20,11 @@ from tests.functional import utils
class PluginTestCase(unittest.TestCase):
def setUp(self):
super(PluginTestCase, self).setUp()
def test_show_one(self):
rally = utils.Rally()
result = rally("plugin show Dummy.dummy")
self.assertIn("NAME", result)
self.assertIn("NAMESPACE", result)
self.assertIn("PLATFORM", result)
self.assertIn("Dummy.dummy", result)
self.assertIn("MODULE", result)
@ -43,18 +40,18 @@ class PluginTestCase(unittest.TestCase):
rally = utils.Rally()
name = "Dummy666666"
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()
name = "Dummy"
namespace = "non_existing"
platform = "non_existing"
result = rally(
"plugin show --name %(name)s --namespace %(namespace)s"
% {"name": name, "namespace": namespace})
"plugin show --name %(name)s --platform %(platform)s"
% {"name": name, "platform": platform})
self.assertIn(
"There is no plugin: %(name)s in %(namespace)s namespace"
% {"name": name, "namespace": namespace},
"Plugin %(name)s@%(platform)s not found"
% {"name": name, "platform": platform},
result)
def test_list(self):
@ -64,12 +61,12 @@ class PluginTestCase(unittest.TestCase):
self.assertIn("Dummy.dummy_exception", 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()
result = rally("plugin list --namespace some")
self.assertIn("There is no plugin namespace: some", result)
result = rally("plugin list --platform some")
self.assertIn("Platform some not found", result)
def test_list_not_found_name(self):
rally = utils.Rally()
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):
def __init__(self, **kwargs):
namespace = kwargs.pop("namespace", "openstack")
platform = kwargs.pop("platform", "openstack")
kwargs["credentials"] = {
namespace: [{"admin": kwargs.pop("admin", None),
platform: [{"admin": kwargs.pop("admin", None),
"users": kwargs.pop("users", [])}],
"default": [{"admin": None, "users": []}]}
dict.__init__(self, **kwargs)
@ -1854,8 +1854,8 @@ class FakeDeployment(dict):
def get_platforms(self):
return [platform for platform in self["credentials"]]
def get_credentials_for(self, namespace):
return self["credentials"][namespace][0]
def get_credentials_for(self, platform):
return self["credentials"][platform][0]
def verify_connections(self):
pass