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 | |
George Keishing | cae6e90 | 2017-09-07 13:35:59 -0500 | [diff] [blame] | 8 | # org open power base URI. |
| 9 | OPENPOWER_BASE_URI = '/org/open_power/' |
| 10 | OPENPOWER_CONTROL = OPENPOWER_BASE_URI + 'control/' |
| 11 | |
| 12 | # REST URI base endpoint paths. |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 13 | CONTROL_URI = OPENBMC_BASE_URI + 'control/' |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 14 | RECORDS_URI = OPENBMC_BASE_URI + 'records/' |
| 15 | BUTTONS_URI = OPENBMC_BASE_URI + 'buttons/' |
| 16 | SETTINGS_URI = OPENBMC_BASE_URI + 'settings/' |
| 17 | WATCHDOG_URI = OPENBMC_BASE_URI + 'watchdog/' |
| 18 | INVENTORY_URI = OPENBMC_BASE_URI + 'inventory/' |
| 19 | USER_MANAGER_URI = OPENBMC_BASE_URI + 'UserManager/' |
| 20 | NETWORK_MANAGER_URI = OPENBMC_BASE_URI + 'NetworkManager/' |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 21 | TIME_MANAGER_URI = OPENBMC_BASE_URI + 'TimeManager/' |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 22 | XYZ_NETWORK_MANAGER = '/xyz/openbmc_project/network/' |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 23 | |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 24 | # Sensors base variables. |
| 25 | SENSORS_URI = '/xyz/openbmc_project/sensors/' |
| 26 | |
George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 27 | # State Manager base variables. |
Rahul Maheshwari | 2f8de6c | 2017-01-17 07:00:22 -0600 | [diff] [blame] | 28 | BMC_REBOOT_TRANS = 'xyz.openbmc_project.State.BMC.Transition.Reboot' |
| 29 | |
George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 30 | HOST_POWEROFF_TRANS = 'xyz.openbmc_project.State.Host.Transition.Off' |
| 31 | HOST_POWERON_TRANS = 'xyz.openbmc_project.State.Host.Transition.On' |
Rahul Maheshwari | f7ead24 | 2017-02-14 01:59:42 -0600 | [diff] [blame] | 32 | HOST_REBOOT_TRANS = 'xyz.openbmc_project.State.Host.Transition.Reboot' |
George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 33 | HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off' |
| 34 | HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running' |
| 35 | |
| 36 | CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off' |
| 37 | CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On' |
| 38 | CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off' |
| 39 | CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On' |
| 40 | |
| 41 | # State Manager URI variables. |
George Keishing | 678b65c | 2017-08-31 16:16:39 -0500 | [diff] [blame] | 42 | SYSTEM_STATE_URI = '/xyz/openbmc_project/state/' |
George Keishing | 3c332e0 | 2017-02-23 22:10:18 -0600 | [diff] [blame] | 43 | BMC_STATE_URI = '/xyz/openbmc_project/state/bmc0/' |
George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 44 | HOST_STATE_URI = '/xyz/openbmc_project/state/host0/' |
| 45 | CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/' |
Sridevi Ramesh | 0a7c0aa | 2017-06-26 13:03:02 -0500 | [diff] [blame] | 46 | HOST_WATCHDOG_URI = '/xyz/openbmc_project/watchdog/host0/' |
George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 47 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 48 | # Logging URI variables |
George Keishing | a71dd20 | 2017-02-24 00:49:40 -0600 | [diff] [blame] | 49 | BMC_LOGGING_URI = '/xyz/openbmc_project/logging/' |
| 50 | BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/' |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 51 | |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 52 | # Software manager version |
George Keishing | ff1e3ec | 2017-07-20 01:58:21 -0500 | [diff] [blame] | 53 | SOFTWARE_VERSION_URI = '/xyz/openbmc_project/software/' |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 54 | ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active' |
Saqib Khan | bb8b63f | 2017-05-24 10:58:01 -0500 | [diff] [blame] | 55 | READY = 'xyz.openbmc_project.Software.Activation.Activations.Ready' |
| 56 | INVALID = 'xyz.openbmc_project.Software.Activation.Activations.Invalid' |
| 57 | ACTIVATING = 'xyz.openbmc_project.Software.Activation.Activations.Activating' |
| 58 | NOTREADY = 'xyz.openbmc_project.Software.Activation.Activations.NotReady' |
| 59 | FAILED = 'xyz.openbmc_project.Software.Activation.Activations.Failed' |
| 60 | |
| 61 | SOFTWARE_ACTIVATION = 'xyz.openbmc_project.Software.Activation' |
| 62 | REQUESTED_ACTIVATION = SOFTWARE_ACTIVATION + '.RequestedActivations' |
| 63 | REQUESTED_ACTIVE = REQUESTED_ACTIVATION + '.Active' |
| 64 | REQUESTED_NONE = REQUESTED_ACTIVATION + '.None' |
| 65 | |
| 66 | SOFTWARE_PURPOSE = 'xyz.openbmc_project.Software.Version.VersionPurpose' |
| 67 | VERSION_PURPOSE_HOST = SOFTWARE_PURPOSE + '.Host' |
| 68 | VERSION_PURPOSE_BMC = SOFTWARE_PURPOSE + '.BMC' |
| 69 | VERSION_PURPOSE_SYSTEM = SOFTWARE_PURPOSE + '.System' |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 70 | |
Charles Paul Hofer | 9f74d3a | 2017-08-18 09:54:28 -0500 | [diff] [blame] | 71 | # Image Upload Directory Path |
| 72 | IMAGE_UPLOAD_DIR_PATH = '/tmp/images/' |
| 73 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 74 | # Inventory URI |
| 75 | HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/' |
| 76 | |
Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 77 | # Led URI variable |
| 78 | LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/' |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 79 | LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/' |
Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 80 | |
George Keishing | 1059b22 | 2017-07-21 13:24:43 -0500 | [diff] [blame] | 81 | # Host control URI variables. |
| 82 | CONTROL_HOST_URI = '/xyz/openbmc_project/control/host0/' |
Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 83 | |
George Keishing | 1c3a966 | 2017-08-11 10:16:36 -0500 | [diff] [blame] | 84 | # Power restore variables. |
| 85 | POWER_RESTORE_URI = CONTROL_HOST_URI + 'power_restore_policy' |
| 86 | CONTROL_DBUS_BASE = 'xyz.openbmc_project.Control.' |
| 87 | |
| 88 | RESTORE_LAST_STATE = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.Restore' |
| 89 | ALWAYS_POWER_ON = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOn' |
| 90 | ALWAYS_POWER_OFF = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOff' |
| 91 | |
Rahul Maheshwari | 23b18fb | 2017-08-01 00:30:26 -0500 | [diff] [blame] | 92 | # Dump URI variable |
| 93 | DUMP_URI = '/xyz/openbmc_project/dump/' |
| 94 | DUMP_ENTRY_URI = DUMP_URI + 'entry/' |
| 95 | |
George Keishing | 2bd6fc0 | 2017-08-10 01:15:16 -0500 | [diff] [blame] | 96 | # Boot progress variables. |
| 97 | STATE_DBUS_BASE = 'xyz.openbmc_project.State.' |
| 98 | OS_BOOT_START = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.OSStart' |
| 99 | OS_BOOT_OFF = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.Unspecified' |
| 100 | OS_BOOT_COMPLETE = STATE_DBUS_BASE + 'OperatingSystem.Status.OSStatus.BootComplete' |
| 101 | |
Rahul Maheshwari | 85c4d34 | 2017-08-09 21:59:30 -0500 | [diff] [blame] | 102 | # Boot variables. |
| 103 | BOOT_SOURCE_DEFAULT = 'xyz.openbmc_project.Control.Boot.Source.Sources.Default' |
| 104 | BOOT_SOURCE_NETWORK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Network' |
| 105 | BOOT_SOURCE_DISK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Disk' |
| 106 | BOOT_SOURCE_CDROM = 'xyz.openbmc_project.Control.Boot.Source.Sources.ExternalMedia' |
| 107 | BOOT_MODE_SAFE = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Safe' |
| 108 | BOOT_MODE_SETUP = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Setup' |
| 109 | BOOT_MODE_REGULAR = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Regular' |
| 110 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 111 | ''' |
| 112 | QEMU HTTPS variable: |
| 113 | |
| 114 | By default lib/resource.txt AUTH URI construct is as |
| 115 | ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX} |
| 116 | ${AUTH_SUFFIX} is populated here by default EMPTY else |
| 117 | the port from the OS environment |
| 118 | ''' |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 119 | |
| 120 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 121 | def get_port_https(): |
| 122 | # defaulted to empty string |
| 123 | l_suffix = '' |
| 124 | try: |
| 125 | l_https_port = os.getenv('HTTPS_PORT') |
| 126 | if l_https_port: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 127 | l_suffix = ':' + l_https_port |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 128 | except: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 129 | print "Environment variable HTTPS_PORT not set,\ |
| 130 | using default HTTPS port" |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 131 | return l_suffix |
| 132 | |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 133 | AUTH_SUFFIX = { |
| 134 | "https_port": [get_port_https()], |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | # Update the ':Port number' to this variable |
| 138 | AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0] |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 139 | |
| 140 | # 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] | 141 | INVENTORY_ITEMS = { |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 142 | "CPU": [ |
| 143 | "Custom Field 1", |
| 144 | "Custom Field 2", |
| 145 | "Custom Field 3", |
| 146 | "Custom Field 4", |
| 147 | "Custom Field 5", |
| 148 | "Custom Field 6", |
| 149 | "Custom Field 7", |
| 150 | "Custom Field 8", |
| 151 | "FRU File ID", |
| 152 | "Manufacturer", |
| 153 | "Name", |
| 154 | "Part Number", |
| 155 | "Serial Number", |
| 156 | "fault", |
| 157 | "fru_type", |
| 158 | "is_fru", |
| 159 | "present", |
| 160 | "version", |
| 161 | ], |
| 162 | |
| 163 | "DIMM": [ |
| 164 | "Asset Tag", |
| 165 | "Custom Field 1", |
| 166 | "Custom Field 2", |
| 167 | "Custom Field 3", |
| 168 | "Custom Field 4", |
| 169 | "Custom Field 5", |
| 170 | "Custom Field 6", |
| 171 | "Custom Field 7", |
| 172 | "Custom Field 8", |
| 173 | "FRU File ID", |
| 174 | "Manufacturer", |
| 175 | "Model Number", |
| 176 | "Name", |
| 177 | "Serial Number", |
| 178 | "Version", |
| 179 | "fault", |
| 180 | "fru_type", |
| 181 | "is_fru", |
| 182 | "present", |
| 183 | "version", |
| 184 | ], |
| 185 | "MEMORY_BUFFER": [ |
| 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 | "FRU File ID", |
| 195 | "Manufacturer", |
| 196 | "Name", |
| 197 | "Part Number", |
| 198 | "Serial Number", |
| 199 | "fault", |
| 200 | "fru_type", |
| 201 | "is_fru", |
| 202 | "present", |
| 203 | "version", |
| 204 | ], |
| 205 | "FAN": [ |
| 206 | "fault", |
| 207 | "fru_type", |
| 208 | "is_fru", |
| 209 | "present", |
| 210 | "version", |
| 211 | ], |
| 212 | "DAUGHTER_CARD": [ |
| 213 | "Custom Field 1", |
| 214 | "Custom Field 2", |
| 215 | "Custom Field 3", |
| 216 | "Custom Field 4", |
| 217 | "Custom Field 5", |
| 218 | "Custom Field 6", |
| 219 | "Custom Field 7", |
| 220 | "Custom Field 8", |
| 221 | "FRU File ID", |
| 222 | "Manufacturer", |
| 223 | "Name", |
| 224 | "Part Number", |
| 225 | "Serial Number", |
| 226 | "fault", |
| 227 | "fru_type", |
| 228 | "is_fru", |
| 229 | "present", |
| 230 | "version", |
| 231 | ], |
| 232 | "BMC": [ |
| 233 | "fault", |
| 234 | "fru_type", |
| 235 | "is_fru", |
| 236 | "manufacturer", |
| 237 | "present", |
| 238 | "version", |
| 239 | ], |
| 240 | "MAIN_PLANAR": [ |
| 241 | "Custom Field 1", |
| 242 | "Custom Field 2", |
| 243 | "Custom Field 3", |
| 244 | "Custom Field 4", |
| 245 | "Custom Field 5", |
| 246 | "Custom Field 6", |
| 247 | "Custom Field 7", |
| 248 | "Custom Field 8", |
| 249 | "Part Number", |
| 250 | "Serial Number", |
| 251 | "Type", |
| 252 | "fault", |
| 253 | "fru_type", |
| 254 | "is_fru", |
| 255 | "present", |
| 256 | "version", |
| 257 | ], |
| 258 | "SYSTEM": [ |
| 259 | "Custom Field 1", |
| 260 | "Custom Field 2", |
| 261 | "Custom Field 3", |
| 262 | "Custom Field 4", |
| 263 | "Custom Field 5", |
| 264 | "Custom Field 6", |
| 265 | "Custom Field 7", |
| 266 | "Custom Field 8", |
| 267 | "FRU File ID", |
| 268 | "Manufacturer", |
| 269 | "Model Number", |
| 270 | "Name", |
| 271 | "Serial Number", |
| 272 | "Version", |
| 273 | "fault", |
| 274 | "fru_type", |
| 275 | "is_fru", |
| 276 | "present", |
| 277 | "version", |
| 278 | ], |
| 279 | "CORE": [ |
| 280 | "fault", |
| 281 | "fru_type", |
| 282 | "is_fru", |
| 283 | "present", |
| 284 | "version", |
| 285 | ], |
| 286 | } |