433f9db8bb76f1142547985ef1fda0af18fbeb9e
[validation.git] / tests / hardware / redfish / redfish.resource
1 ##############################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property.                             #
3 # Copyright (c) 2019 Nokia.                                                  #
4 #                                                                            #
5 # Licensed under the Apache License, Version 2.0 (the "License");            #
6 # you maynot use this file except in compliance with the License.            #
7 #                                                                            #
8 # You may obtain a copy of the License at                                    #
9 #       http://www.apache.org/licenses/LICENSE-2.0                           #
10 #                                                                            #
11 # Unless required by applicable law or agreed to in writing, software        #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
14 # See the License for the specific language governing permissions and        #
15 # limitations under the License.                                             #
16 ##############################################################################
17
18
19 *** Settings ***
20 Library             JSONLibrary
21 Library             OperatingSystem
22 Library             Process
23
24
25 *** Variables ***
26 ${REPORTDIR}        ${LOG_PATH}/${SUITE_NAME.replace(' ','_')}
27 ${REDFISHDIR}       ${TEMPDIR}/Redfish
28
29
30 *** Keywords ***
31 Update Config File
32     ${conf}=        Load JSON From File  ${REDFISHDIR}/framework_conf.json
33     ${conf}=        Update Value To Json  ${conf}  $.password  ${BMC_PASSWORD}
34     ${conf}=        Convert JSON To String  ${conf}
35     Create File     ${REDFISHDIR}/framework_conf.json  ${conf}
36
37 Run Suite Against Target Node
38     [Arguments]     ${ip}
39     ${result}=      Run Process  python  test_framework.py
40     ...                 --directory  ${REDFISHDIR}
41     ...                 --rhost  ${ip}
42     ...                 --user  ${BMC_USER}
43     ...                 --interpreter  python
44     ...                 --secure  Always
45     ...               cwd=${REDFISHDIR}
46     Copy Files      ${REDFISHDIR}/reports/output-*/results*.json  ${REPORTDIR}/${ip}
47     Copy Files      ${REDFISHDIR}/output-*/*.html  ${REPORTDIR}/${ip}
48     Should Be Equal As Integers  ${result.rc}  0
49     Should Not Contain  ${result.stderr}  FAILED${\n} (Failures=
50
51 Run Usecase Checkers Suite
52     FOR  ${ip}  IN  @{BMC_IP}
53         Copy Directory  /opt/akraino/Redfish-Test-Framework  ${REDFISHDIR}
54         Copy Directory  /opt/akraino/Redfish-Usecase-Checkers  ${REDFISHDIR}/Redfish-Usecase-Checkers
55         Create Directory  ${REDFISHDIR}/reports
56         Update Config File
57         Run Suite Against Target Node  ${ip}
58         Remove Directory    ${REDFISHDIR}  recursive=True
59     END