blob: e5306eaf4461b28cf10603a47e956e8d02e36956 [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
Rahul Maheshwari23b18fb2017-08-01 00:30:26 -050073# Dump URI variable
74DUMP_URI = '/xyz/openbmc_project/dump/'
75DUMP_ENTRY_URI = DUMP_URI + 'entry/'
76
George Keishingfbeaecc2016-08-16 05:24:31 -050077'''
78 QEMU HTTPS variable:
79
80 By default lib/resource.txt AUTH URI construct is as
81 ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
82 ${AUTH_SUFFIX} is populated here by default EMPTY else
83 the port from the OS environment
84'''
George Keishingcf910442016-12-08 03:12:59 -060085
86
George Keishingfbeaecc2016-08-16 05:24:31 -050087def get_port_https():
88 # defaulted to empty string
89 l_suffix = ''
90 try:
91 l_https_port = os.getenv('HTTPS_PORT')
92 if l_https_port:
George Keishingcf910442016-12-08 03:12:59 -060093 l_suffix = ':' + l_https_port
George Keishingfbeaecc2016-08-16 05:24:31 -050094 except:
George Keishingcf910442016-12-08 03:12:59 -060095 print "Environment variable HTTPS_PORT not set,\
96 using default HTTPS port"
George Keishingfbeaecc2016-08-16 05:24:31 -050097 return l_suffix
98
George Keishingcf910442016-12-08 03:12:59 -060099AUTH_SUFFIX = {
100 "https_port": [get_port_https()],
George Keishingfbeaecc2016-08-16 05:24:31 -0500101}
102
103# Update the ':Port number' to this variable
104AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
Chris Austenb29d2e82016-06-07 12:25:35 -0500105
106# Here contains a list of valid Properties bases on fru_type after a boot.
George Keishingcf910442016-12-08 03:12:59 -0600107INVENTORY_ITEMS = {
Chris Austenb29d2e82016-06-07 12:25:35 -0500108 "CPU": [
109 "Custom Field 1",
110 "Custom Field 2",
111 "Custom Field 3",
112 "Custom Field 4",
113 "Custom Field 5",
114 "Custom Field 6",
115 "Custom Field 7",
116 "Custom Field 8",
117 "FRU File ID",
118 "Manufacturer",
119 "Name",
120 "Part Number",
121 "Serial Number",
122 "fault",
123 "fru_type",
124 "is_fru",
125 "present",
126 "version",
127 ],
128
129 "DIMM": [
130 "Asset Tag",
131 "Custom Field 1",
132 "Custom Field 2",
133 "Custom Field 3",
134 "Custom Field 4",
135 "Custom Field 5",
136 "Custom Field 6",
137 "Custom Field 7",
138 "Custom Field 8",
139 "FRU File ID",
140 "Manufacturer",
141 "Model Number",
142 "Name",
143 "Serial Number",
144 "Version",
145 "fault",
146 "fru_type",
147 "is_fru",
148 "present",
149 "version",
150 ],
151 "MEMORY_BUFFER": [
152 "Custom Field 1",
153 "Custom Field 2",
154 "Custom Field 3",
155 "Custom Field 4",
156 "Custom Field 5",
157 "Custom Field 6",
158 "Custom Field 7",
159 "Custom Field 8",
160 "FRU File ID",
161 "Manufacturer",
162 "Name",
163 "Part Number",
164 "Serial Number",
165 "fault",
166 "fru_type",
167 "is_fru",
168 "present",
169 "version",
170 ],
171 "FAN": [
172 "fault",
173 "fru_type",
174 "is_fru",
175 "present",
176 "version",
177 ],
178 "DAUGHTER_CARD": [
179 "Custom Field 1",
180 "Custom Field 2",
181 "Custom Field 3",
182 "Custom Field 4",
183 "Custom Field 5",
184 "Custom Field 6",
185 "Custom Field 7",
186 "Custom Field 8",
187 "FRU File ID",
188 "Manufacturer",
189 "Name",
190 "Part Number",
191 "Serial Number",
192 "fault",
193 "fru_type",
194 "is_fru",
195 "present",
196 "version",
197 ],
198 "BMC": [
199 "fault",
200 "fru_type",
201 "is_fru",
202 "manufacturer",
203 "present",
204 "version",
205 ],
206 "MAIN_PLANAR": [
207 "Custom Field 1",
208 "Custom Field 2",
209 "Custom Field 3",
210 "Custom Field 4",
211 "Custom Field 5",
212 "Custom Field 6",
213 "Custom Field 7",
214 "Custom Field 8",
215 "Part Number",
216 "Serial Number",
217 "Type",
218 "fault",
219 "fru_type",
220 "is_fru",
221 "present",
222 "version",
223 ],
224 "SYSTEM": [
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 "FRU File ID",
234 "Manufacturer",
235 "Model Number",
236 "Name",
237 "Serial Number",
238 "Version",
239 "fault",
240 "fru_type",
241 "is_fru",
242 "present",
243 "version",
244 ],
245 "CORE": [
246 "fault",
247 "fru_type",
248 "is_fru",
249 "present",
250 "version",
251 ],
252}