blob: bc2363eef7c5dfb3e8983d87b7c3765b1d8c229e [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
George Keishing8740a0c2017-05-13 07:19:16 -0500111 # Shutdown if HTX is running.
112 ${status}= Run Keyword And Return Status Is HTX Running
113 Run Keyword If '${status}' == 'True'
114 ... Shutdown HTX Exerciser
115
George Keishingffbe8ce2017-05-04 12:08:54 -0500116
117Post Test Case Execution
118 [Documentation] Do the post test teardown.
119 # 1. Shut down HTX exerciser if test Failed.
120 # 2. Capture FFDC on test failure.
121 # 3. Close all open SSH connections.
122
George Keishing1a23b692017-05-06 12:19:41 -0500123 # Keep HTX running if user set HTX_KEEP_RUNNING to 1.
124 Run Keyword If '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0}
George Keishingffbe8ce2017-05-04 12:08:54 -0500125 ... Shutdown HTX Exerciser
126
127 FFDC On Test Case Fail
128 Close All Connections
129