nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame^] | 1 | // Copyright 2018 Open Networking Foundation |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | At the root of the device-management source tree |
| 16 | 1. cd demotest |
| 17 | make demotest |
| 18 | ./demotest |
| 19 | 2. Create another ssh session |
| 20 | cd ./demotest/cmd_cleint |
| 21 | make cmd_cl |
| 22 | ./cmd_cl |
| 23 | |
| 24 | then it will have "CMD to send:" prompt |
| 25 | You can use the following "client cmd" to test. |
| 26 | |
| 27 | Example: |
| 28 | |
| 29 | For the first time, you need to use "attach:ipaddress:port:vendorname:freq" to set the device's IP related info. |
| 30 | If successful, you will get "[ipaddress:port]CMD to send:" prompt to indicate what device you attached now. |
| 31 | This attach will subscribe default 3 types events into the server. |
| 32 | You can use the following wget to check if any events subscriptions on the device. |
| 33 | |
| 34 | wget --no-check-certificate \ |
| 35 | -qO- https://RFSERVERIP:8888/redfish/v1/EventService/Subscriptions/ \ |
| 36 | | python -m json.tool |
| 37 | |
| 38 | You can also use "unsub:add:rm:alert" to unsubscribe all 3 types of event subscriptions on the device. |
| 39 | |
| 40 | And use "QUIT" to leave test. |
| 41 | |
| 42 | -------------------------------------------------------------------------------------- |
| 43 | Test items client cmd |
| 44 | -------------------------------------------------------------------------------------- |
| 45 | set device info Example: |
| 46 | |
| 47 | Set IP 192.168.4.27 port 8888 vendor "edgecore" freq 180 |
| 48 | attach:192.168.4.27:8888:edgecore:180 |
| 49 | -------------------------------------------------------------------------------------- |
| 50 | set multi-deivies info Example: |
| 51 | |
| 52 | attach:192.168.4.27:8888:edgecore:180 |
| 53 | attach:192.168.3.34:8888:edgecore:180 |
| 54 | -------------------------------------------------------------------------------------- |
| 55 | UnSubscribe all events(ResourceAdded/ResourceRemoved/Alert) unsub:add:rm:alert |
| 56 | -------------------------------------------------------------------------------------- |
| 57 | Subscribe all events(ResourceAdded/ResourceRemoved/Alert) sub:add:rm:alert |
| 58 | -------------------------------------------------------------------------------------- |
| 59 | Subscribe and unsubscribe an event Example: |
| 60 | |
| 61 | Subscribe ResourceAdded event sub:add |
| 62 | Subscribe ResourceRemoved event sub:rm |
| 63 | Subscribe Alert event sub:alert |
| 64 | Unsubscribe ResourceAdded event unsub:add |
| 65 | Unsubscribe ResourceRemoved event unsub:rm |
| 66 | Unsubscribe Alert event unsub:alert |
| 67 | -------------------------------------------------------------------------------------- |
| 68 | Subscribe and unsubscribe multiple events, out of order Use the above commands to do test. |
| 69 | -------------------------------------------------------------------------------------- |
| 70 | Subscribe an unsupported event sub:update |
| 71 | -------------------------------------------------------------------------------------- |
| 72 | Subscribe to an already subscribed event Example: |
| 73 | |
| 74 | sub:add |
| 75 | sub:add |
| 76 | -------------------------------------------------------------------------------------- |
| 77 | Unsubscribe an unsupported event unsub:update |
| 78 | -------------------------------------------------------------------------------------- |
| 79 | Unsubscribe a supported but not-subscribed event Example: |
| 80 | |
| 81 | unsub:add:rm:alert |
| 82 | unsub:add |
| 83 | unsub:rm |
| 84 | unsub:alert |
| 85 | -------------------------------------------------------------------------------------- |
| 86 | Change polling interval Example: |
| 87 | |
| 88 | Set frequecny to 30 seconds |
| 89 | period:30 |
| 90 | -------------------------------------------------------------------------------------- |
| 91 | Show support event list showeventlist |
| 92 | -------------------------------------------------------------------------------------- |
| 93 | * During and after each test, verify the list of events subscribed wget --no-check-certificate \ |
| 94 | -qO- https://192.168.4.27:8888/redfish/v1/EventService/Subscriptions/ \ |
| 95 | | python -m json.tool |
| 96 | -------------------------------------------------------------------------------------- |