blob: 5ec07462a4e4245b07c4822a88201194916e4e5c [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
8# REST URI base endpoint paths
9CONTROL_URI = OPENBMC_BASE_URI + 'control/'
10SENSORS_URI = OPENBMC_BASE_URI + 'sensors/'
11RECORDS_URI = OPENBMC_BASE_URI + 'records/'
12BUTTONS_URI = OPENBMC_BASE_URI + 'buttons/'
13SETTINGS_URI = OPENBMC_BASE_URI + 'settings/'
14WATCHDOG_URI = OPENBMC_BASE_URI + 'watchdog/'
15INVENTORY_URI = OPENBMC_BASE_URI + 'inventory/'
16USER_MANAGER_URI = OPENBMC_BASE_URI + 'UserManager/'
17NETWORK_MANAGER_URI = OPENBMC_BASE_URI + 'NetworkManager/'
Rahul Maheshwarif8785902016-12-12 01:23:13 -060018TIME_MANAGER_URI = OPENBMC_BASE_URI + 'TimeManager/'
Prashanth Kattie79c5402017-06-08 07:40:49 -050019XYZ_NETWORK_MANAGER = '/xyz/openbmc_project/network/'
George Keishingcf910442016-12-08 03:12:59 -060020
George Keishingbec365b2017-01-19 01:28:41 -060021# State Manager base variables.
Rahul Maheshwari2f8de6c2017-01-17 07:00:22 -060022BMC_REBOOT_TRANS = 'xyz.openbmc_project.State.BMC.Transition.Reboot'
23
George Keishingbec365b2017-01-19 01:28:41 -060024HOST_POWEROFF_TRANS = 'xyz.openbmc_project.State.Host.Transition.Off'
25HOST_POWERON_TRANS = 'xyz.openbmc_project.State.Host.Transition.On'
Rahul Maheshwarif7ead242017-02-14 01:59:42 -060026HOST_REBOOT_TRANS = 'xyz.openbmc_project.State.Host.Transition.Reboot'
George Keishingbec365b2017-01-19 01:28:41 -060027HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off'
28HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running'
29
30CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off'
31CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On'
32CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off'
33CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On'
34
35# State Manager URI variables.
George Keishing3c332e02017-02-23 22:10:18 -060036BMC_STATE_URI = '/xyz/openbmc_project/state/bmc0/'
George Keishingbec365b2017-01-19 01:28:41 -060037HOST_STATE_URI = '/xyz/openbmc_project/state/host0/'
38CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/'
39
George Keishing505d5b42017-02-21 11:01:54 -060040# Logging URI variables
George Keishinga71dd202017-02-24 00:49:40 -060041BMC_LOGGING_URI = '/xyz/openbmc_project/logging/'
42BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/'
George Keishing505d5b42017-02-21 11:01:54 -060043
George Keishingab5157b2017-02-09 12:24:25 -060044# Software manager version
George Keishingff1e3ec2017-07-20 01:58:21 -050045SOFTWARE_VERSION_URI = '/xyz/openbmc_project/software/'
George Keishingab5157b2017-02-09 12:24:25 -060046ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active'
Saqib Khanbb8b63f2017-05-24 10:58:01 -050047READY = 'xyz.openbmc_project.Software.Activation.Activations.Ready'
48INVALID = 'xyz.openbmc_project.Software.Activation.Activations.Invalid'
49ACTIVATING = 'xyz.openbmc_project.Software.Activation.Activations.Activating'
50NOTREADY = 'xyz.openbmc_project.Software.Activation.Activations.NotReady'
51FAILED = 'xyz.openbmc_project.Software.Activation.Activations.Failed'
52
53SOFTWARE_ACTIVATION = 'xyz.openbmc_project.Software.Activation'
54REQUESTED_ACTIVATION = SOFTWARE_ACTIVATION + '.RequestedActivations'
55REQUESTED_ACTIVE = REQUESTED_ACTIVATION + '.Active'
56REQUESTED_NONE = REQUESTED_ACTIVATION + '.None'
57
58SOFTWARE_PURPOSE = 'xyz.openbmc_project.Software.Version.VersionPurpose'
59VERSION_PURPOSE_HOST = SOFTWARE_PURPOSE + '.Host'
60VERSION_PURPOSE_BMC = SOFTWARE_PURPOSE + '.BMC'
61VERSION_PURPOSE_SYSTEM = SOFTWARE_PURPOSE + '.System'
George Keishingab5157b2017-02-09 12:24:25 -060062
George Keishingc8166ed2017-02-24 03:53:38 -060063# Inventory URI
64HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/'
65
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060066# Led URI variable
67LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/'
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050068LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060069
George Keishing1059b222017-07-21 13:24:43 -050070# Host control URI variables.
71CONTROL_HOST_URI = '/xyz/openbmc_project/control/host0/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060072
George Keishingfbeaecc2016-08-16 05:24:31 -050073'''
74 QEMU HTTPS variable:
75
76 By default lib/resource.txt AUTH URI construct is as
77 ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
78 ${AUTH_SUFFIX} is populated here by default EMPTY else
79 the port from the OS environment
80'''
George Keishingcf910442016-12-08 03:12:59 -060081
82
George Keishingfbeaecc2016-08-16 05:24:31 -050083def get_port_https():
84 # defaulted to empty string
85 l_suffix = ''
86 try:
87 l_https_port = os.getenv('HTTPS_PORT')
88 if l_https_port:
George Keishingcf910442016-12-08 03:12:59 -060089 l_suffix = ':' + l_https_port
George Keishingfbeaecc2016-08-16 05:24:31 -050090 except:
George Keishingcf910442016-12-08 03:12:59 -060091 print "Environment variable HTTPS_PORT not set,\
92 using default HTTPS port"
George Keishingfbeaecc2016-08-16 05:24:31 -050093 return l_suffix
94
George Keishingcf910442016-12-08 03:12:59 -060095AUTH_SUFFIX = {
96 "https_port": [get_port_https()],
George Keishingfbeaecc2016-08-16 05:24:31 -050097}
98
99# Update the ':Port number' to this variable
100AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
Chris Austenb29d2e82016-06-07 12:25:35 -0500101
102# Here contains a list of valid Properties bases on fru_type after a boot.
George Keishingcf910442016-12-08 03:12:59 -0600103INVENTORY_ITEMS = {
Chris Austenb29d2e82016-06-07 12:25:35 -0500104 "CPU": [
105 "Custom Field 1",
106 "Custom Field 2",
107 "Custom Field 3",
108 "Custom Field 4",
109 "Custom Field 5",
110 "Custom Field 6",
111 "Custom Field 7",
112 "Custom Field 8",
113 "FRU File ID",
114 "Manufacturer",
115 "Name",
116 "Part Number",
117 "Serial Number",
118 "fault",
119 "fru_type",
120 "is_fru",
121 "present",
122 "version",
123 ],
124
125 "DIMM": [
126 "Asset Tag",
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 "Model Number",
138 "Name",
139 "Serial Number",
140 "Version",
141 "fault",
142 "fru_type",
143 "is_fru",
144 "present",
145 "version",
146 ],
147 "MEMORY_BUFFER": [
148 "Custom Field 1",
149 "Custom Field 2",
150 "Custom Field 3",
151 "Custom Field 4",
152 "Custom Field 5",
153 "Custom Field 6",
154 "Custom Field 7",
155 "Custom Field 8",
156 "FRU File ID",
157 "Manufacturer",
158 "Name",
159 "Part Number",
160 "Serial Number",
161 "fault",
162 "fru_type",
163 "is_fru",
164 "present",
165 "version",
166 ],
167 "FAN": [
168 "fault",
169 "fru_type",
170 "is_fru",
171 "present",
172 "version",
173 ],
174 "DAUGHTER_CARD": [
175 "Custom Field 1",
176 "Custom Field 2",
177 "Custom Field 3",
178 "Custom Field 4",
179 "Custom Field 5",
180 "Custom Field 6",
181 "Custom Field 7",
182 "Custom Field 8",
183 "FRU File ID",
184 "Manufacturer",
185 "Name",
186 "Part Number",
187 "Serial Number",
188 "fault",
189 "fru_type",
190 "is_fru",
191 "present",
192 "version",
193 ],
194 "BMC": [
195 "fault",
196 "fru_type",
197 "is_fru",
198 "manufacturer",
199 "present",
200 "version",
201 ],
202 "MAIN_PLANAR": [
203 "Custom Field 1",
204 "Custom Field 2",
205 "Custom Field 3",
206 "Custom Field 4",
207 "Custom Field 5",
208 "Custom Field 6",
209 "Custom Field 7",
210 "Custom Field 8",
211 "Part Number",
212 "Serial Number",
213 "Type",
214 "fault",
215 "fru_type",
216 "is_fru",
217 "present",
218 "version",
219 ],
220 "SYSTEM": [
221 "Custom Field 1",
222 "Custom Field 2",
223 "Custom Field 3",
224 "Custom Field 4",
225 "Custom Field 5",
226 "Custom Field 6",
227 "Custom Field 7",
228 "Custom Field 8",
229 "FRU File ID",
230 "Manufacturer",
231 "Model Number",
232 "Name",
233 "Serial Number",
234 "Version",
235 "fault",
236 "fru_type",
237 "is_fru",
238 "present",
239 "version",
240 ],
241 "CORE": [
242 "fault",
243 "fru_type",
244 "is_fru",
245 "present",
246 "version",
247 ],
248}