George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Remote logging test for rsyslog. |
| 3 | |
| 4 | # Program arguments: |
| 5 | # REMOTE_LOG_SERVER_HOST The host name or IP address of the remote |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 6 | # logging server. |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 7 | # REMOTE_LOG_SERVER_PORT The port number for the remote logging server. |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 8 | # REMOTE_USERNAME The username for the remote logging server. |
| 9 | # REMOTE_PASSWORD The password for the remote logging server. |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 10 | |
George Keishing | 76a5daf | 2018-09-14 06:00:01 -0500 | [diff] [blame] | 11 | Library String |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 12 | Resource ../lib/resource.txt |
| 13 | Resource ../lib/rest_client.robot |
| 14 | Resource ../lib/utils.robot |
| 15 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | 76a5daf | 2018-09-14 06:00:01 -0500 | [diff] [blame] | 16 | Resource ../lib/boot_utils.robot |
George Keishing | 9a0d480 | 2018-08-31 13:29:40 -0500 | [diff] [blame] | 17 | Library ../lib/gen_misc.py |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 18 | |
| 19 | Suite Setup Suite Setup Execution |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 20 | Test Setup Test Setup Execution |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 21 | Test Teardown FFDC On Test Case Fail |
| 22 | |
George Keishing | 2cec186 | 2018-09-03 12:59:25 -0500 | [diff] [blame] | 23 | *** Variables *** |
| 24 | |
George Keishing | c1ca5e9 | 2018-09-03 11:19:23 -0500 | [diff] [blame] | 25 | # Strings to check from journald. |
George Keishing | 13451ed | 2018-09-06 12:46:16 -0500 | [diff] [blame] | 26 | ${BMC_STOP_MSG} Stopping Phosphor IPMI BT DBus Bridge |
| 27 | ${BMC_START_MSG} Starting Flush Journal to Persistent Storage |
| 28 | ${BMC_BOOT_MSG} Startup finished in |
| 29 | ${BMC_SYSLOG_REGEX} dropbear|vrm-control.sh |
| 30 | ${RSYSLOG_REGEX} start|exiting on signal 15 |
| 31 | ${RSYSLOG_RETRY_REGEX} suspended, next retry |
George Keishing | c1ca5e9 | 2018-09-03 11:19:23 -0500 | [diff] [blame] | 32 | |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 33 | *** Test Cases *** |
| 34 | |
George Keishing | 13a64e6 | 2018-09-10 13:07:36 -0500 | [diff] [blame] | 35 | Verify REST Logging On BMC Journal When Disabled |
| 36 | [Documentation] Enable REST logging and verify from journald. |
George Keishing | b77a357 | 2018-09-13 23:26:28 -0500 | [diff] [blame] | 37 | [Tags] Verify_REST_Logging_On_BMC_Journal_When_Disabled |
George Keishing | 13a64e6 | 2018-09-10 13:07:36 -0500 | [diff] [blame] | 38 | |
| 39 | ${log_dict}= Create Dictionary data=${False} |
| 40 | Write Attribute ${BMC_LOGGING_URI}${/}rest_api_logs Enabled data=${log_dict} |
| 41 | ... verify=${True} expected_value=${False} |
| 42 | |
| 43 | Initialize OpenBMC |
| 44 | |
| 45 | ${bmc_journald} ${stderr} ${rc}= BMC Execute Command |
| 46 | ... journalctl --no-pager |
| 47 | |
| 48 | Should Not Contain ${bmc_journald} user:root POST http://127.0.0.1:8081/login json:None 200 OK |
| 49 | ... msg=${bmc_journald} contains unexpected REST entries. |
| 50 | |
| 51 | |
George Keishing | b77a357 | 2018-09-13 23:26:28 -0500 | [diff] [blame] | 52 | Verify REST Logging On BMC Journal When Enabled |
George Keishing | 13a64e6 | 2018-09-10 13:07:36 -0500 | [diff] [blame] | 53 | [Documentation] Enable REST logging and verify from journald. |
George Keishing | b77a357 | 2018-09-13 23:26:28 -0500 | [diff] [blame] | 54 | [Tags] Verify_REST_Logging_On_BMC_Journal_When_Enabled |
George Keishing | 13a64e6 | 2018-09-10 13:07:36 -0500 | [diff] [blame] | 55 | |
| 56 | ${log_dict}= Create Dictionary data=${True} |
| 57 | Write Attribute ${BMC_LOGGING_URI}${/}rest_api_logs Enabled data=${log_dict} |
| 58 | ... verify=${True} expected_value=${True} |
| 59 | |
| 60 | # Sep 10 14:34:35 witherspoon phosphor-gevent[1288]: 127.0.0.1 user:root POST http://127.0.0.1:8081/login json:None 200 OK |
| 61 | Initialize OpenBMC |
| 62 | |
| 63 | ${bmc_journald} ${stderr} ${rc}= BMC Execute Command |
| 64 | ... journalctl --no-pager |
| 65 | |
| 66 | Should Contain ${bmc_journald} user:root POST http://127.0.0.1:8081/login json:None 200 OK |
| 67 | ... msg=${bmc_journald} doesn't contains REST entries. |
| 68 | |
| 69 | |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 70 | Test Remote Logging REST Interface And Verify Config |
| 71 | [Documentation] Test remote logging interface and configuration. |
| 72 | [Tags] Test_Remote_Logging_REST_Interface_And_Verify_Config |
| 73 | |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 74 | Verify Rsyslog Config On BMC |
| 75 | |
| 76 | Configure Remote Logging Server remote_host=${EMPTY} remote_port=0 |
| 77 | Verify Rsyslog Config On BMC remote_host=remote-host remote_port=port |
| 78 | |
| 79 | |
George Keishing | 13451ed | 2018-09-06 12:46:16 -0500 | [diff] [blame] | 80 | Test Remote Logging Invalid Port Config And Verify BMC Journald |
| 81 | [Documentation] Test remote logging interface and configuration. |
| 82 | [Tags] Test_Remote_Logging_Invalid_Port_Config_And_Verify_BMC_Journald |
| 83 | |
| 84 | # Invalid port derived by (REMOTE_LOG_SERVER_PORT + 1) port config setting. |
| 85 | ${INVALID_PORT}= Evaluate ${REMOTE_LOG_SERVER_PORT} + ${1} |
| 86 | Configure Remote Logging Server |
| 87 | ... remote_host=${REMOTE_LOG_SERVER_HOST} remote_port=${INVALID_PORT} |
| 88 | |
| 89 | Sleep 3s |
| 90 | # Sep 14 05:47:09 wsbmc123 rsyslogd[1870]: action 'action 0' suspended, next retry is Fri Sep 14 05:47:39 2018 [v8.29.0 try http://www.rsyslog.com/e/2007 ] |
| 91 | ${bmc_journald} ${stderr} ${rc}= BMC Execute Command |
| 92 | ... journalctl -b --no-pager | egrep 'rsyslog.*${RSYSLOG_RETRY_REGEX}' |
| 93 | |
| 94 | Should Contain ${bmc_journald} ${RSYSLOG_RETRY_REGEX} |
| 95 | ... msg=${bmc_journald} doesn't contain rsyslog retry entries. |
| 96 | |
| 97 | |
George Keishing | c1ca5e9 | 2018-09-03 11:19:23 -0500 | [diff] [blame] | 98 | Verify Rsyslog Does Not Log On BMC |
| 99 | [Documentation] Check that rsyslog journald doesn't log on BMC. |
| 100 | [Tags] Verify_Rsyslog_Does_Not_Log_On_BMC |
| 101 | |
| 102 | # Expected filter rsyslog entries. |
| 103 | # Example: |
| 104 | # Sep 03 13:20:07 wsbmc123 rsyslogd[3356]: [origin software="rsyslogd" swVersion="8.29.0" x-pid="3356" x-info="http://www.rsyslog.com"] exiting on signal 15. |
| 105 | # Sep 03 13:20:18 wsbmc123 rsyslogd[3364]: [origin software="rsyslogd" swVersion="8.29.0" x-pid="3364" x-info="http://www.rsyslog.com"] start |
| 106 | ${bmc_journald} ${stderr} ${rc}= BMC Execute Command |
| 107 | ... journalctl -b --no-pager | egrep 'rsyslog' | egrep -Ev '${RSYSLOG_REGEX}' |
| 108 | ... ignore_err=${1} |
| 109 | |
| 110 | Should Be Empty ${bmc_journald} |
| 111 | ... msg=${bmc_journald} contains unexpected rsyslog entries. |
| 112 | |
| 113 | |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 114 | Verfiy BMC Journald Synced To Remote Logging Server |
| 115 | [Documentation] Check that BMC journald is sync to remote rsyslog. |
| 116 | [Tags] Verfiy_BMC_Journald_Synced_To_Remote_Logging_Server |
| 117 | |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 118 | # Restart BMC dump service and get the last entry of the journald. |
| 119 | # Example: |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 120 | # Sep 03 10:09:28 wsbmc123 systemd[1]: Started Phosphor Dump Manager. |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 121 | BMC Execute Command |
| 122 | ... systemctl restart xyz.openbmc_project.Dump.Manager.service |
| 123 | |
| 124 | ${bmc_journald} ${stderr} ${rc}= BMC Execute Command |
George Keishing | 82ea1d4 | 2018-09-11 13:45:36 -0500 | [diff] [blame] | 125 | ... journalctl --no-pager | grep 'Started Phosphor Dump Manager' |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 126 | |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 127 | # Sep 3 10:09:28 wsbmc123 systemd[1]: Started Phosphor Dump Manager. |
George Keishing | 82ea1d4 | 2018-09-11 13:45:36 -0500 | [diff] [blame] | 128 | ${cmd}= Catenate SEPARATOR= egrep '${bmc_hostname}.*Started Phosphor Dump Manager' /var/log/syslog |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 129 | ${remote_journald}= Remote Logging Server Execute Command command=${cmd} |
| 130 | |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 131 | # TODO: rsyslog configuration and time date template to match BMC journald. |
| 132 | # Compare the BMC journlad log. Example: |
| 133 | # systemd[1]: Started Phosphor Dump Manager. |
George Keishing | 82ea1d4 | 2018-09-11 13:45:36 -0500 | [diff] [blame] | 134 | Should Contain ${remote_journald} ${bmc_journald.split('${bmc_hostname}')[1][0]} |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 135 | ... msg= ${bmc_journald} doesn't match remote rsyslog:${remote_journald}. |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 136 | |
| 137 | |
George Keishing | 2cec186 | 2018-09-03 12:59:25 -0500 | [diff] [blame] | 138 | Verify Journald Post BMC Reset |
| 139 | [Documentation] Check that BMC journald is sync'ed to remote rsyslog after |
| 140 | ... BMC reset. |
| 141 | [Tags] Verify_Journald_Post_BMC_Reset |
| 142 | |
| 143 | ${hostname} ${stderr} ${rc}= BMC Execute Command hostname |
| 144 | OBMC Reboot (off) |
| 145 | |
| 146 | ${cmd}= Catenate grep ${hostname} /var/log/syslog | |
| 147 | ... egrep '${BMC_STOP_MSG}|${BMC_START_MSG}|${BMC_BOOT_MSG}' |
| 148 | ${remote_journald}= Remote Logging Server Execute Command command=${cmd} |
| 149 | |
| 150 | # 1. Last reboot message to verify. |
| 151 | Should Contain ${remote_journald} ${BMC_STOP_MSG} |
| 152 | ... msg=The remote journald doesn't contain the IPMI shutdown message: ${BMC_STOP_MSG}. |
| 153 | |
| 154 | # 2. Earliest booting message on journald. |
| 155 | Should Contain ${remote_journald} ${BMC_START_MSG} |
| 156 | ... msg=The remote journald doesn't contain the start message: ${BMC_START_MSG}. |
| 157 | |
| 158 | # 3. Unique boot to standby message. |
| 159 | # Startup finished in 9.961s (kernel) + 1min 59.039s (userspace) = 2min 9.000s |
| 160 | ${bmc_journald} ${stderr} ${rc}= BMC Execute Command |
| 161 | ... journalctl --no-pager | egrep '${BMC_BOOT_MSG}' | tail -1 |
| 162 | |
| 163 | Should Contain ${remote_journald} |
| 164 | ... ${bmc_journald.split('${hostname}')[1]} |
| 165 | ... msg=The remote journald doesn't contain the boot message: ${BMC_BOOT_MSG}. |
| 166 | |
| 167 | |
George Keishing | cc18f7c | 2018-09-03 09:40:11 -0500 | [diff] [blame] | 168 | Verify BMC Journald Contains No Credential Data |
George Keishing | cb3b9b6 | 2018-09-14 12:11:19 -0500 | [diff] [blame] | 169 | [Documentation] Check that BMC journald doesn't log any credential data. |
George Keishing | cc18f7c | 2018-09-03 09:40:11 -0500 | [diff] [blame] | 170 | [Tags] Verify_BMC_Journald_Contains_No_Credential_Data |
| 171 | |
| 172 | Open Connection And Log In |
| 173 | ${bmc_journald} ${stderr} ${rc}= BMC Execute Command |
| 174 | ... journalctl -o json-pretty | cat |
| 175 | |
| 176 | Should Not Contain Any ${bmc_journald} ${OPENBMC_PASSWORD} |
| 177 | ... msg=Journald logs BMC credentials/password ${OPENBMC_PASSWORD}. |
| 178 | |
| 179 | |
George Keishing | 9a0d480 | 2018-08-31 13:29:40 -0500 | [diff] [blame] | 180 | Audit BMC SSH Login And Remote Logging |
| 181 | [Documentation] Check that the SSH login to BMC is logged and synced to |
| 182 | ... remote logging server. |
| 183 | [Tags] Audit_BMC_SSH_Login_And_Remote_Logging |
| 184 | |
| 185 | ${test_host_name} ${test_host_ip}= Get Host Name IP |
| 186 | |
| 187 | # Aug 31 17:22:55 wsbmc123 systemd[1]: Started SSH Per-Connection Server (xx.xx.xx.xx:51292) |
| 188 | Open Connection And Log In |
George Keishing | 82ea1d4 | 2018-09-11 13:45:36 -0500 | [diff] [blame] | 189 | Sleep 3s |
George Keishing | 9a0d480 | 2018-08-31 13:29:40 -0500 | [diff] [blame] | 190 | ${login_footprint}= Catenate Started SSH Per-Connection Server.*${test_host_ip} |
| 191 | |
| 192 | ${bmc_journald} ${stderr} ${rc}= BMC Execute Command |
George Keishing | 13a64e6 | 2018-09-10 13:07:36 -0500 | [diff] [blame] | 193 | ... journalctl --no-pager | grep '${login_footprint}' | tail -1 |
George Keishing | 9a0d480 | 2018-08-31 13:29:40 -0500 | [diff] [blame] | 194 | |
George Keishing | 13a64e6 | 2018-09-10 13:07:36 -0500 | [diff] [blame] | 195 | ${cmd}= Catenate SEPARATOR= egrep '(${bmc_hostname}|${test_host_ip}).*${login_footprint}' /var/log/syslog |
George Keishing | 9a0d480 | 2018-08-31 13:29:40 -0500 | [diff] [blame] | 196 | |
| 197 | ${remote_journald}= Remote Logging Server Execute Command command=${cmd} |
| 198 | |
George Keishing | 82ea1d4 | 2018-09-11 13:45:36 -0500 | [diff] [blame] | 199 | Should Contain ${remote_journald} ${bmc_journald.split('${bmc_hostname}')[1][0]} |
George Keishing | 9a0d480 | 2018-08-31 13:29:40 -0500 | [diff] [blame] | 200 | ... msg=${remote_journald} don't contain ${bmc_journald} entry. |
| 201 | |
| 202 | |
George Keishing | 76a5daf | 2018-09-14 06:00:01 -0500 | [diff] [blame] | 203 | Boot Host And Verify Data Is Synced To Remote Server |
| 204 | [Documentation] Boot host and verify the power on sequence logs are synced |
| 205 | ... to remote logging server. |
| 206 | [Tags] Boot_Host_And_Verify_Data_Is_Synced_To_Remote_Server |
| 207 | |
| 208 | ${cmd}= Catenate SEPARATOR= --no-pager | egrep -Ev '${BMC_SYSLOG_REGEX}' |
| 209 | ... | awk -F': ' '{print $2}' |
| 210 | |
| 211 | # Example: Just get the message part of the syslog |
| 212 | # Started OpenPOWER OCC Active Disable. |
| 213 | Start Journal Log filter=${cmd} |
| 214 | |
| 215 | # Irrespective of the outcome, the journald should be synced. |
| 216 | Run Keyword And Ignore Error REST Power On |
| 217 | ${bmc_journald}= Stop Journal Log |
| 218 | |
| 219 | ${cmd}= Catenate SEPARATOR= egrep '${bmc_hostname}' /var/log/syslog |
| 220 | ${remote_journald}= Remote Logging Server Execute Command command=${cmd} |
| 221 | |
| 222 | @{lines}= Split To Lines ${bmc_journald} |
| 223 | :FOR ${line} IN @{lines} |
| 224 | \ Log To Console \n ${line} |
| 225 | \ Should Contain ${remote_journald} ${line} |
| 226 | ... mgs=${line} line doesn't contain in ${remote_journald}. |
| 227 | |
| 228 | |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 229 | *** Keywords *** |
| 230 | |
| 231 | Suite Setup Execution |
| 232 | [Documentation] Do the suite setup. |
| 233 | |
| 234 | Should Not Be Empty ${REMOTE_LOG_SERVER_HOST} |
| 235 | Should Not Be Empty ${REMOTE_LOG_SERVER_PORT} |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 236 | Should Not Be Empty ${REMOTE_USERNAME} |
| 237 | Should Not Be Empty ${REMOTE_PASSWORD} |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 238 | Ping Host ${REMOTE_LOG_SERVER_HOST} |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 239 | Remote Logging Server Execute Command true |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 240 | Remote Logging Interface Should Exist |
| 241 | |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 242 | ${hostname} ${stderr} ${rc}= BMC Execute Command /bin/hostname |
| 243 | Set Suite Variable ${bmc_hostname} ${hostname} |
George Keishing | 13a64e6 | 2018-09-10 13:07:36 -0500 | [diff] [blame] | 244 | Configure Remote Logging Server |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 245 | |
| 246 | |
| 247 | Test Setup Execution |
| 248 | [Documentation] Do the test setup. |
| 249 | |
George Keishing | b77a357 | 2018-09-13 23:26:28 -0500 | [diff] [blame] | 250 | # Retain only the past 1 second log: |
| 251 | BMC Execute Command journalctl --vacuum-time=1s |
George Keishing | 13a64e6 | 2018-09-10 13:07:36 -0500 | [diff] [blame] | 252 | |
| 253 | ${config_status}= Run Keyword And Return Status |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 254 | ... Get Remote Log Server Configured |
| 255 | |
| 256 | Run Keyword If ${config_status}==${FALSE} Configure Remote Logging Server |
| 257 | |
| 258 | ${ActiveState}= Get Service Attribute ActiveState rsyslog.service |
| 259 | Should Be Equal active ${ActiveState} |
| 260 | ... msg=rsyslog logging service not in active state. |
| 261 | |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 262 | |
| 263 | Remote Logging Interface Should Exist |
| 264 | [Documentation] Check that the remote logging URI exist. |
| 265 | |
| 266 | ${resp}= OpenBMC Get Request ${REMOTE_LOGGING_URI} |
| 267 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 268 | |
| 269 | |
| 270 | Configure Remote Logging Server |
| 271 | [Documentation] Configure the remote logging server on BMC. |
| 272 | [Arguments] ${remote_host}=${REMOTE_LOG_SERVER_HOST} |
| 273 | ... ${remote_port}=${REMOTE_LOG_SERVER_PORT} |
| 274 | |
| 275 | # Description of argument(s): |
| 276 | # remote_host The host name or IP address of the remote logging server |
| 277 | # (e.g. "xx.xx.xx.xx"). |
| 278 | # remote_port Remote ryslog server port number (e.g. "514"). |
| 279 | |
| 280 | # Example: |
| 281 | # https://xx.xx.xx.xx/xyz/openbmc_project/logging/config/remote |
| 282 | # Response code:200, Content:{ |
| 283 | # "data": { |
| 284 | # "Address": "xx.xx.xx.xx", |
| 285 | # "Port": 514 |
| 286 | # }, |
| 287 | # "message": "200 OK", |
| 288 | # "status": "ok" |
| 289 | # } |
| 290 | |
| 291 | ${host_dict}= Create Dictionary data=${remote_host} |
| 292 | Write Attribute ${REMOTE_LOGGING_URI} Address data=${host_dict} |
| 293 | ... verify=${TRUE} expected_value=${remote_host} |
| 294 | |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 295 | # TODO: From Dev to do bump up restart service time and bulk address and |
| 296 | # port update API. |
| 297 | # Reference: https://github.com/ibm-openbmc/dev/issues/59 |
| 298 | Sleep 10s |
| 299 | |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 300 | ${remote_port}= Convert To Integer ${remote_port} |
| 301 | ${port_dict}= Create Dictionary data=${remote_port} |
| 302 | Write Attribute ${REMOTE_LOGGING_URI} Port data=${port_dict} |
| 303 | ... verify=${TRUE} expected_value=${remote_port} |
| 304 | |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 305 | # TODO: From Dev to do bump up restart service time and bulk address and |
| 306 | # port update API. |
| 307 | # Reference: https://github.com/ibm-openbmc/dev/issues/59 |
| 308 | Sleep 10s |
| 309 | |
George Keishing | 6a514ef | 2018-08-27 05:19:19 -0500 | [diff] [blame] | 310 | |
| 311 | Verify Rsyslog Config On BMC |
| 312 | [Documentation] Check if the rsyslog configuration on BMC is correct. |
| 313 | [Arguments] ${remote_host}=${REMOTE_LOG_SERVER_HOST} |
| 314 | ... ${remote_port}=${REMOTE_LOG_SERVER_PORT} |
| 315 | |
| 316 | # Description of argument(s): |
| 317 | # remote_host The host name or IP address of the remote logging server |
| 318 | # (e.g. "xx.xx.xx.xx"). |
| 319 | # remote_port Remote ryslog server port number (e.g. "514"). |
| 320 | |
| 321 | # Example: |
| 322 | # Configured: |
| 323 | # *.* @@xx.xx.xx.xx:514root@wsbmc123 |
| 324 | # By default: |
| 325 | # #*.* @@remote-host:port |
| 326 | |
| 327 | ${ryslog_conf} ${stderr} ${rc}= BMC Execute Command |
| 328 | ... cat /etc/rsyslog.d/server.conf |
| 329 | |
| 330 | ${config}= Catenate @@${remote_host}:${remote_port} |
| 331 | |
| 332 | Should Contain ${ryslog_conf} ${config} |
| 333 | ... msg=${remote_host} and ${remote_port} are not configured. |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 334 | |
| 335 | |
| 336 | Remote Logging Server Execute Command |
| 337 | [Documentation] Login to remote logging server. |
| 338 | [Arguments] ${command} |
| 339 | ... ${remote_host}=${REMOTE_LOG_SERVER_HOST} |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 340 | ... ${username}=${REMOTE_USERNAME} |
| 341 | ... ${password}=${REMOTE_PASSWORD} |
| 342 | |
| 343 | # Description of argument(s): |
| 344 | # command Command line string. |
| 345 | # remote_host The host name or IP address of the remote logging server |
| 346 | # (e.g. "xx.xx.xx.xx"). |
| 347 | # username Remote rsyslog server user name. |
| 348 | # password Remote rsyslog server password. |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 349 | |
| 350 | ${remote_dict}= Create Dictionary host=${remote_host} |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 351 | Open Connection And Log In ${username} ${password} |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 352 | ... &{remote_dict} |
| 353 | ${stdout} ${stderr}= Execute Command ${command} return_stderr=True |
George Keishing | 13a64e6 | 2018-09-10 13:07:36 -0500 | [diff] [blame] | 354 | Should Be Empty ${stderr} |
George Keishing | 6713367 | 2018-08-31 10:23:15 -0500 | [diff] [blame] | 355 | [Return] ${stdout} |
| 356 | |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 357 | |
| 358 | Get Remote Log Server Configured |
| 359 | [Documentation] Check that remote logging server is not configured. |
| 360 | |
| 361 | ${address}= Read Attribute ${REMOTE_LOGGING_URI} Address |
| 362 | Should Not Be Equal ${address} ${REMOTE_LOG_SERVER_HOST} |
| 363 | |
| 364 | ${port_number}= Convert To Integer ${REMOTE_LOG_SERVER_PORT} |
| 365 | ${port}= Read Attribute ${REMOTE_LOGGING_URI} Port |
| 366 | Should Not Be Equal ${port} ${port_number} |