blob: ca0c09416e5e85c204ce8d68c3e84ab325c5417d [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--------------------------------------------------------------------------------------
50set multi-deivies info Example:
51
52 attach:192.168.4.27:8888:edgecore:180
53 attach:192.168.3.34:8888:edgecore:180
54--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000055UnSubscribe all events(ResourceAdded/ResourceRemoved/Alert) unsub:192.168.4.27:8888:add:rm:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000056--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000057Subscribe all events(ResourceAdded/ResourceRemoved/Alert) sub:192.168.4.27:8888:add:rm:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000058--------------------------------------------------------------------------------------
59Subscribe and unsubscribe an event Example:
60
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000061Subscribe ResourceAdded event sub:192.168.4.27:8888:add
62Subscribe ResourceRemoved event sub:192.168.4.27:8888:rm
63Subscribe Alert event sub:192.168.4.27:8888:alert
64Unsubscribe ResourceAdded event unsub:192.168.4.27:8888:add
65Unsubscribe ResourceRemoved event unsub:192.168.4.27:8888:rm
66Unsubscribe Alert event unsub:192.168.4.27:8888:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000067--------------------------------------------------------------------------------------
68Subscribe and unsubscribe multiple events, out of order Use the above commands to do test.
69--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000070Subscribe an unsupported event sub:192.168.4.27:8888:update
nickhuang6b31f8f2019-09-26 02:02:14 +000071--------------------------------------------------------------------------------------
72Subscribe to an already subscribed event Example:
73
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000074 sub:192.168.4.27:8888:add
75 sub:192.168.4.27:8888:add
nickhuang6b31f8f2019-09-26 02:02:14 +000076--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000077Unsubscribe an unsupported event unsub:192.168.4.27:8888:update
nickhuang6b31f8f2019-09-26 02:02:14 +000078--------------------------------------------------------------------------------------
79Unsubscribe a supported but not-subscribed event Example:
80
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000081 unsub:192.168.4.27:8888:add:rm:alert
82 unsub:192.168.4.27:8888:add
83 unsub:192.168.4.27:8888:rm
84 unsub:192.168.4.27:8888:alert
nickhuang6b31f8f2019-09-26 02:02:14 +000085--------------------------------------------------------------------------------------
86Change polling interval Example:
87
88Set frequecny to 30 seconds
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000089 period:192.168.4.27:8888:30
nickhuang6b31f8f2019-09-26 02:02:14 +000090--------------------------------------------------------------------------------------
Dinesh Belwalkarb5db83f2019-10-24 17:27:58 +000091Show support event list vendor showeventlist:edgecore
92-----------------------------------------------------------------------------------------------
93Show current events subscribed by device showdeviceeventlist:192.168.4.27:8888
94------------------------------------------------------------------------------------------------------------
95Clear all current events subscribed by device cleardeviceeventlist:192.168.4.27:8888
96-------------------------------------------------------------------------------------------------------------
nickhuang6b31f8f2019-09-26 02:02:14 +000097* During and after each test, verify the list of events subscribed wget --no-check-certificate \
98 -qO- https://192.168.4.27:8888/redfish/v1/EventService/Subscriptions/ \
99 | python -m json.tool
100--------------------------------------------------------------------------------------