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 | |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 29 | Attach a device will subscribe default 3 types events into the server. |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 30 | You can use the following wget to check if any events subscriptions on the device. |
| 31 | |
| 32 | wget --no-check-certificate \ |
| 33 | -qO- https://RFSERVERIP:8888/redfish/v1/EventService/Subscriptions/ \ |
| 34 | | python -m json.tool |
| 35 | |
| 36 | You can also use "unsub:add:rm:alert" to unsubscribe all 3 types of event subscriptions on the device. |
| 37 | |
| 38 | And use "QUIT" to leave test. |
| 39 | |
| 40 | -------------------------------------------------------------------------------------- |
| 41 | Test items client cmd |
| 42 | -------------------------------------------------------------------------------------- |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 43 | register one device Example: |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 44 | |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 45 | Set IP 192.168.4.27 port 8888 freq 180 |
| 46 | attach 192.168.4.27:8888:180 |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 47 | -------------------------------------------------------------------------------------- |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 48 | register multiple devices Example: |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 49 | |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 50 | Set "IP 192.168.4.27 port 8888 freq 180" and "IP 192.168.4.26 port 8888 freq 120" |
| 51 | attach 192.168.4.27:8888:180 192.168.4.26:8888:120 |
| 52 | |
| 53 | -------------------------------------------------------------------------------------- |
| 54 | delete devices Example: |
| 55 | |
| 56 | Delete "IP 192.168.4.27" and "IP 192.168.3.34" |
| 57 | |
| 58 | delete 192.168.4.27:8888 192.168.4.26:8888 |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 59 | -------------------------------------------------------------------------------------- |
dileepbk | 86ef010 | 2019-11-13 00:08:33 +0000 | [diff] [blame] | 60 | Get Current List of Devices monitored showdevices |
| 61 | Return from server: 192.168.4.26:8888,192.168.4.27:8888 |
| 62 | -------------------------------------------------------------------------------------- |
Dinesh Belwalkar | b5db83f | 2019-10-24 17:27:58 +0000 | [diff] [blame] | 63 | UnSubscribe all events(ResourceAdded/ResourceRemoved/Alert) unsub:192.168.4.27:8888:add:rm:alert |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 64 | ======= |
| 65 | UnSubscribe all events(ResourceAdded/ResourceRemoved/Alert) unsub 192.168.4.27:8888:add:rm:alert |
| 66 | >>>>>>> SEBA-841 importer to parse all status from redfish server for data collection purpose / remove demotest binary |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 67 | -------------------------------------------------------------------------------------- |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 68 | Subscribe all events(ResourceAdded/ResourceRemoved/Alert) sub 192.168.4.27:8888:add:rm:alert |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 69 | -------------------------------------------------------------------------------------- |
| 70 | Subscribe and unsubscribe an event Example: |
| 71 | |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 72 | Subscribe ResourceAdded event sub 192.168.4.27:8888:add |
| 73 | Subscribe ResourceRemoved event sub 192.168.4.27:8888:rm |
| 74 | Subscribe Alert event sub 192.168.4.27:8888:alert |
| 75 | Unsubscribe ResourceAdded event unsub 192.168.4.27:8888:add |
| 76 | Unsubscribe ResourceRemoved event unsub 192.168.4.27:8888:rm |
| 77 | Unsubscribe Alert event unsub 192.168.4.27:8888:alert |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 78 | -------------------------------------------------------------------------------------- |
| 79 | Subscribe and unsubscribe multiple events, out of order Use the above commands to do test. |
| 80 | -------------------------------------------------------------------------------------- |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 81 | Subscribe an unsupported event sub 192.168.4.27:8888:update |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 82 | -------------------------------------------------------------------------------------- |
| 83 | Subscribe to an already subscribed event Example: |
| 84 | |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 85 | sub 192.168.4.27:8888:add |
| 86 | sub 192.168.4.27:8888:add |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 87 | -------------------------------------------------------------------------------------- |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 88 | Unsubscribe an unsupported event unsub 192.168.4.27:8888:update |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 89 | -------------------------------------------------------------------------------------- |
| 90 | Unsubscribe a supported but not-subscribed event Example: |
| 91 | |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 92 | unsub 192.168.4.27:8888:add:rm:alert |
| 93 | unsub 192.168.4.27:8888:add |
| 94 | unsub 192.168.4.27:8888:rm |
| 95 | unsub 192.168.4.27:8888:alert |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 96 | -------------------------------------------------------------------------------------- |
| 97 | Change polling interval Example: |
| 98 | |
| 99 | Set frequecny to 30 seconds |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 100 | period 192.168.4.27:8888:30 |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 101 | -------------------------------------------------------------------------------------- |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 102 | Show list of supported event showeventlist 192.168.4.27:8888 |
Dinesh Belwalkar | b5db83f | 2019-10-24 17:27:58 +0000 | [diff] [blame] | 103 | ----------------------------------------------------------------------------------------------- |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 104 | Show current events subscribed by device showdeviceeventlist 192.168.4.27:8888 |
Dinesh Belwalkar | b5db83f | 2019-10-24 17:27:58 +0000 | [diff] [blame] | 105 | ------------------------------------------------------------------------------------------------------------ |
mc | 20a4b5f | 2019-10-16 20:28:24 +0000 | [diff] [blame^] | 106 | Clear all current events subscribed by device cleardeviceeventlist 192.168.4.27:8888 |
Dinesh Belwalkar | b5db83f | 2019-10-24 17:27:58 +0000 | [diff] [blame] | 107 | ------------------------------------------------------------------------------------------------------------- |
nickhuang | 6b31f8f | 2019-09-26 02:02:14 +0000 | [diff] [blame] | 108 | * During and after each test, verify the list of events subscribed wget --no-check-certificate \ |
| 109 | -qO- https://192.168.4.27:8888/redfish/v1/EventService/Subscriptions/ \ |
| 110 | | python -m json.tool |
| 111 | -------------------------------------------------------------------------------------- |