Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation This testsuite is for testing the Boot Device Functions |
| 4 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 5 | Resource ../lib/rest_client.robot |
| 6 | Resource ../lib/ipmi_client.robot |
| 7 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | ddc605f | 2016-09-15 00:46:32 -0500 | [diff] [blame] | 8 | Resource ../lib/utils.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 9 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 10 | Suite Setup Open Connection And Log In |
| 11 | Suite Teardown Close All Connections |
| 12 | Test Setup Initialize DBUS cmd "boot_flags" |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 13 | Test Teardown FFDC On Test Case Fail |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 14 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 15 | *** Variables *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 16 | |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 17 | ${HOST_SETTINGS} ${SETTINGS_URI}host0 |
| 18 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 19 | *** Test Cases *** |
| 20 | |
| 21 | Set the Boot Device as Default using REST API |
| 22 | [Documentation] This testcase is to set the boot device as Default using REST |
| 23 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 24 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 25 | ${bootDevice}= Set Variable Default |
| 26 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 27 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 28 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 29 | Response Should Be Equal Default |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 30 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 31 | Should Be Empty ${stderr} |
| 32 | Should Contain ${output} Default |
| 33 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 34 | Set the Boot Device as Default using ipmitool |
| 35 | [Documentation] This testcase is to set the boot device as Default using |
| 36 | ... ipmitool. The Boot device is read using REST API and |
| 37 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 38 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 39 | Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 40 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 41 | Response Should Be Equal Default |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 42 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 43 | Should Be Empty ${stderr} |
| 44 | Should Contain ${output} Default |
| 45 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 46 | Set the Boot Device as Network using REST API |
| 47 | [Documentation] This testcase is to set the boot device as Network using REST |
| 48 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 49 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 50 | ${bootDevice}= Set Variable Network |
| 51 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 52 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 53 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 54 | Response Should Be Equal Network |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 55 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 56 | Should Be Empty ${stderr} |
| 57 | Should Contain ${output} Network |
| 58 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 59 | Set the Boot Device as Network using ipmitool |
| 60 | [Documentation] This testcase is to set the boot device as Network using |
| 61 | ... ipmitool. The Boot device is read using REST API and |
| 62 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 63 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 64 | Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 65 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 66 | Response Should Be Equal Network |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 67 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 68 | Should Be Empty ${stderr} |
| 69 | Should Contain ${output} Network |
| 70 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 71 | Set the Boot Device as Disk using REST API |
| 72 | [Documentation] This testcase is to set the boot device as Disk using REST |
| 73 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 74 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 75 | ${bootDevice}= Set Variable Disk |
| 76 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 77 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 78 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 79 | Response Should Be Equal Disk |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 80 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 81 | Should Be Empty ${stderr} |
| 82 | Should Contain ${output} Disk |
| 83 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 84 | Set the Boot Device as Disk using ipmitool |
| 85 | [Documentation] This testcase is to set the boot device as Disk using |
| 86 | ... ipmitool. The Boot device is read using REST API and |
| 87 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 88 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 89 | Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 90 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 91 | Response Should Be Equal Disk |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 92 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 93 | Should Be Empty ${stderr} |
| 94 | Should Contain ${output} Disk |
| 95 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 96 | Set the Boot Device as Safe using REST API |
| 97 | [Documentation] This testcase is to set the boot device as Safe using REST |
| 98 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 99 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 100 | ${bootDevice}= Set Variable Safe |
| 101 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 102 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 103 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 104 | Response Should Be Equal Safe |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 105 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 106 | Should Be Empty ${stderr} |
| 107 | Should Contain ${output} Safe |
| 108 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 109 | Set the Boot Device as Safe using ipmitool |
| 110 | [Documentation] This testcase is to set the boot device as Safe using |
| 111 | ... ipmitool. The Boot device is read using REST API and |
| 112 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 113 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 114 | Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 115 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 116 | Response Should Be Equal Safe |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 117 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 118 | Should Be Empty ${stderr} |
| 119 | Should Contain ${output} Safe |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 120 | |
| 121 | Set the Boot Device as CDROM using REST API |
| 122 | [Documentation] This testcase is to set the boot device as CDROM using REST |
| 123 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 124 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 125 | ${bootDevice}= Set Variable CDROM |
| 126 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 127 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 128 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 129 | Response Should Be Equal CDROM |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 130 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 131 | Should Be Empty ${stderr} |
| 132 | Should Contain ${output} CDROM |
| 133 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 134 | Set the Boot Device as CDROM using ipmitool |
| 135 | [Documentation] This testcase is to set the boot device as CDROM using |
| 136 | ... ipmitool. The Boot device is read using REST API and |
| 137 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 138 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 139 | Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 140 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 141 | Response Should Be Equal CDROM |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 142 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 143 | Should Be Empty ${stderr} |
| 144 | Should Contain ${output} CDROM |
| 145 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 146 | Set the Boot Device as Setup using REST API |
| 147 | [Documentation] This testcase is to set the boot device as Setup using REST |
| 148 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 149 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 150 | ${bootDevice}= Set Variable Setup |
| 151 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 152 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 153 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 154 | Response Should Be Equal Setup |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 155 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 156 | Should Be Empty ${stderr} |
| 157 | Should Contain ${output} Setup |
| 158 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 159 | Set the Boot Device as Setup using ipmitool |
| 160 | [Documentation] This testcase is to set the boot device as Setup using |
| 161 | ... ipmitool. The Boot device is read using REST API and |
| 162 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 163 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 164 | Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 165 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 166 | Response Should Be Equal Setup |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 167 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 168 | Should Be Empty ${stderr} |
| 169 | Should Contain ${output} Setup |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 170 | |
| 171 | *** Keywords *** |
| 172 | |
| 173 | Response Should Be Equal |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 174 | [Arguments] ${args} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 175 | Should Be Equal ${OUTPUT} ${args} |
| 176 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 177 | Read the Attribute |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 178 | [Arguments] ${uri} ${parm} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 179 | ${output}= Read Attribute ${uri} ${parm} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 180 | set test variable ${OUTPUT} ${output} |
| 181 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 182 | |