blob: 20d0f09b8fc69f0d8fa1d22c7f47fc2bcaa0cfac [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
George Keishing13f44e52017-05-12 15:28:12 -050021# User-defined halt on error.
George Keishing1a23b692017-05-06 12:19:41 -050022${HTX_KEEP_RUNNING} ${0}
George Keishingffbe8ce2017-05-04 12:08:54 -050023
George Keishing13f44e52017-05-12 15:28:12 -050024# User-defined MDT profile.
25# There are a few stanzas in the HTX test exerciser that need to be removed
26# temporarily and manually built and executed.
27${HTX_MDT_PROFILE} mdt.bu
28
George Keishing8b082fd2017-05-03 13:42:39 -050029*** Test Cases ***
30
31Hard Bootme Test
32 [Documentation] Stress the system using HTX exerciser.
George Keishingffbe8ce2017-05-04 12:08:54 -050033 [Tags] Hard_Bootme_Test
George Keishing8b082fd2017-05-03 13:42:39 -050034
George Keishingffbe8ce2017-05-04 12:08:54 -050035 Rprintn
36 Rpvars HTX_DURATION HTX_INTERVAL
37
38 Repeat Keyword ${HTX_LOOP} times Start HTX Exerciser
39
40
41*** Keywords ***
42
43Start HTX Exerciser
44 [Documentation] Start HTX exerciser.
45 # Test Flow:
46 # - Power on
47 # - Establish SSH connection session
48 # - Create HTX mdt profile
49 # - Run HTX exerciser
50 # - Check HTX status for errors
51 # - Power off
52
53 Boot To OS
54
55 # Post Power off and on, the OS SSH session needs to be established.
George Keishing8b082fd2017-05-03 13:42:39 -050056 Login To OS
57
George Keishing13f44e52017-05-12 15:28:12 -050058 Run Keyword If '${HTX_MDT_PROFILE}' == 'mdt.bu'
59 ... Create Default MDT Profile
George Keishing8b082fd2017-05-03 13:42:39 -050060
George Keishing13f44e52017-05-12 15:28:12 -050061 Run MDT Profile
George Keishing8b082fd2017-05-03 13:42:39 -050062
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
George Keishing13f44e52017-05-12 15:28:12 -050071
George Keishing8b082fd2017-05-03 13:42:39 -050072Loop HTX Health Check
George Keishingffbe8ce2017-05-04 12:08:54 -050073 [Documentation] Run until HTX exerciser fails.
74
George Keishing8b082fd2017-05-03 13:42:39 -050075 Repeat Keyword ${HTX_DURATION}
76 ... Run Keywords Check HTX Run Status
77 ... AND Sleep ${HTX_INTERVAL}
78
79
80Check HTX Run Status
81 [Documentation] Get HTX exerciser status and check for error.
82
George Keishingffbe8ce2017-05-04 12:08:54 -050083 Rprint Timen Check HTX mdt Status and error.
George Keishing13f44e52017-05-12 15:28:12 -050084 ${status}= Execute Command On OS
85 ... htxcmdline -status -mdt ${HTX_MDT_PROFILE}
George Keishing8b082fd2017-05-03 13:42:39 -050086 Log ${status}
George Keishingffbe8ce2017-05-04 12:08:54 -050087 Rprint Timen ${status}
George Keishing8b082fd2017-05-03 13:42:39 -050088
89 ${errlog}= Execute Command On OS htxcmdline -geterrlog
90 Log ${errlog}
George Keishingffbe8ce2017-05-04 12:08:54 -050091 Rprint Timen ${errlog}
George Keishing8b082fd2017-05-03 13:42:39 -050092
93 Should Contain ${errlog} file </tmp/htxerr> is empty
94
95
George Keishing13f44e52017-05-12 15:28:12 -050096Create Default MDT Profile
97 [Documentation] Create default mdt.bu profile and run.
98
99 Rprint Timen Create HTX mdt profile.
100
101 ${profile}= Execute Command On OS htxcmdline -createmdt
102 Rprint Timen ${profile}
103 Should Contain ${profile} mdts are created successfully
104
105
106Run MDT Profile
107 [Documentation] Load user pre-defined MDT profile.
108
109 Rprint Timen Start HTX mdt profile execution.
110 ${htx_run}= Execute Command On OS
111 ... htxcmdline -run -mdt ${HTX_MDT_PROFILE}
112 Rprint Timen ${htx_run}
113 Should Contain ${htx_run} Activated
114
115
George Keishing8b082fd2017-05-03 13:42:39 -0500116Shutdown HTX Exerciser
117 [Documentation] Shut down HTX exerciser run.
118
George Keishingffbe8ce2017-05-04 12:08:54 -0500119 Rprint Timen Shutdown HTX Run
George Keishing13f44e52017-05-12 15:28:12 -0500120 ${shutdown}= Execute Command On OS
121 ... htxcmdline -shutdown -mdt ${HTX_MDT_PROFILE}
George Keishingffbe8ce2017-05-04 12:08:54 -0500122 Rprint Timen ${shutdown}
George Keishing8b082fd2017-05-03 13:42:39 -0500123 Should Contain ${shutdown} shutdown successfully
124
George Keishingffbe8ce2017-05-04 12:08:54 -0500125
126Pre Test Case Execution
127 [Documentation] Do the initial test setup.
128 # 1. Check if HTX tool exist.
129 # 2. Power on
130
131 Boot To OS
132 HTX Tool Exist
133
George Keishing8740a0c2017-05-13 07:19:16 -0500134 # Shutdown if HTX is running.
135 ${status}= Run Keyword And Return Status Is HTX Running
136 Run Keyword If '${status}' == 'True'
137 ... Shutdown HTX Exerciser
138
George Keishingffbe8ce2017-05-04 12:08:54 -0500139
140Post Test Case Execution
141 [Documentation] Do the post test teardown.
142 # 1. Shut down HTX exerciser if test Failed.
143 # 2. Capture FFDC on test failure.
144 # 3. Close all open SSH connections.
145
George Keishing1a23b692017-05-06 12:19:41 -0500146 # Keep HTX running if user set HTX_KEEP_RUNNING to 1.
147 Run Keyword If '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0}
George Keishingffbe8ce2017-05-04 12:08:54 -0500148 ... Shutdown HTX Exerciser
149
150 FFDC On Test Case Fail
151 Close All Connections