blob: 8d86e6fd8c838cd1a41d5f0abbc3f4cf4e9af697 [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/'
George Keishingcf910442016-12-08 03:12:59 -060019
George Keishingbec365b2017-01-19 01:28:41 -060020# State Manager base variables.
Rahul Maheshwari2f8de6c2017-01-17 07:00:22 -060021BMC_REBOOT_TRANS = 'xyz.openbmc_project.State.BMC.Transition.Reboot'
22
George Keishingbec365b2017-01-19 01:28:41 -060023HOST_POWEROFF_TRANS = 'xyz.openbmc_project.State.Host.Transition.Off'
24HOST_POWERON_TRANS = 'xyz.openbmc_project.State.Host.Transition.On'
Rahul Maheshwarif7ead242017-02-14 01:59:42 -060025HOST_REBOOT_TRANS = 'xyz.openbmc_project.State.Host.Transition.Reboot'
George Keishingbec365b2017-01-19 01:28:41 -060026HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off'
27HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running'
28
29CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off'
30CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On'
31CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off'
32CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On'
33
34# State Manager URI variables.
George Keishing3c332e02017-02-23 22:10:18 -060035BMC_STATE_URI = '/xyz/openbmc_project/state/bmc0/'
George Keishingbec365b2017-01-19 01:28:41 -060036HOST_STATE_URI = '/xyz/openbmc_project/state/host0/'
37CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/'
38
George Keishing505d5b42017-02-21 11:01:54 -060039# Logging URI variables
George Keishinga71dd202017-02-24 00:49:40 -060040BMC_LOGGING_URI = '/xyz/openbmc_project/logging/'
41BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/'
George Keishing505d5b42017-02-21 11:01:54 -060042
George Keishingab5157b2017-02-09 12:24:25 -060043# Software manager version
44SOFTWARE_VERSION_URI = '/xyz/openbmc_project/software/'
45ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active'
46
George Keishingc8166ed2017-02-24 03:53:38 -060047# Inventory URI
48HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/'
49
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060050# Led URI variable
51LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/'
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050052LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060053
54
George Keishingfbeaecc2016-08-16 05:24:31 -050055'''
56 QEMU HTTPS variable:
57
58 By default lib/resource.txt AUTH URI construct is as
59 ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
60 ${AUTH_SUFFIX} is populated here by default EMPTY else
61 the port from the OS environment
62'''
George Keishingcf910442016-12-08 03:12:59 -060063
64
George Keishingfbeaecc2016-08-16 05:24:31 -050065def get_port_https():
66 # defaulted to empty string
67 l_suffix = ''
68 try:
69 l_https_port = os.getenv('HTTPS_PORT')
70 if l_https_port:
George Keishingcf910442016-12-08 03:12:59 -060071 l_suffix = ':' + l_https_port
George Keishingfbeaecc2016-08-16 05:24:31 -050072 except:
George Keishingcf910442016-12-08 03:12:59 -060073 print "Environment variable HTTPS_PORT not set,\
74 using default HTTPS port"
George Keishingfbeaecc2016-08-16 05:24:31 -050075 return l_suffix
76
George Keishingcf910442016-12-08 03:12:59 -060077AUTH_SUFFIX = {
78 "https_port": [get_port_https()],
George Keishingfbeaecc2016-08-16 05:24:31 -050079}
80
81# Update the ':Port number' to this variable
82AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
Chris Austenb29d2e82016-06-07 12:25:35 -050083
84# Here contains a list of valid Properties bases on fru_type after a boot.
George Keishingcf910442016-12-08 03:12:59 -060085INVENTORY_ITEMS = {
Chris Austenb29d2e82016-06-07 12:25:35 -050086 "CPU": [
87 "Custom Field 1",
88 "Custom Field 2",
89 "Custom Field 3",
90 "Custom Field 4",
91 "Custom Field 5",
92 "Custom Field 6",
93 "Custom Field 7",
94 "Custom Field 8",
95 "FRU File ID",
96 "Manufacturer",
97 "Name",
98 "Part Number",
99 "Serial Number",
100 "fault",
101 "fru_type",
102 "is_fru",
103 "present",
104 "version",
105 ],
106
107 "DIMM": [
108 "Asset Tag",
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 "Model Number",
120 "Name",
121 "Serial Number",
122 "Version",
123 "fault",
124 "fru_type",
125 "is_fru",
126 "present",
127 "version",
128 ],
129 "MEMORY_BUFFER": [
130 "Custom Field 1",
131 "Custom Field 2",
132 "Custom Field 3",
133 "Custom Field 4",
134 "Custom Field 5",
135 "Custom Field 6",
136 "Custom Field 7",
137 "Custom Field 8",
138 "FRU File ID",
139 "Manufacturer",
140 "Name",
141 "Part Number",
142 "Serial Number",
143 "fault",
144 "fru_type",
145 "is_fru",
146 "present",
147 "version",
148 ],
149 "FAN": [
150 "fault",
151 "fru_type",
152 "is_fru",
153 "present",
154 "version",
155 ],
156 "DAUGHTER_CARD": [
157 "Custom Field 1",
158 "Custom Field 2",
159 "Custom Field 3",
160 "Custom Field 4",
161 "Custom Field 5",
162 "Custom Field 6",
163 "Custom Field 7",
164 "Custom Field 8",
165 "FRU File ID",
166 "Manufacturer",
167 "Name",
168 "Part Number",
169 "Serial Number",
170 "fault",
171 "fru_type",
172 "is_fru",
173 "present",
174 "version",
175 ],
176 "BMC": [
177 "fault",
178 "fru_type",
179 "is_fru",
180 "manufacturer",
181 "present",
182 "version",
183 ],
184 "MAIN_PLANAR": [
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 "Part Number",
194 "Serial Number",
195 "Type",
196 "fault",
197 "fru_type",
198 "is_fru",
199 "present",
200 "version",
201 ],
202 "SYSTEM": [
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 "FRU File ID",
212 "Manufacturer",
213 "Model Number",
214 "Name",
215 "Serial Number",
216 "Version",
217 "fault",
218 "fru_type",
219 "is_fru",
220 "present",
221 "version",
222 ],
223 "CORE": [
224 "fault",
225 "fru_type",
226 "is_fru",
227 "present",
228 "version",
229 ],
230}