blob: 4781181532a85bd6f86bf3f7be452758e7848a9e [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
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--------------------------------------------------------------------------------------
43Test items client cmd
44--------------------------------------------------------------------------------------
45set device info Example:
46
47Set IP 192.168.4.27 port 8888 vendor "edgecore" freq 180
48 attach:192.168.4.27:8888:edgecore:180
49--------------------------------------------------------------------------------------
dileepbk86ef0102019-11-13 00:08:33 +000050set multi-device info Example:
nickhuang6b31f8f2019-09-26 02:02:14 +000051
52 attach:192.168.4.27:8888:edgecore:180
53 attach:192.168.3.34:8888:edgecore:180
54--------------------------------------------------------------------------------------
dileepbk86ef0102019-11-13 00:08:33 +000055Get Current List of Devices monitored showdevices
56 Return from server: 192.168.4.26:8888,192.168.4.27:8888
57--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000058UnSubscribe all events(ResourceAdded/ResourceRemoved/Alert) unsub:192.168.4.27:8888:add:rm:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000059--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000060Subscribe all events(ResourceAdded/ResourceRemoved/Alert) sub:192.168.4.27:8888:add:rm:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000061--------------------------------------------------------------------------------------
62Subscribe and unsubscribe an event Example:
63
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000064Subscribe ResourceAdded event sub:192.168.4.27:8888:add
65Subscribe ResourceRemoved event sub:192.168.4.27:8888:rm
66Subscribe Alert event sub:192.168.4.27:8888:alert
67Unsubscribe ResourceAdded event unsub:192.168.4.27:8888:add
68Unsubscribe ResourceRemoved event unsub:192.168.4.27:8888:rm
69Unsubscribe Alert event unsub:192.168.4.27:8888:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000070--------------------------------------------------------------------------------------
71Subscribe and unsubscribe multiple events, out of order Use the above commands to do test.
72--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000073Subscribe an unsupported event sub:192.168.4.27:8888:update
nickhuang6b31f8f2019-09-26 02:02:14 +000074--------------------------------------------------------------------------------------
75Subscribe to an already subscribed event Example:
76
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000077 sub:192.168.4.27:8888:add
78 sub:192.168.4.27:8888:add
nickhuang6b31f8f2019-09-26 02:02:14 +000079--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000080Unsubscribe an unsupported event unsub:192.168.4.27:8888:update
nickhuang6b31f8f2019-09-26 02:02:14 +000081--------------------------------------------------------------------------------------
82Unsubscribe a supported but not-subscribed event Example:
83
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000084 unsub:192.168.4.27:8888:add:rm:alert
85 unsub:192.168.4.27:8888:add
86 unsub:192.168.4.27:8888:rm
87 unsub:192.168.4.27:8888:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000088--------------------------------------------------------------------------------------
89Change polling interval Example:
90
91Set frequecny to 30 seconds
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000092 period:192.168.4.27:8888:30
nickhuang6b31f8f2019-09-26 02:02:14 +000093--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000094Show support event list vendor showeventlist:edgecore
95-----------------------------------------------------------------------------------------------
96Show current events subscribed by device showdeviceeventlist:192.168.4.27:8888
97------------------------------------------------------------------------------------------------------------
98Clear all current events subscribed by device cleardeviceeventlist:192.168.4.27:8888
99-------------------------------------------------------------------------------------------------------------
nickhuang6b31f8f2019-09-26 02:02:14 +0000100* During and after each test, verify the list of events subscribed wget --no-check-certificate \
101 -qO- https://192.168.4.27:8888/redfish/v1/EventService/Subscriptions/ \
102 | python -m json.tool
103--------------------------------------------------------------------------------------