Issue about REST API endpoint paths in openbmc-test-automation

George Keishing gkeishin at in.ibm.com
Thu Jul 9 20:01:32 AEST 2020





From:	Jayashree D <jayashree-d at hcl.com>
To:	"openbmc at lists.ozlabs.org" <openbmc at lists.ozlabs.org>
Cc:	"Velumani T-ERS,HCLTech" <velumanit at hcl.com>
Date:	09-07-2020 02:53 PM
Subject:	[EXTERNAL] Issue about REST API endpoint paths in
            openbmc-test-automation
Sent by:	"openbmc" <openbmc-bounces
            +gkeishin=in.ibm.com at lists.ozlabs.org>




Hi All,

I am trying to use the test automation for my platform (tiogapass), while
trying I met an issue in "Verify CPU Functional State" which fails because
it shows the list is empty for cpu in the given path.

         ${cpu_list}=  Get Endpoint Paths  ${HOST_INVENTORY_URI}system
cpu*
        Should Not Be Empty  ${cpu_list}

When I used curl command to verify the test, I am able to get the data from
the given path.

        [root at odc ~]# curl -k -H "X-Auth-Token: $token" https://$
{bmc}/xyz/openbmc_project/inventory/system/chassis/motherboard/
        {
          "data": [

"/xyz/openbmc_project/inventory/system/chassis/motherboard/CPU_1",

"/xyz/openbmc_project/inventory/system/chassis/motherboard/CPU_2"
              ],
          "message": "200 OK",
          "status": "ok"
        }

As per my validation, the endpoint path is mentioned as cpu* (lowercase
letters) but in my case the endpoint names are present in uppercase letters
such as CPU_1,CPU_2.
I am also facing this same issue for some other test cases. Can we have the
search for both CPU and cpu?
Is there any naming convention to be followed in REST api?


Thanks,
Regards,
Jayashree




::DISCLAIMER::
The contents of this e-mail and any attachment(s) are confidential and
intended for the named recipient(s) only. E-mail transmission is not
guaranteed to be secure or error-free as information could be intercepted,
corrupted, lost, destroyed, arrive late or incomplete, or may contain
viruses in transmission. The e mail and its contents (with or without
referred errors) shall therefore not attach any liability on the originator
or HCL or its affiliates. Views or opinions, if any, presented in this
email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and / or
publication of this message without the prior written consent of authorized
representative of HCL is strictly prohibited. If you have received this
email in error please delete it and notify the sender immediately. Before
opening any email and/or attachments, please check them for viruses and
other defects.
-----------------------------------------------------------

Thanks Jayashree for the input,

I have added a regex pattern directive to search both lower and upper case
end points.

 ${resp}=  Get Matches  ${list}  regexp=^.*[0-9a-z_].${endpoint}\[0-9a-z]*$

 To

 ${resp}=  Get Matches  ${list}  regexp=^.*[0-9a-z_].${endpoint}\[0-9a-z]*$
case_insensitive=${True}

 Commit:
https://gerrit.openbmc-project.xyz/#/c/openbmc/openbmc-test-automation/+/34519/





Take a look and see if that works for you.


Regards


George  Keishing





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20200709/ec594606/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20200709/ec594606/attachment.gif>


More information about the openbmc mailing list