blob: 6af6189290b8cdeaebbab30f3e9ad56954a8d8b8 [file] [log] [blame]
Rahul Maheshwariad676bf2017-06-22 15:06:05 -05001*** Settings ***
2Documentation This module provides general keywords for dump.
3
4
5*** Variables ***
6
7*** Keywords ***
8
9Create User Initiated Dump
10 [Documentation] Generate user initiated dump and return
11 ... dump id (e.g 1, 2 etc).
12
13 ${data}= Create Dictionary data=@{EMPTY}
14 ${resp}= OpenBMC Post Request
15 ... ${DUMP_URI}/action/CreateDump data=${data}
16
17 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
18 ${json}= To JSON ${resp.content}
19 ${dump_id}= Set Variable ${json["data"]}
20
Rahul Maheshwarie2cd17f2017-09-26 21:26:50 -050021 Wait Until Keyword Succeeds 3 min 15 sec Check Dump Existence
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050022 ... ${dump_id}
23
24 [Return] ${dump_id}
25
26
27Check Dump Existence
28 [Documentation] Verify if given dump exist.
29 [Arguments] ${dump_id}
30
31 # Description of Argument(s):
32 # dump_id An integer value that identifies a particular dump
33 # object(e.g. 1, 3, 5).
34
35 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}/${dump_id}
36 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
37
38
39Delete BMC Dump
40 [Documentation] Deletes a given bmc dump.
41 [Arguments] ${dump_id}
42
43 # Description of Argument(s):
44 # dump_id An interger value that identifies a particular dump (e.g. 1, 3).
45
46 ${data}= Create Dictionary data=@{EMPTY}
47 ${resp}= OpenBMC Post Request
48 ... ${DUMP_ENTRY_URI}/${dump_id}/action/Delete data=${data}
49
50 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
51
52Delete All Dumps
53 [Documentation] Delete all dumps.
54
55 # Check if dump entries exist, if not return.
George Keishing6a6e76d2017-09-14 08:19:17 -050056 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list quiet=${1}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050057 Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND}
58
59 # Get the list of dump entries and delete them all.
60 ${dump_entries}= Get URL List ${DUMP_ENTRY_URI}
61 :FOR ${entry} IN @{dump_entries}
62 \ ${dump_id}= Fetch From Right ${entry} /
63 \ Delete BMC Dump ${dump_id}
George Keishingc9fcd092017-09-20 09:24:37 -050064
65
66Delete All BMC Dump
67 [Documentation] Delete all BMC dump entries using "DeleteAll" interface.
68
69 ${data}= Create Dictionary data=@{EMPTY}
70 ${resp}= Openbmc Post Request ${DUMP_URI}action/DeleteAll data=${data}
71 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}