blob: b72578a77a3ef50ee3cf4970b9e0daedba3cc7b1 [file] [log] [blame]
nickhuang6b31f8f2019-09-26 02:02:14 +00001// 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
15At the root of the device-management source tree
161. cd demotest
17 make demotest
18 ./demotest
192. 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
mc20a4b5f2019-10-16 20:28:24 +000029 Attach a device will subscribe default 3 types events into the server.
nickhuang6b31f8f2019-09-26 02:02:14 +000030 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--------------------------------------------------------------------------------------
41Test items client cmd
42--------------------------------------------------------------------------------------
mc20a4b5f2019-10-16 20:28:24 +000043register one device Example:
nickhuang6b31f8f2019-09-26 02:02:14 +000044
mc20a4b5f2019-10-16 20:28:24 +000045Set IP 192.168.4.27 port 8888 freq 180
46 attach 192.168.4.27:8888:180
nickhuang6b31f8f2019-09-26 02:02:14 +000047--------------------------------------------------------------------------------------
mc20a4b5f2019-10-16 20:28:24 +000048register multiple devices Example:
nickhuang6b31f8f2019-09-26 02:02:14 +000049
mc20a4b5f2019-10-16 20:28:24 +000050Set "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--------------------------------------------------------------------------------------
54delete devices Example:
55
56Delete "IP 192.168.4.27" and "IP 192.168.3.34"
57
58 delete 192.168.4.27:8888 192.168.4.26:8888
nickhuang6b31f8f2019-09-26 02:02:14 +000059--------------------------------------------------------------------------------------
dileepbk86ef0102019-11-13 00:08:33 +000060Get Current List of Devices monitored showdevices
61 Return from server: 192.168.4.26:8888,192.168.4.27:8888
62--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000063UnSubscribe all events(ResourceAdded/ResourceRemoved/Alert) unsub:192.168.4.27:8888:add:rm:alert
mc20a4b5f2019-10-16 20:28:24 +000064=======
65UnSubscribe 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
nickhuang6b31f8f2019-09-26 02:02:14 +000067--------------------------------------------------------------------------------------
mc20a4b5f2019-10-16 20:28:24 +000068Subscribe all events(ResourceAdded/ResourceRemoved/Alert) sub 192.168.4.27:8888:add:rm:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000069--------------------------------------------------------------------------------------
70Subscribe and unsubscribe an event Example:
71
mc20a4b5f2019-10-16 20:28:24 +000072Subscribe ResourceAdded event sub 192.168.4.27:8888:add
73Subscribe ResourceRemoved event sub 192.168.4.27:8888:rm
74Subscribe Alert event sub 192.168.4.27:8888:alert
75Unsubscribe ResourceAdded event unsub 192.168.4.27:8888:add
76Unsubscribe ResourceRemoved event unsub 192.168.4.27:8888:rm
77Unsubscribe Alert event unsub 192.168.4.27:8888:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000078--------------------------------------------------------------------------------------
79Subscribe and unsubscribe multiple events, out of order Use the above commands to do test.
80--------------------------------------------------------------------------------------
mc20a4b5f2019-10-16 20:28:24 +000081Subscribe an unsupported event sub 192.168.4.27:8888:update
nickhuang6b31f8f2019-09-26 02:02:14 +000082--------------------------------------------------------------------------------------
83Subscribe to an already subscribed event Example:
84
mc20a4b5f2019-10-16 20:28:24 +000085 sub 192.168.4.27:8888:add
86 sub 192.168.4.27:8888:add
nickhuang6b31f8f2019-09-26 02:02:14 +000087--------------------------------------------------------------------------------------
mc20a4b5f2019-10-16 20:28:24 +000088Unsubscribe an unsupported event unsub 192.168.4.27:8888:update
nickhuang6b31f8f2019-09-26 02:02:14 +000089--------------------------------------------------------------------------------------
90Unsubscribe a supported but not-subscribed event Example:
91
mc20a4b5f2019-10-16 20:28:24 +000092 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
nickhuang6b31f8f2019-09-26 02:02:14 +000096--------------------------------------------------------------------------------------
97Change polling interval Example:
98
99Set frequecny to 30 seconds
mc20a4b5f2019-10-16 20:28:24 +0000100 period 192.168.4.27:8888:30
nickhuang6b31f8f2019-09-26 02:02:14 +0000101--------------------------------------------------------------------------------------
mc20a4b5f2019-10-16 20:28:24 +0000102Show list of supported event showeventlist 192.168.4.27:8888
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +0000103-----------------------------------------------------------------------------------------------
mc20a4b5f2019-10-16 20:28:24 +0000104Show current events subscribed by device showdeviceeventlist 192.168.4.27:8888
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +0000105------------------------------------------------------------------------------------------------------------
mc20a4b5f2019-10-16 20:28:24 +0000106Clear all current events subscribed by device cleardeviceeventlist 192.168.4.27:8888
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +0000107-------------------------------------------------------------------------------------------------------------
nickhuang6b31f8f2019-09-26 02:02:14 +0000108* 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--------------------------------------------------------------------------------------