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