blob: 0c2a11ecac0b030e8c5a509c737922efc0b6fd61 [file] [log] [blame]
George Keishingfbeaecc2016-08-16 05:24:31 -05001import os
2
George Keishingcf910442016-12-08 03:12:59 -06003# Enable when ready with openbmc/openbmc-test-automation#203
4# replace with new path /xyz/openbmc_project
5OPENBMC_BASE_URI = '/org/openbmc/'
6OPENBMC_BASE_DBUS = 'org.openbmc'
7
George Keishingcae6e902017-09-07 13:35:59 -05008# org open power base URI.
9OPENPOWER_BASE_URI = '/org/open_power/'
10OPENPOWER_CONTROL = OPENPOWER_BASE_URI + 'control/'
11
12# REST URI base endpoint paths.
George Keishingcf910442016-12-08 03:12:59 -060013CONTROL_URI = OPENBMC_BASE_URI + 'control/'
George Keishingcf910442016-12-08 03:12:59 -060014RECORDS_URI = OPENBMC_BASE_URI + 'records/'
15BUTTONS_URI = OPENBMC_BASE_URI + 'buttons/'
16SETTINGS_URI = OPENBMC_BASE_URI + 'settings/'
17WATCHDOG_URI = OPENBMC_BASE_URI + 'watchdog/'
18INVENTORY_URI = OPENBMC_BASE_URI + 'inventory/'
19USER_MANAGER_URI = OPENBMC_BASE_URI + 'UserManager/'
20NETWORK_MANAGER_URI = OPENBMC_BASE_URI + 'NetworkManager/'
Rahul Maheshwarif8785902016-12-12 01:23:13 -060021TIME_MANAGER_URI = OPENBMC_BASE_URI + 'TimeManager/'
Prashanth Kattie79c5402017-06-08 07:40:49 -050022XYZ_NETWORK_MANAGER = '/xyz/openbmc_project/network/'
George Keishingcf910442016-12-08 03:12:59 -060023
George Keishing06572472017-09-01 11:33:01 -050024# Sensors base variables.
25SENSORS_URI = '/xyz/openbmc_project/sensors/'
26
George Keishingbec365b2017-01-19 01:28:41 -060027# State Manager base variables.
Rahul Maheshwari2f8de6c2017-01-17 07:00:22 -060028BMC_REBOOT_TRANS = 'xyz.openbmc_project.State.BMC.Transition.Reboot'
29
George Keishingbec365b2017-01-19 01:28:41 -060030HOST_POWEROFF_TRANS = 'xyz.openbmc_project.State.Host.Transition.Off'
31HOST_POWERON_TRANS = 'xyz.openbmc_project.State.Host.Transition.On'
Rahul Maheshwarif7ead242017-02-14 01:59:42 -060032HOST_REBOOT_TRANS = 'xyz.openbmc_project.State.Host.Transition.Reboot'
George Keishingbec365b2017-01-19 01:28:41 -060033HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off'
34HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running'
35
36CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off'
37CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On'
38CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off'
39CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On'
40
41# State Manager URI variables.
George Keishing3c332e02017-02-23 22:10:18 -060042BMC_STATE_URI = '/xyz/openbmc_project/state/bmc0/'
George Keishingbec365b2017-01-19 01:28:41 -060043HOST_STATE_URI = '/xyz/openbmc_project/state/host0/'
44CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/'
Sridevi Ramesh0a7c0aa2017-06-26 13:03:02 -050045HOST_WATCHDOG_URI = '/xyz/openbmc_project/watchdog/host0/'
George Keishingbec365b2017-01-19 01:28:41 -060046
George Keishing505d5b42017-02-21 11:01:54 -060047# Logging URI variables
George Keishinga71dd202017-02-24 00:49:40 -060048BMC_LOGGING_URI = '/xyz/openbmc_project/logging/'
49BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/'
George Keishing505d5b42017-02-21 11:01:54 -060050
George Keishingab5157b2017-02-09 12:24:25 -060051# Software manager version
George Keishingff1e3ec2017-07-20 01:58:21 -050052SOFTWARE_VERSION_URI = '/xyz/openbmc_project/software/'
George Keishingab5157b2017-02-09 12:24:25 -060053ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active'
Saqib Khanbb8b63f2017-05-24 10:58:01 -050054READY = 'xyz.openbmc_project.Software.Activation.Activations.Ready'
55INVALID = 'xyz.openbmc_project.Software.Activation.Activations.Invalid'
56ACTIVATING = 'xyz.openbmc_project.Software.Activation.Activations.Activating'
57NOTREADY = 'xyz.openbmc_project.Software.Activation.Activations.NotReady'
58FAILED = 'xyz.openbmc_project.Software.Activation.Activations.Failed'
59
60SOFTWARE_ACTIVATION = 'xyz.openbmc_project.Software.Activation'
61REQUESTED_ACTIVATION = SOFTWARE_ACTIVATION + '.RequestedActivations'
62REQUESTED_ACTIVE = REQUESTED_ACTIVATION + '.Active'
63REQUESTED_NONE = REQUESTED_ACTIVATION + '.None'
64
65SOFTWARE_PURPOSE = 'xyz.openbmc_project.Software.Version.VersionPurpose'
66VERSION_PURPOSE_HOST = SOFTWARE_PURPOSE + '.Host'
67VERSION_PURPOSE_BMC = SOFTWARE_PURPOSE + '.BMC'
68VERSION_PURPOSE_SYSTEM = SOFTWARE_PURPOSE + '.System'
George Keishingab5157b2017-02-09 12:24:25 -060069
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050070# Image Upload Directory Path
71IMAGE_UPLOAD_DIR_PATH = '/tmp/images/'
72
George Keishingc8166ed2017-02-24 03:53:38 -060073# Inventory URI
74HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/'
75
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060076# Led URI variable
77LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/'
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050078LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060079
George Keishing1059b222017-07-21 13:24:43 -050080# Host control URI variables.
81CONTROL_HOST_URI = '/xyz/openbmc_project/control/host0/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060082
George Keishing1c3a9662017-08-11 10:16:36 -050083# Power restore variables.
84POWER_RESTORE_URI = CONTROL_HOST_URI + 'power_restore_policy'
85CONTROL_DBUS_BASE = 'xyz.openbmc_project.Control.'
86
87RESTORE_LAST_STATE = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.Restore'
88ALWAYS_POWER_ON = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOn'
89ALWAYS_POWER_OFF = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOff'
90
Rahul Maheshwari23b18fb2017-08-01 00:30:26 -050091# Dump URI variable
92DUMP_URI = '/xyz/openbmc_project/dump/'
93DUMP_ENTRY_URI = DUMP_URI + 'entry/'
94
George Keishing2bd6fc02017-08-10 01:15:16 -050095# Boot progress variables.
96STATE_DBUS_BASE = 'xyz.openbmc_project.State.'
97OS_BOOT_START = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.OSStart'
98OS_BOOT_OFF = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.Unspecified'
99OS_BOOT_COMPLETE = STATE_DBUS_BASE + 'OperatingSystem.Status.OSStatus.BootComplete'
100
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500101# Boot variables.
102BOOT_SOURCE_DEFAULT = 'xyz.openbmc_project.Control.Boot.Source.Sources.Default'
103BOOT_SOURCE_NETWORK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Network'
104BOOT_SOURCE_DISK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Disk'
105BOOT_SOURCE_CDROM = 'xyz.openbmc_project.Control.Boot.Source.Sources.ExternalMedia'
106BOOT_MODE_SAFE = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Safe'
107BOOT_MODE_SETUP = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Setup'
108BOOT_MODE_REGULAR = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Regular'
109
George Keishingfbeaecc2016-08-16 05:24:31 -0500110'''
111 QEMU HTTPS variable:
112
113 By default lib/resource.txt AUTH URI construct is as
114 ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
115 ${AUTH_SUFFIX} is populated here by default EMPTY else
116 the port from the OS environment
117'''
George Keishingcf910442016-12-08 03:12:59 -0600118
119
George Keishingfbeaecc2016-08-16 05:24:31 -0500120def get_port_https():
121 # defaulted to empty string
122 l_suffix = ''
123 try:
124 l_https_port = os.getenv('HTTPS_PORT')
125 if l_https_port:
George Keishingcf910442016-12-08 03:12:59 -0600126 l_suffix = ':' + l_https_port
George Keishingfbeaecc2016-08-16 05:24:31 -0500127 except:
George Keishingcf910442016-12-08 03:12:59 -0600128 print "Environment variable HTTPS_PORT not set,\
129 using default HTTPS port"
George Keishingfbeaecc2016-08-16 05:24:31 -0500130 return l_suffix
131
George Keishingcf910442016-12-08 03:12:59 -0600132AUTH_SUFFIX = {
133 "https_port": [get_port_https()],
George Keishingfbeaecc2016-08-16 05:24:31 -0500134}
135
136# Update the ':Port number' to this variable
137AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
Chris Austenb29d2e82016-06-07 12:25:35 -0500138
139# Here contains a list of valid Properties bases on fru_type after a boot.
George Keishingcf910442016-12-08 03:12:59 -0600140INVENTORY_ITEMS = {
Chris Austenb29d2e82016-06-07 12:25:35 -0500141 "CPU": [
142 "Custom Field 1",
143 "Custom Field 2",
144 "Custom Field 3",
145 "Custom Field 4",
146 "Custom Field 5",
147 "Custom Field 6",
148 "Custom Field 7",
149 "Custom Field 8",
150 "FRU File ID",
151 "Manufacturer",
152 "Name",
153 "Part Number",
154 "Serial Number",
155 "fault",
156 "fru_type",
157 "is_fru",
158 "present",
159 "version",
160 ],
161
162 "DIMM": [
163 "Asset Tag",
164 "Custom Field 1",
165 "Custom Field 2",
166 "Custom Field 3",
167 "Custom Field 4",
168 "Custom Field 5",
169 "Custom Field 6",
170 "Custom Field 7",
171 "Custom Field 8",
172 "FRU File ID",
173 "Manufacturer",
174 "Model Number",
175 "Name",
176 "Serial Number",
177 "Version",
178 "fault",
179 "fru_type",
180 "is_fru",
181 "present",
182 "version",
183 ],
184 "MEMORY_BUFFER": [
185 "Custom Field 1",
186 "Custom Field 2",
187 "Custom Field 3",
188 "Custom Field 4",
189 "Custom Field 5",
190 "Custom Field 6",
191 "Custom Field 7",
192 "Custom Field 8",
193 "FRU File ID",
194 "Manufacturer",
195 "Name",
196 "Part Number",
197 "Serial Number",
198 "fault",
199 "fru_type",
200 "is_fru",
201 "present",
202 "version",
203 ],
204 "FAN": [
205 "fault",
206 "fru_type",
207 "is_fru",
208 "present",
209 "version",
210 ],
211 "DAUGHTER_CARD": [
212 "Custom Field 1",
213 "Custom Field 2",
214 "Custom Field 3",
215 "Custom Field 4",
216 "Custom Field 5",
217 "Custom Field 6",
218 "Custom Field 7",
219 "Custom Field 8",
220 "FRU File ID",
221 "Manufacturer",
222 "Name",
223 "Part Number",
224 "Serial Number",
225 "fault",
226 "fru_type",
227 "is_fru",
228 "present",
229 "version",
230 ],
231 "BMC": [
232 "fault",
233 "fru_type",
234 "is_fru",
235 "manufacturer",
236 "present",
237 "version",
238 ],
239 "MAIN_PLANAR": [
240 "Custom Field 1",
241 "Custom Field 2",
242 "Custom Field 3",
243 "Custom Field 4",
244 "Custom Field 5",
245 "Custom Field 6",
246 "Custom Field 7",
247 "Custom Field 8",
248 "Part Number",
249 "Serial Number",
250 "Type",
251 "fault",
252 "fru_type",
253 "is_fru",
254 "present",
255 "version",
256 ],
257 "SYSTEM": [
258 "Custom Field 1",
259 "Custom Field 2",
260 "Custom Field 3",
261 "Custom Field 4",
262 "Custom Field 5",
263 "Custom Field 6",
264 "Custom Field 7",
265 "Custom Field 8",
266 "FRU File ID",
267 "Manufacturer",
268 "Model Number",
269 "Name",
270 "Serial Number",
271 "Version",
272 "fault",
273 "fru_type",
274 "is_fru",
275 "present",
276 "version",
277 ],
278 "CORE": [
279 "fault",
280 "fru_type",
281 "is_fru",
282 "present",
283 "version",
284 ],
285}