blob: 1bbecf5f06e07b58dec585eb25c14f4caaa1373a [file] [log] [blame]
Jayashree-D39c66622020-08-14 12:22:24 +05301*** Settings ***
2Documentation This suite will test the host console
3
4Resource ../lib/resource.robot
5Resource ../lib/utils.robot
6
7Library SSHLibrary
8
9Suite Setup Open Connection And Log In
10Test Setup Test Setup Execution
11Suite Teardown Close All Connections
12
13*** Variables ***
14
15${HOST_LOG_PATH} /var/lib/obmc/hostlogs
16
17
18*** Test Cases ***
19
20Verify Host Console Connection
21 [Documentation] Connect the obmc-console from BMC and verify the logs.
22 [Tags] Verify_Host_Console_Connection
23
24 Write obmc-console-client
25 Write \n
26 ${write}= Read Until login:
27 Write ${OS_USERNAME}
28 ${pass}= Read Until Password:
29 Write ${OS_PASSWORD}
30 Write hostname
31 Write exit
32
33 BMC Execute Command rm -rf ${HOST_LOG_PATH}
34 ${id} ${stderr} ${rc}= BMC Execute Command ps | grep hostlogger | grep -v grep | cut -c2-5
35
36 # Flush the messages generated in buffer and store as a log file.
37 BMC Execute Command kill -s USR1 ${id}
38 Sleep 5s
39 ${gz_file} ${stderr} ${rc}= BMC Execute Command ls ${HOST_LOG_PATH}
40 BMC Execute Command gunzip ${HOST_LOG_PATH}/${gz_file}
41 Sleep 5s
42 ${log_file} ${stderr} ${rc}= BMC Execute Command ls ${HOST_LOG_PATH}
43 ${string_compare} = BMC Execute Command grep hostname ${HOST_LOG_PATH}/${log_file}
44 Should Be True ${string_compare} hostname
45
46
47*** Keywords ***
48
49Test Setup Execution
50 [Documentation] Do test case setup tasks.
51
52 Should Not Be Empty ${OS_USERNAME}
53 Should Not Be Empty ${OS_PASSWORD}