+
    lj="                         ^ RI t ^ RIHt ^ RIt^ RIHt ^ RIHt ]P                  ! ]
4      t ! R R]] P                  R7      t]P                   ! R R	]4      4       tR# )
    N)log)misc)clientsc                      a  ] tR t^t o Rt]P                  R 4       t]P                  R 4       t]P                  R 4       t	R t
RtV tR# )TempestPluginzlProvide basic hooks for an external plugin

To provide tempest the necessary information to run the plugin.
c                    R# )zReturn the information necessary to load the tests in the plugin.

:return: a tuple with the first value being the test_dir and the second
         being the top_level
:rtype: tuple
N selfs   &[/Users/user/workspace/sujinbaek/cqa-test-app/flava-qa/cqa-cloud-api-test/configs/plugins.py
load_testsTempestPlugin.load_tests    s     	    c                    R# )a  Add additional configuration options to tempest.

This method will be run for the plugin during the register_opts()
function in tempest.config.

:param ConfigOpts conf: The conf object that can be used to register
    additional options on.

Example::

    # Config options are defined in a config.py module
    service_option = cfg.BoolOpt(
        "my_service",
        default=True,
        help="Whether or not my service is available")

    # Note: as long as the group is listed in get_opt_lists,
    # it will be possible to access its optins in the plugin code
    # via ("-" in the group name are replaces with "_"):
    #     CONF.my_service.<option_name>
    my_service_group = cfg.OptGroup(name="my-service",
                                    title="My service options")

    MyServiceGroup = [<list of options>]
    # (...) More groups and options...

    # Plugin is implemented in a plugin.py module
    from my_plugin import config as my_config

    def register_opts(self, conf):
        conf.register_opt(my_config.service_option,
                          group='service_available')
        conf.register_group(my_config.my_service_group)
        conf.register_opts(my_config.MyServiceGroup,
                           my_config.my_service_group)

        conf.register_group(my_config.my_service_feature_group)
        conf.register_opts(my_config.MyServiceFeaturesGroup,
                           my_config.my_service_feature_group)
Nr	   )r   confs   &&r   register_optsTempestPlugin.register_opts*   s    T 	r   c                    . # )a  Get a list of options for sample config generation

:return option_list: A list of tuples with the group name and options
                     in that group.
:rtype: list

Example::

    # Config options are defined in a config.py module
    service_option = cfg.BoolOpt(
        "my_service", default=True,
        help="Whether or not my service is available")

    my_service_group = cfg.OptGroup(name="my-service",
                                    title="My service options")
    my_service_features_group = cfg.OptGroup(
        name="my-service-features",
        title="My service available features")

    MyServiceGroup = [<list of options>]
    MyServiceFeaturesGroup = [<list of options>]

    # Plugin is implemented in a plugin.py module
    from my_plugin import config as my_config

    def get_opt_lists(self, conf):
        return [
            (my_service_group.name, MyServiceGroup),
            (my_service_features_group.name, MyServiceFeaturesGroup)
        ]
r	   r
   s   &r   get_opt_listsTempestPlugin.get_opt_listsV   s
    B 	r   c                    . # )aN  Get a list of the service clients for registration

If the plugin implements service clients for one or more APIs, it
may return their details by this method for automatic registration
in any ServiceClients object instantiated by tests.
The default implementation returns an empty list.

:returns: Each element of the list represents the service client for an
  API. Each dict must define all parameters required for the invocation
  of `service_clients.ServiceClients.register_service_client_module`.
:rtype: list of dictionaries

Example implementation with one service client::

    def get_service_clients(self):
        # Example implementation with one service client
        myservice_config = config.service_client_config('myservice')
        params = {
            'name': 'myservice',
            'service_version': 'myservice',
            'module_path': 'myservice_tempest_tests.services',
            'client_names': ['API1Client', 'API2Client'],
        }
        params.update(myservice_config)
        return [params]

Example implementation with two service clients::

    def get_service_clients(self):
        # Example implementation with two service clients
        foo1_config = config.service_client_config('foo')
        params_foo1 = {
            'name': 'foo_v1',
            'service_version': 'foo.v1',
            'module_path': 'bar_tempest_tests.services.foo.v1',
            'client_names': ['API1Client', 'API2Client'],
        }
        params_foo1.update(foo_config)
        foo2_config = config.service_client_config('foo')
        params_foo2 = {
            'name': 'foo_v2',
            'service_version': 'foo.v2',
            'module_path': 'bar_tempest_tests.services.foo.v2',
            'client_names': ['API1Client', 'API2Client'],
        }
        params_foo2.update(foo2_config)
        return [params_foo1, params_foo2]
r	   r
   s   &r   get_service_clients!TempestPlugin.get_service_clientsy   s
    b 	r   r	   N)__name__
__module____qualname____firstlineno____doc__abcabstractmethodr   r   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      sd     
 	  	) )V 	   D1 1r   r   )	metaclassc                   R   a  ] tR t^t o RtR t]R 4       tR tR t	R t
R tRtV tR	# )
TempestTestPluginManagerzTempest test plugin manager class

This class is used to manage the lifecycle of external tempest test
plugins. It provides functions for getting set
c                X    \         P                  ! R RRV P                  R7      V n        R# )ztempest.test_pluginsT)invoke_on_loadpropagate_map_exceptionson_load_failure_callbackN)	stevedoreExtensionManagerfailure_hookext_pluginsr
   s   &r   __init__!TempestTestPluginManager.__init__   s&    $55"4%)%)%6%68r   c                H    \         P                  R VP                  V4       Vh)zCould not load %r: %s)LOGerrorname)_eperrs   &&&r   r.   %TempestTestPluginManager.failure_hook   s    		)277C8	r   c                    / pV P                    FI  p\        P                  R VP                  4       VP                  P                  4       WP                  &   KK  	  V# )z%Loading tests from Tempest plugin: %s)r/   r3   infor5   objr   )r   load_tests_dictplugs   &  r   get_plugin_load_tests_tuple4TempestTestPluginManager.get_plugin_load_tests_tuple   sK    $$DHH<diiH)-)<)<)>OII& % r   c                   V P                    F?  p\        P                  R VP                  4        VP                  P                  V4       KA  	  R#   \         d%    \        P                  RTP                  4        Ks  i ; i)z:Register additional config options from Tempest plugin: %sz9Plugin %s raised an exception trying to run register_optsN)r/   r3   r;   r5   r<   r   	Exception	exception)r   r   r>   s   && r   register_plugin_opts-TempestTestPluginManager.register_plugin_opts   sj    $$DHH "#'99.:&&t,	 %
  : ./3yy::s   A+B Bc                    . pV P                    FX  pVP                  P                  4       p\        P	                  R VP
                  4       V'       g   KG  VP                  V4       KZ  	  V# )z?List additional config options registered by Tempest plugin: %s)r/   r<   r   r3   r;   r5   extend)r   plugin_optionsr>   opt_lists   &   r   get_plugin_options_list0TempestTestPluginManager.get_plugin_options_list   s^    $$Dxx--/HHH *+/996 x%%h/ % r   c                <   \         P                  ! 4       pV P                   FD  p VP                  P	                  4       pV'       d   VP                  VP                  V4       KD  KF  	  R#   \         d%    \        P                  R TP                  4        Kx  i ; i)z?Plugin %s raised an exception trying to run get_service_clientsN)
r   ClientsRegistryr/   r<   r   register_service_clientr5   rB   r3   rC   )r   registryr>   service_clientss   &   r   _register_service_clients2TempestTestPluginManager._register_service_clients   s    **,$$D@"&((">">"@"44		?4 # %  @ 459YY@@s   >A,,+BB)r/   N)r   r   r   r   r   r0   staticmethodr.   r?   rD   rJ   rQ   r!   r"   r#   s   @r   r'   r'      s>     8  :	
@ 
@r   r'   )r   oslo_logr   loggingr,   lib.common.utilsr   lib.servicesr   	getLoggerr   r3   objectABCMetar   	singletonr'   r	   r   r   <module>r\      s]     #  !  !PFckk Pf 8@v 8@ 8@r   