blob: 342c5ee31be51d17421d9cf4e399036b6105daba [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 Keishing678b65c2017-08-31 16:16:39 -050042SYSTEM_STATE_URI = '/xyz/openbmc_project/state/'
George Keishing3c332e02017-02-23 22:10:18 -060043BMC_STATE_URI = '/xyz/openbmc_project/state/bmc0/'
George Keishingbec365b2017-01-19 01:28:41 -060044HOST_STATE_URI = '/xyz/openbmc_project/state/host0/'
45CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/'
Sridevi Ramesh0a7c0aa2017-06-26 13:03:02 -050046HOST_WATCHDOG_URI = '/xyz/openbmc_project/watchdog/host0/'
George Keishingbec365b2017-01-19 01:28:41 -060047
George Keishing505d5b42017-02-21 11:01:54 -060048# Logging URI variables
George Keishinga71dd202017-02-24 00:49:40 -060049BMC_LOGGING_URI = '/xyz/openbmc_project/logging/'
50BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/'
George Keishing505d5b42017-02-21 11:01:54 -060051
George Keishingab5157b2017-02-09 12:24:25 -060052# Software manager version
George Keishingff1e3ec2017-07-20 01:58:21 -050053SOFTWARE_VERSION_URI = '/xyz/openbmc_project/software/'
George Keishingab5157b2017-02-09 12:24:25 -060054ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active'
Saqib Khanbb8b63f2017-05-24 10:58:01 -050055READY = 'xyz.openbmc_project.Software.Activation.Activations.Ready'
56INVALID = 'xyz.openbmc_project.Software.Activation.Activations.Invalid'
57ACTIVATING = 'xyz.openbmc_project.Software.Activation.Activations.Activating'
58NOTREADY = 'xyz.openbmc_project.Software.Activation.Activations.NotReady'
59FAILED = 'xyz.openbmc_project.Software.Activation.Activations.Failed'
60
61SOFTWARE_ACTIVATION = 'xyz.openbmc_project.Software.Activation'
62REQUESTED_ACTIVATION = SOFTWARE_ACTIVATION + '.RequestedActivations'
63REQUESTED_ACTIVE = REQUESTED_ACTIVATION + '.Active'
64REQUESTED_NONE = REQUESTED_ACTIVATION + '.None'
65
66SOFTWARE_PURPOSE = 'xyz.openbmc_project.Software.Version.VersionPurpose'
67VERSION_PURPOSE_HOST = SOFTWARE_PURPOSE + '.Host'
68VERSION_PURPOSE_BMC = SOFTWARE_PURPOSE + '.BMC'
69VERSION_PURPOSE_SYSTEM = SOFTWARE_PURPOSE + '.System'
George Keishingab5157b2017-02-09 12:24:25 -060070
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050071# Image Upload Directory Path
72IMAGE_UPLOAD_DIR_PATH = '/tmp/images/'
73
George Keishingc8166ed2017-02-24 03:53:38 -060074# Inventory URI
75HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/'
76
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060077# Led URI variable
78LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/'
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050079LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060080
George Keishing1059b222017-07-21 13:24:43 -050081# Host control URI variables.
82CONTROL_HOST_URI = '/xyz/openbmc_project/control/host0/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060083
George Keishing1c3a9662017-08-11 10:16:36 -050084# Power restore variables.
85POWER_RESTORE_URI = CONTROL_HOST_URI + 'power_restore_policy'
86CONTROL_DBUS_BASE = 'xyz.openbmc_project.Control.'
87
88RESTORE_LAST_STATE = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.Restore'
89ALWAYS_POWER_ON = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOn'
90ALWAYS_POWER_OFF = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOff'
91
Rahul Maheshwari23b18fb2017-08-01 00:30:26 -050092# Dump URI variable
93DUMP_URI = '/xyz/openbmc_project/dump/'
94DUMP_ENTRY_URI = DUMP_URI + 'entry/'
95
George Keishing2bd6fc02017-08-10 01:15:16 -050096# Boot progress variables.
97STATE_DBUS_BASE = 'xyz.openbmc_project.State.'
98OS_BOOT_START = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.OSStart'
99OS_BOOT_OFF = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.Unspecified'
100OS_BOOT_COMPLETE = STATE_DBUS_BASE + 'OperatingSystem.Status.OSStatus.BootComplete'
101
Rahul Maheshwari85c4d342017-08-09 21:59:30 -0500102# Boot variables.
103BOOT_SOURCE_DEFAULT = 'xyz.openbmc_project.Control.Boot.Source.Sources.Default'
104BOOT_SOURCE_NETWORK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Network'
105BOOT_SOURCE_DISK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Disk'
106BOOT_SOURCE_CDROM = 'xyz.openbmc_project.Control.Boot.Source.Sources.ExternalMedia'
107BOOT_MODE_SAFE = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Safe'
108BOOT_MODE_SETUP = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Setup'
109BOOT_MODE_REGULAR = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Regular'
110
George Keishingfbeaecc2016-08-16 05:24:31 -0500111'''
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 Keishingcf910442016-12-08 03:12:59 -0600119
120
George Keishingfbeaecc2016-08-16 05:24:31 -0500121def 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 Keishingcf910442016-12-08 03:12:59 -0600127 l_suffix = ':' + l_https_port
George Keishingfbeaecc2016-08-16 05:24:31 -0500128 except:
George Keishingcf910442016-12-08 03:12:59 -0600129 print "Environment variable HTTPS_PORT not set,\
130 using default HTTPS port"
George Keishingfbeaecc2016-08-16 05:24:31 -0500131 return l_suffix
132
George Keishingcf910442016-12-08 03:12:59 -0600133AUTH_SUFFIX = {
134 "https_port": [get_port_https()],
George Keishingfbeaecc2016-08-16 05:24:31 -0500135}
136
137# Update the ':Port number' to this variable
138AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
Chris Austenb29d2e82016-06-07 12:25:35 -0500139
140# Here contains a list of valid Properties bases on fru_type after a boot.
George Keishingcf910442016-12-08 03:12:59 -0600141INVENTORY_ITEMS = {
Chris Austenb29d2e82016-06-07 12:25:35 -0500142 "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}