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 |
Saqib Khan | bb8b63f | 2017-05-24 10:58:01 -0500 | [diff] [blame] | 45 | SOFTWARE_VERSION = '/xyz/openbmc_project/software/' |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 46 | ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active' |
Saqib Khan | bb8b63f | 2017-05-24 10:58:01 -0500 | [diff] [blame] | 47 | READY = 'xyz.openbmc_project.Software.Activation.Activations.Ready' |
| 48 | INVALID = 'xyz.openbmc_project.Software.Activation.Activations.Invalid' |
| 49 | ACTIVATING = 'xyz.openbmc_project.Software.Activation.Activations.Activating' |
| 50 | NOTREADY = 'xyz.openbmc_project.Software.Activation.Activations.NotReady' |
| 51 | FAILED = 'xyz.openbmc_project.Software.Activation.Activations.Failed' |
| 52 | |
| 53 | SOFTWARE_ACTIVATION = 'xyz.openbmc_project.Software.Activation' |
| 54 | REQUESTED_ACTIVATION = SOFTWARE_ACTIVATION + '.RequestedActivations' |
| 55 | REQUESTED_ACTIVE = REQUESTED_ACTIVATION + '.Active' |
| 56 | REQUESTED_NONE = REQUESTED_ACTIVATION + '.None' |
| 57 | |
| 58 | SOFTWARE_PURPOSE = 'xyz.openbmc_project.Software.Version.VersionPurpose' |
| 59 | VERSION_PURPOSE_HOST = SOFTWARE_PURPOSE + '.Host' |
| 60 | VERSION_PURPOSE_BMC = SOFTWARE_PURPOSE + '.BMC' |
| 61 | VERSION_PURPOSE_SYSTEM = SOFTWARE_PURPOSE + '.System' |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 62 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 63 | # Inventory URI |
| 64 | HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/' |
| 65 | |
Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 66 | # Led URI variable |
| 67 | LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/' |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 68 | LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/' |
Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 69 | |
| 70 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 71 | ''' |
| 72 | QEMU HTTPS variable: |
| 73 | |
| 74 | By default lib/resource.txt AUTH URI construct is as |
| 75 | ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX} |
| 76 | ${AUTH_SUFFIX} is populated here by default EMPTY else |
| 77 | the port from the OS environment |
| 78 | ''' |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 79 | |
| 80 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 81 | def get_port_https(): |
| 82 | # defaulted to empty string |
| 83 | l_suffix = '' |
| 84 | try: |
| 85 | l_https_port = os.getenv('HTTPS_PORT') |
| 86 | if l_https_port: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 87 | l_suffix = ':' + l_https_port |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 88 | except: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 89 | print "Environment variable HTTPS_PORT not set,\ |
| 90 | using default HTTPS port" |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 91 | return l_suffix |
| 92 | |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 93 | AUTH_SUFFIX = { |
| 94 | "https_port": [get_port_https()], |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | # Update the ':Port number' to this variable |
| 98 | AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0] |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 99 | |
| 100 | # 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] | 101 | INVENTORY_ITEMS = { |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 102 | "CPU": [ |
| 103 | "Custom Field 1", |
| 104 | "Custom Field 2", |
| 105 | "Custom Field 3", |
| 106 | "Custom Field 4", |
| 107 | "Custom Field 5", |
| 108 | "Custom Field 6", |
| 109 | "Custom Field 7", |
| 110 | "Custom Field 8", |
| 111 | "FRU File ID", |
| 112 | "Manufacturer", |
| 113 | "Name", |
| 114 | "Part Number", |
| 115 | "Serial Number", |
| 116 | "fault", |
| 117 | "fru_type", |
| 118 | "is_fru", |
| 119 | "present", |
| 120 | "version", |
| 121 | ], |
| 122 | |
| 123 | "DIMM": [ |
| 124 | "Asset Tag", |
| 125 | "Custom Field 1", |
| 126 | "Custom Field 2", |
| 127 | "Custom Field 3", |
| 128 | "Custom Field 4", |
| 129 | "Custom Field 5", |
| 130 | "Custom Field 6", |
| 131 | "Custom Field 7", |
| 132 | "Custom Field 8", |
| 133 | "FRU File ID", |
| 134 | "Manufacturer", |
| 135 | "Model Number", |
| 136 | "Name", |
| 137 | "Serial Number", |
| 138 | "Version", |
| 139 | "fault", |
| 140 | "fru_type", |
| 141 | "is_fru", |
| 142 | "present", |
| 143 | "version", |
| 144 | ], |
| 145 | "MEMORY_BUFFER": [ |
| 146 | "Custom Field 1", |
| 147 | "Custom Field 2", |
| 148 | "Custom Field 3", |
| 149 | "Custom Field 4", |
| 150 | "Custom Field 5", |
| 151 | "Custom Field 6", |
| 152 | "Custom Field 7", |
| 153 | "Custom Field 8", |
| 154 | "FRU File ID", |
| 155 | "Manufacturer", |
| 156 | "Name", |
| 157 | "Part Number", |
| 158 | "Serial Number", |
| 159 | "fault", |
| 160 | "fru_type", |
| 161 | "is_fru", |
| 162 | "present", |
| 163 | "version", |
| 164 | ], |
| 165 | "FAN": [ |
| 166 | "fault", |
| 167 | "fru_type", |
| 168 | "is_fru", |
| 169 | "present", |
| 170 | "version", |
| 171 | ], |
| 172 | "DAUGHTER_CARD": [ |
| 173 | "Custom Field 1", |
| 174 | "Custom Field 2", |
| 175 | "Custom Field 3", |
| 176 | "Custom Field 4", |
| 177 | "Custom Field 5", |
| 178 | "Custom Field 6", |
| 179 | "Custom Field 7", |
| 180 | "Custom Field 8", |
| 181 | "FRU File ID", |
| 182 | "Manufacturer", |
| 183 | "Name", |
| 184 | "Part Number", |
| 185 | "Serial Number", |
| 186 | "fault", |
| 187 | "fru_type", |
| 188 | "is_fru", |
| 189 | "present", |
| 190 | "version", |
| 191 | ], |
| 192 | "BMC": [ |
| 193 | "fault", |
| 194 | "fru_type", |
| 195 | "is_fru", |
| 196 | "manufacturer", |
| 197 | "present", |
| 198 | "version", |
| 199 | ], |
| 200 | "MAIN_PLANAR": [ |
| 201 | "Custom Field 1", |
| 202 | "Custom Field 2", |
| 203 | "Custom Field 3", |
| 204 | "Custom Field 4", |
| 205 | "Custom Field 5", |
| 206 | "Custom Field 6", |
| 207 | "Custom Field 7", |
| 208 | "Custom Field 8", |
| 209 | "Part Number", |
| 210 | "Serial Number", |
| 211 | "Type", |
| 212 | "fault", |
| 213 | "fru_type", |
| 214 | "is_fru", |
| 215 | "present", |
| 216 | "version", |
| 217 | ], |
| 218 | "SYSTEM": [ |
| 219 | "Custom Field 1", |
| 220 | "Custom Field 2", |
| 221 | "Custom Field 3", |
| 222 | "Custom Field 4", |
| 223 | "Custom Field 5", |
| 224 | "Custom Field 6", |
| 225 | "Custom Field 7", |
| 226 | "Custom Field 8", |
| 227 | "FRU File ID", |
| 228 | "Manufacturer", |
| 229 | "Model Number", |
| 230 | "Name", |
| 231 | "Serial Number", |
| 232 | "Version", |
| 233 | "fault", |
| 234 | "fru_type", |
| 235 | "is_fru", |
| 236 | "present", |
| 237 | "version", |
| 238 | ], |
| 239 | "CORE": [ |
| 240 | "fault", |
| 241 | "fru_type", |
| 242 | "is_fru", |
| 243 | "present", |
| 244 | "version", |
| 245 | ], |
| 246 | } |