George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Stress the system using HTX exerciser. |
| 3 | |
| 4 | Resource ../syslib/utils_os.robot |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 5 | Library ../lib/gen_robot_print.py |
| 6 | |
| 7 | Test Setup Pre Test Case Execution |
| 8 | Test Teardown Post Test Case Execution |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 9 | |
| 10 | *** Variables **** |
| 11 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 12 | ${stack_mode} skip |
| 13 | |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 14 | # Default duration and interval of HTX exerciser to run. |
George Keishing | 1a23b69 | 2017-05-06 12:19:41 -0500 | [diff] [blame] | 15 | ${HTX_DURATION} 2 hours |
| 16 | ${HTX_INTERVAL} 15 min |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 17 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 18 | # Default hardbootme loop times HTX exerciser to run. |
George Keishing | 1a23b69 | 2017-05-06 12:19:41 -0500 | [diff] [blame] | 19 | ${HTX_LOOP} 4 |
| 20 | |
George Keishing | 13f44e5 | 2017-05-12 15:28:12 -0500 | [diff] [blame] | 21 | # User-defined halt on error. |
George Keishing | 1a23b69 | 2017-05-06 12:19:41 -0500 | [diff] [blame] | 22 | ${HTX_KEEP_RUNNING} ${0} |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 23 | |
George Keishing | 13f44e5 | 2017-05-12 15:28:12 -0500 | [diff] [blame] | 24 | # 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 Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 29 | *** Test Cases *** |
| 30 | |
| 31 | Hard Bootme Test |
| 32 | [Documentation] Stress the system using HTX exerciser. |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 33 | [Tags] Hard_Bootme_Test |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 34 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 35 | Rprintn |
| 36 | Rpvars HTX_DURATION HTX_INTERVAL |
| 37 | |
| 38 | Repeat Keyword ${HTX_LOOP} times Start HTX Exerciser |
| 39 | |
| 40 | |
| 41 | *** Keywords *** |
| 42 | |
| 43 | Start 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 Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 56 | Login To OS |
| 57 | |
George Keishing | 13f44e5 | 2017-05-12 15:28:12 -0500 | [diff] [blame] | 58 | Run Keyword If '${HTX_MDT_PROFILE}' == 'mdt.bu' |
| 59 | ... Create Default MDT Profile |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 60 | |
George Keishing | 13f44e5 | 2017-05-12 15:28:12 -0500 | [diff] [blame] | 61 | Run MDT Profile |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 62 | |
| 63 | Loop HTX Health Check |
| 64 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 65 | Shutdown HTX Exerciser |
| 66 | |
| 67 | Power Off Host |
| 68 | |
| 69 | Rprint Timen HTX Test ran for: ${HTX_DURATION} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 70 | |
George Keishing | 13f44e5 | 2017-05-12 15:28:12 -0500 | [diff] [blame] | 71 | |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 72 | Loop HTX Health Check |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 73 | [Documentation] Run until HTX exerciser fails. |
| 74 | |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 75 | Repeat Keyword ${HTX_DURATION} |
| 76 | ... Run Keywords Check HTX Run Status |
| 77 | ... AND Sleep ${HTX_INTERVAL} |
| 78 | |
| 79 | |
| 80 | Check HTX Run Status |
| 81 | [Documentation] Get HTX exerciser status and check for error. |
| 82 | |
George Keishing | 4ef2908 | 2017-05-13 05:01:23 -0500 | [diff] [blame^] | 83 | Rprint Timen Collect HTX status and error log files. |
| 84 | Run Key U Collect HTX Log Files |
| 85 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 86 | Rprint Timen Check HTX mdt Status and error. |
George Keishing | 13f44e5 | 2017-05-12 15:28:12 -0500 | [diff] [blame] | 87 | ${status}= Execute Command On OS |
| 88 | ... htxcmdline -status -mdt ${HTX_MDT_PROFILE} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 89 | Log ${status} |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 90 | Rprint Timen ${status} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 91 | |
| 92 | ${errlog}= Execute Command On OS htxcmdline -geterrlog |
| 93 | Log ${errlog} |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 94 | Rprint Timen ${errlog} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 95 | |
| 96 | Should Contain ${errlog} file </tmp/htxerr> is empty |
| 97 | |
| 98 | |
George Keishing | 13f44e5 | 2017-05-12 15:28:12 -0500 | [diff] [blame] | 99 | Create Default MDT Profile |
| 100 | [Documentation] Create default mdt.bu profile and run. |
| 101 | |
| 102 | Rprint Timen Create HTX mdt profile. |
| 103 | |
| 104 | ${profile}= Execute Command On OS htxcmdline -createmdt |
| 105 | Rprint Timen ${profile} |
| 106 | Should Contain ${profile} mdts are created successfully |
| 107 | |
| 108 | |
| 109 | Run MDT Profile |
| 110 | [Documentation] Load user pre-defined MDT profile. |
| 111 | |
| 112 | Rprint Timen Start HTX mdt profile execution. |
| 113 | ${htx_run}= Execute Command On OS |
| 114 | ... htxcmdline -run -mdt ${HTX_MDT_PROFILE} |
| 115 | Rprint Timen ${htx_run} |
| 116 | Should Contain ${htx_run} Activated |
| 117 | |
| 118 | |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 119 | Shutdown HTX Exerciser |
| 120 | [Documentation] Shut down HTX exerciser run. |
| 121 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 122 | Rprint Timen Shutdown HTX Run |
George Keishing | 13f44e5 | 2017-05-12 15:28:12 -0500 | [diff] [blame] | 123 | ${shutdown}= Execute Command On OS |
| 124 | ... htxcmdline -shutdown -mdt ${HTX_MDT_PROFILE} |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 125 | Rprint Timen ${shutdown} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 126 | Should Contain ${shutdown} shutdown successfully |
| 127 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 128 | |
| 129 | Pre Test Case Execution |
| 130 | [Documentation] Do the initial test setup. |
| 131 | # 1. Check if HTX tool exist. |
| 132 | # 2. Power on |
| 133 | |
| 134 | Boot To OS |
George Keishing | 88366b3 | 2017-05-12 13:50:48 -0500 | [diff] [blame] | 135 | Tool Exist htxcmdline |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 136 | |
George Keishing | 8740a0c | 2017-05-13 07:19:16 -0500 | [diff] [blame] | 137 | # Shutdown if HTX is running. |
| 138 | ${status}= Run Keyword And Return Status Is HTX Running |
| 139 | Run Keyword If '${status}' == 'True' |
| 140 | ... Shutdown HTX Exerciser |
| 141 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 142 | |
| 143 | Post Test Case Execution |
| 144 | [Documentation] Do the post test teardown. |
| 145 | # 1. Shut down HTX exerciser if test Failed. |
| 146 | # 2. Capture FFDC on test failure. |
| 147 | # 3. Close all open SSH connections. |
| 148 | |
George Keishing | 1a23b69 | 2017-05-06 12:19:41 -0500 | [diff] [blame] | 149 | # Keep HTX running if user set HTX_KEEP_RUNNING to 1. |
| 150 | Run Keyword If '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0} |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 151 | ... Shutdown HTX Exerciser |
| 152 | |
| 153 | FFDC On Test Case Fail |
| 154 | Close All Connections |