opencomputeproject / HWMgmt-DeviceMgr-DeviceManager

Device Manager collects device data and notifications from each device, and make the data available on a predetermined output bus for consumers.
Apache License 2.0
23 stars 12 forks source link

Tasks invoked in .tc files send API request using wrong endpoint #19

Closed ehaligow closed 1 year ago

ehaligow commented 2 years ago

Tasks (in access_device_PATCH_method.tc) send requests to the following URL:”/redfish/v1/AccountService/Accounts/admin_1” for newly user while there is no such endpoint - “/redfish/v1/AccountService/Accounts/4” is assigned to user 'admin_1' in BMC simulator.

./dm deviceaccess $1:$2:$admin_token:GET:/redfish/v1/AccountService/Accounts/admin_1:"" ./dm deviceaccess $1:$2:$admin_token:PATCH:/redfish/v1/AccountService/Accounts/admin_1:1penBmc ./dm deviceaccess $1:$2:$admin_token:GET:/redfish/v1/AccountService/Accounts/admin_1:""

intel@ubuntu:~/IdeaProjects/HWMgmt-DeviceMgr-DeviceManager$ curl -k -u 'admin:admin' https://bmcsim:8888/redfish/v1/AccountService/Accounts/4  | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   603  100   603    0     0  23192      0 --:--:-- --:--:-- --:--:-- 23192
{
  "@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount",
  "@odata.id": "/redfish/v1/AccountService/Accounts/4",
  "@odata.type": "#ManagerAccount.v1_6_2.ManagerAccount",
  "Id": "4",
  "Description": "Manager Account Description",
  "Name": "Manager Account",
  "Password": "0penBmc",
  "UserName": "admin_1",
  "RoleId": "Administrator",
  "Locked": false,
  "Enabled": true,
  "Certificates": {
    "@odata.id": "/redfish/v1/AccountService/Accounts/4/Certificates"
  },
  "PasswordChangeRequired": null,
  "SNMP": null,
  "AccountTypes": [],
  "OEMAccountTypes": [],
  "PasswordExpiration": null,
  "Links": {
    "Oem": {},
    "Role": null
  },
  "Actions": {
    "Oem": {}
  },
  "Oem": {}
}
JasonscHuang commented 2 years ago

The "/redfish/v1/AccountService/Accounts/admin_1" has included the ID (admin_1) to identify which user name could find the account data. The "/redfish/v1/AccountService/Accounts/4" has included the ID (4) to find the account data as well. This "tests" folder just offers the test cases of examples for some devices and shows those commands how to use it. If you want to change it to match the ID and to get account data, we need to modify it.

JasonscHuang commented 2 years ago

Ths tc file is just to test functionality depends on what is kind of Redfish software. It is just reference test case. You could modify it for your BCM simulator. I could not use a single test case to fit any kind of Redfish software.

jcleung5549 commented 2 years ago

John will ask the Redfish Forum regarding which value should be used.

jcleung5549 commented 2 years ago

@JasonscHuang With Taskin no longer at Edgecore, Maciej needs a direct channel to you, instead of via Github issues. Please contact either of us via email. Thanks,

JasonscHuang commented 2 years ago

@jcleung5549 I am not a contact window. You could post your question to this repository. I could reply to you ASAP.

MaciejMis commented 1 year ago

This was fixed with #52