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