George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 1 | import os |
| 2 | |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 3 | # Enable when ready with openbmc/openbmc-test-automation#203 |
| 4 | # replace with new path /xyz/openbmc_project |
| 5 | OPENBMC_BASE_URI = '/org/openbmc/' |
| 6 | OPENBMC_BASE_DBUS = 'org.openbmc' |
| 7 | |
| 8 | # REST URI base endpoint paths |
| 9 | CONTROL_URI = OPENBMC_BASE_URI + 'control/' |
| 10 | SENSORS_URI = OPENBMC_BASE_URI + 'sensors/' |
| 11 | RECORDS_URI = OPENBMC_BASE_URI + 'records/' |
| 12 | BUTTONS_URI = OPENBMC_BASE_URI + 'buttons/' |
| 13 | SETTINGS_URI = OPENBMC_BASE_URI + 'settings/' |
| 14 | WATCHDOG_URI = OPENBMC_BASE_URI + 'watchdog/' |
| 15 | INVENTORY_URI = OPENBMC_BASE_URI + 'inventory/' |
| 16 | USER_MANAGER_URI = OPENBMC_BASE_URI + 'UserManager/' |
| 17 | NETWORK_MANAGER_URI = OPENBMC_BASE_URI + 'NetworkManager/' |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 18 | TIME_MANAGER_URI = OPENBMC_BASE_URI + 'TimeManager/' |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 19 | |
George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 20 | # State Manager base variables. |
Rahul Maheshwari | 2f8de6c | 2017-01-17 07:00:22 -0600 | [diff] [blame] | 21 | BMC_REBOOT_TRANS = 'xyz.openbmc_project.State.BMC.Transition.Reboot' |
| 22 | |
George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 23 | HOST_POWEROFF_TRANS = 'xyz.openbmc_project.State.Host.Transition.Off' |
| 24 | HOST_POWERON_TRANS = 'xyz.openbmc_project.State.Host.Transition.On' |
Rahul Maheshwari | f7ead24 | 2017-02-14 01:59:42 -0600 | [diff] [blame] | 25 | HOST_REBOOT_TRANS = 'xyz.openbmc_project.State.Host.Transition.Reboot' |
George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 26 | HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off' |
| 27 | HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running' |
| 28 | |
| 29 | CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off' |
| 30 | CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On' |
| 31 | CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off' |
| 32 | CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On' |
| 33 | |
| 34 | # State Manager URI variables. |
George Keishing | 3c332e0 | 2017-02-23 22:10:18 -0600 | [diff] [blame] | 35 | BMC_STATE_URI = '/xyz/openbmc_project/state/bmc0/' |
George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 36 | HOST_STATE_URI = '/xyz/openbmc_project/state/host0/' |
| 37 | CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/' |
| 38 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 39 | # Logging URI variables |
George Keishing | a71dd20 | 2017-02-24 00:49:40 -0600 | [diff] [blame] | 40 | BMC_LOGGING_URI = '/xyz/openbmc_project/logging/' |
| 41 | BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/' |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 42 | |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 43 | # Software manager version |
| 44 | SOFTWARE_VERSION_URI = '/xyz/openbmc_project/software/' |
| 45 | ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active' |
| 46 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 47 | # Inventory URI |
| 48 | HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/' |
| 49 | |
Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 50 | # Led URI variable |
| 51 | LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/' |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 52 | LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/' |
Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 53 | |
| 54 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 55 | ''' |
| 56 | QEMU HTTPS variable: |
| 57 | |
| 58 | By default lib/resource.txt AUTH URI construct is as |
| 59 | ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX} |
| 60 | ${AUTH_SUFFIX} is populated here by default EMPTY else |
| 61 | the port from the OS environment |
| 62 | ''' |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 63 | |
| 64 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 65 | def get_port_https(): |
| 66 | # defaulted to empty string |
| 67 | l_suffix = '' |
| 68 | try: |
| 69 | l_https_port = os.getenv('HTTPS_PORT') |
| 70 | if l_https_port: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 71 | l_suffix = ':' + l_https_port |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 72 | except: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 73 | print "Environment variable HTTPS_PORT not set,\ |
| 74 | using default HTTPS port" |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 75 | return l_suffix |
| 76 | |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 77 | AUTH_SUFFIX = { |
| 78 | "https_port": [get_port_https()], |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | # Update the ':Port number' to this variable |
| 82 | AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0] |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 83 | |
| 84 | # Here contains a list of valid Properties bases on fru_type after a boot. |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 85 | INVENTORY_ITEMS = { |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 86 | "CPU": [ |
| 87 | "Custom Field 1", |
| 88 | "Custom Field 2", |
| 89 | "Custom Field 3", |
| 90 | "Custom Field 4", |
| 91 | "Custom Field 5", |
| 92 | "Custom Field 6", |
| 93 | "Custom Field 7", |
| 94 | "Custom Field 8", |
| 95 | "FRU File ID", |
| 96 | "Manufacturer", |
| 97 | "Name", |
| 98 | "Part Number", |
| 99 | "Serial Number", |
| 100 | "fault", |
| 101 | "fru_type", |
| 102 | "is_fru", |
| 103 | "present", |
| 104 | "version", |
| 105 | ], |
| 106 | |
| 107 | "DIMM": [ |
| 108 | "Asset Tag", |
| 109 | "Custom Field 1", |
| 110 | "Custom Field 2", |
| 111 | "Custom Field 3", |
| 112 | "Custom Field 4", |
| 113 | "Custom Field 5", |
| 114 | "Custom Field 6", |
| 115 | "Custom Field 7", |
| 116 | "Custom Field 8", |
| 117 | "FRU File ID", |
| 118 | "Manufacturer", |
| 119 | "Model Number", |
| 120 | "Name", |
| 121 | "Serial Number", |
| 122 | "Version", |
| 123 | "fault", |
| 124 | "fru_type", |
| 125 | "is_fru", |
| 126 | "present", |
| 127 | "version", |
| 128 | ], |
| 129 | "MEMORY_BUFFER": [ |
| 130 | "Custom Field 1", |
| 131 | "Custom Field 2", |
| 132 | "Custom Field 3", |
| 133 | "Custom Field 4", |
| 134 | "Custom Field 5", |
| 135 | "Custom Field 6", |
| 136 | "Custom Field 7", |
| 137 | "Custom Field 8", |
| 138 | "FRU File ID", |
| 139 | "Manufacturer", |
| 140 | "Name", |
| 141 | "Part Number", |
| 142 | "Serial Number", |
| 143 | "fault", |
| 144 | "fru_type", |
| 145 | "is_fru", |
| 146 | "present", |
| 147 | "version", |
| 148 | ], |
| 149 | "FAN": [ |
| 150 | "fault", |
| 151 | "fru_type", |
| 152 | "is_fru", |
| 153 | "present", |
| 154 | "version", |
| 155 | ], |
| 156 | "DAUGHTER_CARD": [ |
| 157 | "Custom Field 1", |
| 158 | "Custom Field 2", |
| 159 | "Custom Field 3", |
| 160 | "Custom Field 4", |
| 161 | "Custom Field 5", |
| 162 | "Custom Field 6", |
| 163 | "Custom Field 7", |
| 164 | "Custom Field 8", |
| 165 | "FRU File ID", |
| 166 | "Manufacturer", |
| 167 | "Name", |
| 168 | "Part Number", |
| 169 | "Serial Number", |
| 170 | "fault", |
| 171 | "fru_type", |
| 172 | "is_fru", |
| 173 | "present", |
| 174 | "version", |
| 175 | ], |
| 176 | "BMC": [ |
| 177 | "fault", |
| 178 | "fru_type", |
| 179 | "is_fru", |
| 180 | "manufacturer", |
| 181 | "present", |
| 182 | "version", |
| 183 | ], |
| 184 | "MAIN_PLANAR": [ |
| 185 | "Custom Field 1", |
| 186 | "Custom Field 2", |
| 187 | "Custom Field 3", |
| 188 | "Custom Field 4", |
| 189 | "Custom Field 5", |
| 190 | "Custom Field 6", |
| 191 | "Custom Field 7", |
| 192 | "Custom Field 8", |
| 193 | "Part Number", |
| 194 | "Serial Number", |
| 195 | "Type", |
| 196 | "fault", |
| 197 | "fru_type", |
| 198 | "is_fru", |
| 199 | "present", |
| 200 | "version", |
| 201 | ], |
| 202 | "SYSTEM": [ |
| 203 | "Custom Field 1", |
| 204 | "Custom Field 2", |
| 205 | "Custom Field 3", |
| 206 | "Custom Field 4", |
| 207 | "Custom Field 5", |
| 208 | "Custom Field 6", |
| 209 | "Custom Field 7", |
| 210 | "Custom Field 8", |
| 211 | "FRU File ID", |
| 212 | "Manufacturer", |
| 213 | "Model Number", |
| 214 | "Name", |
| 215 | "Serial Number", |
| 216 | "Version", |
| 217 | "fault", |
| 218 | "fru_type", |
| 219 | "is_fru", |
| 220 | "present", |
| 221 | "version", |
| 222 | ], |
| 223 | "CORE": [ |
| 224 | "fault", |
| 225 | "fru_type", |
| 226 | "is_fru", |
| 227 | "present", |
| 228 | "version", |
| 229 | ], |
| 230 | } |