On Wed, Mar 26, 2014 at 4:08 PM, Thomas Thrainer <[email protected]>wrote:

>
>
>
> On Wed, Mar 26, 2014 at 2:25 PM, Hrvoje Ribicic <[email protected]> wrote:
>
>> This patch allows users to specify specific parameter aliases enabled
>> by RAPI, and test whether their value can be retrieved and set.
>>
>> Signed-off-by: Hrvoje Ribicic <[email protected]>
>> ---
>>  qa/qa_rapi.py | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/qa/qa_rapi.py b/qa/qa_rapi.py
>> index 383d5e6..8cdeee4 100644
>> --- a/qa/qa_rapi.py
>> +++ b/qa/qa_rapi.py
>> @@ -165,8 +165,8 @@ def _DoTests(uris):
>>
>>  # pylint: disable=W0212
>>  # Due to _SendRequest usage
>> -def _DoGetPutTests(get_uri, modify_uri, opcode_params,
>> modify_method="PUT",
>> -                   exceptions=None, set_exceptions=None):
>> +def _DoGetPutTests(get_uri, modify_uri, opcode_params,
>> rapi_only_aliases=None,
>> +                   modify_method="PUT", exceptions=None,
>> set_exceptions=None):
>>    """ Test if all params of an object can be retrieved, and set as well.
>>
>>    @type get_uri: string
>> @@ -179,6 +179,9 @@ def _DoGetPutTests(get_uri, modify_uri,
>> opcode_params, modify_method="PUT",
>>    @type opcode_params: list of tuple
>>    @param opcode_params: The parameters of the underlying opcode, used to
>>                          determine which parameters are actually present.
>> +  @type rapi_only_aliases: list of string or None
>> +  @param rapi_only_aliases: Aliases for parameters which differ from the
>> opcode,
>> +                            and become renamed only during.
>>
>
> ... during what?
>

Ack


>
>
>>    @type exceptions: list of string or None
>>    @param exceptions: The parameters which have not been exposed and
>> should not
>>                       be tested at all.
>> @@ -203,6 +206,10 @@ def _DoGetPutTests(get_uri, modify_uri,
>> opcode_params, modify_method="PUT",
>>    # First we see if all parameters of the opcode are returned through
>> RAPI
>>    params_of_interest = map(lambda x: x[0], opcode_params)
>>
>> +  # The RAPI-specific aliases are to be checked as well
>> +  if rapi_only_aliases is not None:
>> +    params_of_interest.extend(rapi_only_aliases)
>> +
>>    info = _rapi_client._SendRequest("GET", get_uri, None, {})
>>
>>    missing_params = filter(lambda x: x not in info and x not in
>> exceptions,
>> --
>> 1.9.1.423.g4596e3a
>>
>>
> Rest LGTM, thanks.
>
>
> --
> Thomas Thrainer | Software Engineer | [email protected] |
>
> Google Germany GmbH
> Dienerstr. 12
> 80331 München
>
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg
> Geschäftsführer: Graham Law, Christine Elizabeth Flores
>

Thanks for the review, interdiff:

diff --git a/qa/qa_rapi.py b/qa/qa_rapi.py
index 1170874..273f904 100644
--- a/qa/qa_rapi.py
+++ b/qa/qa_rapi.py
@@ -179,7 +179,7 @@ def _DoGetPutTests(get_uri, modify_uri, opcode_params,
rapi_only_aliases=None,
                         determine which parameters are actually present.
   @type rapi_only_aliases: list of string or None
   @param rapi_only_aliases: Aliases for parameters which differ from the
opcode,
-                            and become renamed only during.
+                            and become renamed before opcode submission.
   @type modify_method: string
   @param modify_method: The method to be used in the modification.
   @type exceptions: list of string or None

Reply via email to