blob: 2164b427544f14b411dd67c2dfcffb314242890e [file] [log] [blame]
George Keishing8b082fd2017-05-03 13:42:39 -05001*** Settings ***
2Documentation Stress the system using HTX exerciser.
3
4Resource ../syslib/utils_os.robot
George Keishingffbe8ce2017-05-04 12:08:54 -05005Library ../lib/gen_robot_print.py
6
7Test Setup Pre Test Case Execution
8Test Teardown Post Test Case Execution
George Keishing8b082fd2017-05-03 13:42:39 -05009
10*** Variables ****
11
George Keishingffbe8ce2017-05-04 12:08:54 -050012${stack_mode} skip
13
George Keishing8b082fd2017-05-03 13:42:39 -050014# Default duration and interval of HTX exerciser to run.
George Keishing1a23b692017-05-06 12:19:41 -050015${HTX_DURATION} 2 hours
16${HTX_INTERVAL} 15 min
George Keishing8b082fd2017-05-03 13:42:39 -050017
George Keishingffbe8ce2017-05-04 12:08:54 -050018# Default hardbootme loop times HTX exerciser to run.
George Keishing1a23b692017-05-06 12:19:41 -050019${HTX_LOOP} 4
20
21# User defined halt on error.
22${HTX_KEEP_RUNNING} ${0}
George Keishingffbe8ce2017-05-04 12:08:54 -050023
George Keishing8b082fd2017-05-03 13:42:39 -050024*** Test Cases ***
25
26Hard Bootme Test
27 [Documentation] Stress the system using HTX exerciser.
George Keishingffbe8ce2017-05-04 12:08:54 -050028 [Tags] Hard_Bootme_Test
George Keishing8b082fd2017-05-03 13:42:39 -050029
George Keishingffbe8ce2017-05-04 12:08:54 -050030 Rprintn
31 Rpvars HTX_DURATION HTX_INTERVAL
32
33 Repeat Keyword ${HTX_LOOP} times Start HTX Exerciser
34
35
36*** Keywords ***
37
38Start HTX Exerciser
39 [Documentation] Start HTX exerciser.
40 # Test Flow:
41 # - Power on
42 # - Establish SSH connection session
43 # - Create HTX mdt profile
44 # - Run HTX exerciser
45 # - Check HTX status for errors
46 # - Power off
47
48 Boot To OS
49
50 # Post Power off and on, the OS SSH session needs to be established.
George Keishing8b082fd2017-05-03 13:42:39 -050051 Login To OS
52
George Keishingffbe8ce2017-05-04 12:08:54 -050053 Rprint Timen Create HTX mdt profile.
George Keishing8b082fd2017-05-03 13:42:39 -050054 ${profile}= Execute Command On OS htxcmdline -createmdt
George Keishingffbe8ce2017-05-04 12:08:54 -050055 Rprint Timen ${profile}
George Keishing8b082fd2017-05-03 13:42:39 -050056 Should Contain ${profile} mdts are created successfully
57
George Keishingffbe8ce2017-05-04 12:08:54 -050058 Rprint Timen Start HTX mdt profile execution.
George Keishing8b082fd2017-05-03 13:42:39 -050059 ${htx_run}= Execute Command On OS htxcmdline -run -mdt mdt.bu
George Keishingffbe8ce2017-05-04 12:08:54 -050060 Rprint Timen ${htx_run}
George Keishing8b082fd2017-05-03 13:42:39 -050061 Should Contain ${htx_run} Activated
62
63 Loop HTX Health Check
64
George Keishingffbe8ce2017-05-04 12:08:54 -050065 Shutdown HTX Exerciser
66
67 Power Off Host
68
69 Rprint Timen HTX Test ran for: ${HTX_DURATION}
George Keishing8b082fd2017-05-03 13:42:39 -050070
71Loop HTX Health Check
George Keishingffbe8ce2017-05-04 12:08:54 -050072 [Documentation] Run until HTX exerciser fails.
73
George Keishing8b082fd2017-05-03 13:42:39 -050074 Repeat Keyword ${HTX_DURATION}
75 ... Run Keywords Check HTX Run Status
76 ... AND Sleep ${HTX_INTERVAL}
77
78
79Check HTX Run Status
80 [Documentation] Get HTX exerciser status and check for error.
81
George Keishingffbe8ce2017-05-04 12:08:54 -050082 Rprint Timen Check HTX mdt Status and error.
George Keishing8b082fd2017-05-03 13:42:39 -050083 ${status}= Execute Command On OS htxcmdline -status -mdt mdt.bu
84 Log ${status}
George Keishingffbe8ce2017-05-04 12:08:54 -050085 Rprint Timen ${status}
George Keishing8b082fd2017-05-03 13:42:39 -050086
87 ${errlog}= Execute Command On OS htxcmdline -geterrlog
88 Log ${errlog}
George Keishingffbe8ce2017-05-04 12:08:54 -050089 Rprint Timen ${errlog}
George Keishing8b082fd2017-05-03 13:42:39 -050090
91 Should Contain ${errlog} file </tmp/htxerr> is empty
92
93
94Shutdown HTX Exerciser
95 [Documentation] Shut down HTX exerciser run.
96
George Keishingffbe8ce2017-05-04 12:08:54 -050097 Rprint Timen Shutdown HTX Run
George Keishing8b082fd2017-05-03 13:42:39 -050098 ${shutdown}= Execute Command On OS htxcmdline -shutdown -mdt mdt.bu
George Keishingffbe8ce2017-05-04 12:08:54 -050099 Rprint Timen ${shutdown}
George Keishing8b082fd2017-05-03 13:42:39 -0500100 Should Contain ${shutdown} shutdown successfully
101
George Keishingffbe8ce2017-05-04 12:08:54 -0500102
103Pre Test Case Execution
104 [Documentation] Do the initial test setup.
105 # 1. Check if HTX tool exist.
106 # 2. Power on
107
108 Boot To OS
109 HTX Tool Exist
110
111
112Post Test Case Execution
113 [Documentation] Do the post test teardown.
114 # 1. Shut down HTX exerciser if test Failed.
115 # 2. Capture FFDC on test failure.
116 # 3. Close all open SSH connections.
117
George Keishing1a23b692017-05-06 12:19:41 -0500118 # Keep HTX running if user set HTX_KEEP_RUNNING to 1.
119 Run Keyword If '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0}
George Keishingffbe8ce2017-05-04 12:08:54 -0500120 ... Shutdown HTX Exerciser
121
122 FFDC On Test Case Fail
123 Close All Connections
124