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 | |
| 21 | # User defined halt on error. |
| 22 | ${HTX_KEEP_RUNNING} ${0} |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 23 | |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 24 | *** Test Cases *** |
| 25 | |
| 26 | Hard Bootme Test |
| 27 | [Documentation] Stress the system using HTX exerciser. |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 28 | [Tags] Hard_Bootme_Test |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 29 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 30 | Rprintn |
| 31 | Rpvars HTX_DURATION HTX_INTERVAL |
| 32 | |
| 33 | Repeat Keyword ${HTX_LOOP} times Start HTX Exerciser |
| 34 | |
| 35 | |
| 36 | *** Keywords *** |
| 37 | |
| 38 | Start 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 Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 51 | Login To OS |
| 52 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 53 | Rprint Timen Create HTX mdt profile. |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 54 | ${profile}= Execute Command On OS htxcmdline -createmdt |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 55 | Rprint Timen ${profile} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 56 | Should Contain ${profile} mdts are created successfully |
| 57 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 58 | Rprint Timen Start HTX mdt profile execution. |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 59 | ${htx_run}= Execute Command On OS htxcmdline -run -mdt mdt.bu |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 60 | Rprint Timen ${htx_run} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 61 | Should Contain ${htx_run} Activated |
| 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 | |
| 71 | Loop HTX Health Check |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 72 | [Documentation] Run until HTX exerciser fails. |
| 73 | |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 74 | Repeat Keyword ${HTX_DURATION} |
| 75 | ... Run Keywords Check HTX Run Status |
| 76 | ... AND Sleep ${HTX_INTERVAL} |
| 77 | |
| 78 | |
| 79 | Check HTX Run Status |
| 80 | [Documentation] Get HTX exerciser status and check for error. |
| 81 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 82 | Rprint Timen Check HTX mdt Status and error. |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 83 | ${status}= Execute Command On OS htxcmdline -status -mdt mdt.bu |
| 84 | Log ${status} |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 85 | Rprint Timen ${status} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 86 | |
| 87 | ${errlog}= Execute Command On OS htxcmdline -geterrlog |
| 88 | Log ${errlog} |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 89 | Rprint Timen ${errlog} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 90 | |
| 91 | Should Contain ${errlog} file </tmp/htxerr> is empty |
| 92 | |
| 93 | |
| 94 | Shutdown HTX Exerciser |
| 95 | [Documentation] Shut down HTX exerciser run. |
| 96 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 97 | Rprint Timen Shutdown HTX Run |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 98 | ${shutdown}= Execute Command On OS htxcmdline -shutdown -mdt mdt.bu |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 99 | Rprint Timen ${shutdown} |
George Keishing | 8b082fd | 2017-05-03 13:42:39 -0500 | [diff] [blame] | 100 | Should Contain ${shutdown} shutdown successfully |
| 101 | |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 102 | |
| 103 | Pre 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 | |
| 112 | Post 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 Keishing | 1a23b69 | 2017-05-06 12:19:41 -0500 | [diff] [blame] | 118 | # Keep HTX running if user set HTX_KEEP_RUNNING to 1. |
| 119 | Run Keyword If '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0} |
George Keishing | ffbe8ce | 2017-05-04 12:08:54 -0500 | [diff] [blame] | 120 | ... Shutdown HTX Exerciser |
| 121 | |
| 122 | FFDC On Test Case Fail |
| 123 | Close All Connections |
| 124 | |