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 |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 14 | *** Variables *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 15 | |
| 16 | *** Test Cases *** |
| 17 | |
| 18 | Set the Boot Device as Default using REST API |
| 19 | [Documentation] This testcase is to set the boot device as Default using REST |
| 20 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 21 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 22 | ${bootDevice} = Set Variable Default |
| 23 | ${valueDict} = create dictionary data=${bootDevice} |
| 24 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |
| 25 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 26 | Response Should Be Equal Default |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 27 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 28 | Should Be Empty ${stderr} |
| 29 | Should Contain ${output} Default |
| 30 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 31 | Set the Boot Device as Default using ipmitool |
| 32 | [Documentation] This testcase is to set the boot device as Default using |
| 33 | ... ipmitool. The Boot device is read using REST API and |
| 34 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 35 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 36 | Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00 |
| 37 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 38 | Response Should Be Equal Default |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 39 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 40 | Should Be Empty ${stderr} |
| 41 | Should Contain ${output} Default |
| 42 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 43 | Set the Boot Device as Network using REST API |
| 44 | [Documentation] This testcase is to set the boot device as Network using REST |
| 45 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 46 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 47 | ${bootDevice} = Set Variable Network |
| 48 | ${valueDict} = create dictionary data=${bootDevice} |
| 49 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |
| 50 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 51 | Response Should Be Equal Network |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 52 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 53 | Should Be Empty ${stderr} |
| 54 | Should Contain ${output} Network |
| 55 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 56 | Set the Boot Device as Network using ipmitool |
| 57 | [Documentation] This testcase is to set the boot device as Network using |
| 58 | ... ipmitool. The Boot device is read using REST API and |
| 59 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 60 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 61 | Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00 |
| 62 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 63 | Response Should Be Equal Network |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 64 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 65 | Should Be Empty ${stderr} |
| 66 | Should Contain ${output} Network |
| 67 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 68 | Set the Boot Device as Disk using REST API |
| 69 | [Documentation] This testcase is to set the boot device as Disk using REST |
| 70 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 71 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 72 | ${bootDevice} = Set Variable Disk |
| 73 | ${valueDict} = create dictionary data=${bootDevice} |
| 74 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |
| 75 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 76 | Response Should Be Equal Disk |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 77 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 78 | Should Be Empty ${stderr} |
| 79 | Should Contain ${output} Disk |
| 80 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 81 | Set the Boot Device as Disk using ipmitool |
| 82 | [Documentation] This testcase is to set the boot device as Disk using |
| 83 | ... ipmitool. The Boot device is read using REST API and |
| 84 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 85 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 86 | Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00 |
| 87 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 88 | Response Should Be Equal Disk |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 89 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 90 | Should Be Empty ${stderr} |
| 91 | Should Contain ${output} Disk |
| 92 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 93 | Set the Boot Device as Safe using REST API |
| 94 | [Documentation] This testcase is to set the boot device as Safe using REST |
| 95 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 96 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 97 | ${bootDevice} = Set Variable Safe |
| 98 | ${valueDict} = create dictionary data=${bootDevice} |
| 99 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |
| 100 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 101 | Response Should Be Equal Safe |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 102 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 103 | Should Be Empty ${stderr} |
| 104 | Should Contain ${output} Safe |
| 105 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 106 | Set the Boot Device as Safe using ipmitool |
| 107 | [Documentation] This testcase is to set the boot device as Safe using |
| 108 | ... ipmitool. The Boot device is read using REST API and |
| 109 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 110 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 111 | Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00 |
| 112 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 113 | Response Should Be Equal Safe |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 114 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 115 | Should Be Empty ${stderr} |
| 116 | Should Contain ${output} Safe |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 117 | |
| 118 | Set the Boot Device as CDROM using REST API |
| 119 | [Documentation] This testcase is to set the boot device as CDROM using REST |
| 120 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 121 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 122 | ${bootDevice} = Set Variable CDROM |
| 123 | ${valueDict} = create dictionary data=${bootDevice} |
| 124 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |
| 125 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 126 | Response Should Be Equal CDROM |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 127 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 128 | Should Be Empty ${stderr} |
| 129 | Should Contain ${output} CDROM |
| 130 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 131 | Set the Boot Device as CDROM using ipmitool |
| 132 | [Documentation] This testcase is to set the boot device as CDROM using |
| 133 | ... ipmitool. The Boot device is read using REST API and |
| 134 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 135 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 136 | Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00 |
| 137 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 138 | Response Should Be Equal CDROM |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 139 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 140 | Should Be Empty ${stderr} |
| 141 | Should Contain ${output} CDROM |
| 142 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 143 | Set the Boot Device as Setup using REST API |
| 144 | [Documentation] This testcase is to set the boot device as Setup using REST |
| 145 | ... URI. The Boot device is read using REST API and ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 146 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 147 | ${bootDevice} = Set Variable Setup |
| 148 | ${valueDict} = create dictionary data=${bootDevice} |
| 149 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |
| 150 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 151 | Response Should Be Equal Setup |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 152 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 153 | Should Be Empty ${stderr} |
| 154 | Should Contain ${output} Setup |
| 155 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 156 | Set the Boot Device as Setup using ipmitool |
| 157 | [Documentation] This testcase is to set the boot device as Setup using |
| 158 | ... ipmitool. The Boot device is read using REST API and |
| 159 | ... ipmitool. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 160 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 161 | Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00 |
| 162 | Read the Attribute /org/openbmc/settings/host0 boot_flags |
| 163 | Response Should Be Equal Setup |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 164 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 165 | Should Be Empty ${stderr} |
| 166 | Should Contain ${output} Setup |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 167 | |
| 168 | *** Keywords *** |
| 169 | |
| 170 | Response Should Be Equal |
| 171 | [arguments] ${args} |
| 172 | Should Be Equal ${OUTPUT} ${args} |
| 173 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 174 | Read the Attribute |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 175 | [arguments] ${uri} ${parm} |
| 176 | ${output} = Read Attribute ${uri} ${parm} |
| 177 | set test variable ${OUTPUT} ${output} |
| 178 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 179 | |