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