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/' |
| 52 | |
| 53 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 54 | ''' |
| 55 | QEMU HTTPS variable: |
| 56 | |
| 57 | By default lib/resource.txt AUTH URI construct is as |
| 58 | ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX} |
| 59 | ${AUTH_SUFFIX} is populated here by default EMPTY else |
| 60 | the port from the OS environment |
| 61 | ''' |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 62 | |
| 63 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 64 | def get_port_https(): |
| 65 | # defaulted to empty string |
| 66 | l_suffix = '' |
| 67 | try: |
| 68 | l_https_port = os.getenv('HTTPS_PORT') |
| 69 | if l_https_port: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 70 | l_suffix = ':' + l_https_port |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 71 | except: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 72 | print "Environment variable HTTPS_PORT not set,\ |
| 73 | using default HTTPS port" |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 74 | return l_suffix |
| 75 | |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 76 | AUTH_SUFFIX = { |
| 77 | "https_port": [get_port_https()], |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | # Update the ':Port number' to this variable |
| 81 | AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0] |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 82 | |
| 83 | # 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] | 84 | INVENTORY_ITEMS = { |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 85 | "CPU": [ |
| 86 | "Custom Field 1", |
| 87 | "Custom Field 2", |
| 88 | "Custom Field 3", |
| 89 | "Custom Field 4", |
| 90 | "Custom Field 5", |
| 91 | "Custom Field 6", |
| 92 | "Custom Field 7", |
| 93 | "Custom Field 8", |
| 94 | "FRU File ID", |
| 95 | "Manufacturer", |
| 96 | "Name", |
| 97 | "Part Number", |
| 98 | "Serial Number", |
| 99 | "fault", |
| 100 | "fru_type", |
| 101 | "is_fru", |
| 102 | "present", |
| 103 | "version", |
| 104 | ], |
| 105 | |
| 106 | "DIMM": [ |
| 107 | "Asset Tag", |
| 108 | "Custom Field 1", |
| 109 | "Custom Field 2", |
| 110 | "Custom Field 3", |
| 111 | "Custom Field 4", |
| 112 | "Custom Field 5", |
| 113 | "Custom Field 6", |
| 114 | "Custom Field 7", |
| 115 | "Custom Field 8", |
| 116 | "FRU File ID", |
| 117 | "Manufacturer", |
| 118 | "Model Number", |
| 119 | "Name", |
| 120 | "Serial Number", |
| 121 | "Version", |
| 122 | "fault", |
| 123 | "fru_type", |
| 124 | "is_fru", |
| 125 | "present", |
| 126 | "version", |
| 127 | ], |
| 128 | "MEMORY_BUFFER": [ |
| 129 | "Custom Field 1", |
| 130 | "Custom Field 2", |
| 131 | "Custom Field 3", |
| 132 | "Custom Field 4", |
| 133 | "Custom Field 5", |
| 134 | "Custom Field 6", |
| 135 | "Custom Field 7", |
| 136 | "Custom Field 8", |
| 137 | "FRU File ID", |
| 138 | "Manufacturer", |
| 139 | "Name", |
| 140 | "Part Number", |
| 141 | "Serial Number", |
| 142 | "fault", |
| 143 | "fru_type", |
| 144 | "is_fru", |
| 145 | "present", |
| 146 | "version", |
| 147 | ], |
| 148 | "FAN": [ |
| 149 | "fault", |
| 150 | "fru_type", |
| 151 | "is_fru", |
| 152 | "present", |
| 153 | "version", |
| 154 | ], |
| 155 | "DAUGHTER_CARD": [ |
| 156 | "Custom Field 1", |
| 157 | "Custom Field 2", |
| 158 | "Custom Field 3", |
| 159 | "Custom Field 4", |
| 160 | "Custom Field 5", |
| 161 | "Custom Field 6", |
| 162 | "Custom Field 7", |
| 163 | "Custom Field 8", |
| 164 | "FRU File ID", |
| 165 | "Manufacturer", |
| 166 | "Name", |
| 167 | "Part Number", |
| 168 | "Serial Number", |
| 169 | "fault", |
| 170 | "fru_type", |
| 171 | "is_fru", |
| 172 | "present", |
| 173 | "version", |
| 174 | ], |
| 175 | "BMC": [ |
| 176 | "fault", |
| 177 | "fru_type", |
| 178 | "is_fru", |
| 179 | "manufacturer", |
| 180 | "present", |
| 181 | "version", |
| 182 | ], |
| 183 | "MAIN_PLANAR": [ |
| 184 | "Custom Field 1", |
| 185 | "Custom Field 2", |
| 186 | "Custom Field 3", |
| 187 | "Custom Field 4", |
| 188 | "Custom Field 5", |
| 189 | "Custom Field 6", |
| 190 | "Custom Field 7", |
| 191 | "Custom Field 8", |
| 192 | "Part Number", |
| 193 | "Serial Number", |
| 194 | "Type", |
| 195 | "fault", |
| 196 | "fru_type", |
| 197 | "is_fru", |
| 198 | "present", |
| 199 | "version", |
| 200 | ], |
| 201 | "SYSTEM": [ |
| 202 | "Custom Field 1", |
| 203 | "Custom Field 2", |
| 204 | "Custom Field 3", |
| 205 | "Custom Field 4", |
| 206 | "Custom Field 5", |
| 207 | "Custom Field 6", |
| 208 | "Custom Field 7", |
| 209 | "Custom Field 8", |
| 210 | "FRU File ID", |
| 211 | "Manufacturer", |
| 212 | "Model Number", |
| 213 | "Name", |
| 214 | "Serial Number", |
| 215 | "Version", |
| 216 | "fault", |
| 217 | "fru_type", |
| 218 | "is_fru", |
| 219 | "present", |
| 220 | "version", |
| 221 | ], |
| 222 | "CORE": [ |
| 223 | "fault", |
| 224 | "fru_type", |
| 225 | "is_fru", |
| 226 | "present", |
| 227 | "version", |
| 228 | ], |
| 229 | } |