blob: 759bc6cc7382b25e99cc3860d463636726810825 [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'
Saqib Khanfb1f6ae2017-04-26 13:24:41 -050046READY = 'xyz.openbmc_project.Software.Activation.Activations.Ready'
47INVALID = 'xyz.openbmc_project.Software.Activation.Activations.Invalid'
48ACTIVATING = 'xyz.openbmc_project.Software.Activation.Activations.Activating'
George Keishingab5157b2017-02-09 12:24:25 -060049
George Keishingc8166ed2017-02-24 03:53:38 -060050# Inventory URI
51HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/'
52
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060053# Led URI variable
54LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/'
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050055LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060056
57
George Keishingfbeaecc2016-08-16 05:24:31 -050058'''
59 QEMU HTTPS variable:
60
61 By default lib/resource.txt AUTH URI construct is as
62 ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
63 ${AUTH_SUFFIX} is populated here by default EMPTY else
64 the port from the OS environment
65'''
George Keishingcf910442016-12-08 03:12:59 -060066
67
George Keishingfbeaecc2016-08-16 05:24:31 -050068def get_port_https():
69 # defaulted to empty string
70 l_suffix = ''
71 try:
72 l_https_port = os.getenv('HTTPS_PORT')
73 if l_https_port:
George Keishingcf910442016-12-08 03:12:59 -060074 l_suffix = ':' + l_https_port
George Keishingfbeaecc2016-08-16 05:24:31 -050075 except:
George Keishingcf910442016-12-08 03:12:59 -060076 print "Environment variable HTTPS_PORT not set,\
77 using default HTTPS port"
George Keishingfbeaecc2016-08-16 05:24:31 -050078 return l_suffix
79
George Keishingcf910442016-12-08 03:12:59 -060080AUTH_SUFFIX = {
81 "https_port": [get_port_https()],
George Keishingfbeaecc2016-08-16 05:24:31 -050082}
83
84# Update the ':Port number' to this variable
85AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
Chris Austenb29d2e82016-06-07 12:25:35 -050086
87# Here contains a list of valid Properties bases on fru_type after a boot.
George Keishingcf910442016-12-08 03:12:59 -060088INVENTORY_ITEMS = {
Chris Austenb29d2e82016-06-07 12:25:35 -050089 "CPU": [
90 "Custom Field 1",
91 "Custom Field 2",
92 "Custom Field 3",
93 "Custom Field 4",
94 "Custom Field 5",
95 "Custom Field 6",
96 "Custom Field 7",
97 "Custom Field 8",
98 "FRU File ID",
99 "Manufacturer",
100 "Name",
101 "Part Number",
102 "Serial Number",
103 "fault",
104 "fru_type",
105 "is_fru",
106 "present",
107 "version",
108 ],
109
110 "DIMM": [
111 "Asset Tag",
112 "Custom Field 1",
113 "Custom Field 2",
114 "Custom Field 3",
115 "Custom Field 4",
116 "Custom Field 5",
117 "Custom Field 6",
118 "Custom Field 7",
119 "Custom Field 8",
120 "FRU File ID",
121 "Manufacturer",
122 "Model Number",
123 "Name",
124 "Serial Number",
125 "Version",
126 "fault",
127 "fru_type",
128 "is_fru",
129 "present",
130 "version",
131 ],
132 "MEMORY_BUFFER": [
133 "Custom Field 1",
134 "Custom Field 2",
135 "Custom Field 3",
136 "Custom Field 4",
137 "Custom Field 5",
138 "Custom Field 6",
139 "Custom Field 7",
140 "Custom Field 8",
141 "FRU File ID",
142 "Manufacturer",
143 "Name",
144 "Part Number",
145 "Serial Number",
146 "fault",
147 "fru_type",
148 "is_fru",
149 "present",
150 "version",
151 ],
152 "FAN": [
153 "fault",
154 "fru_type",
155 "is_fru",
156 "present",
157 "version",
158 ],
159 "DAUGHTER_CARD": [
160 "Custom Field 1",
161 "Custom Field 2",
162 "Custom Field 3",
163 "Custom Field 4",
164 "Custom Field 5",
165 "Custom Field 6",
166 "Custom Field 7",
167 "Custom Field 8",
168 "FRU File ID",
169 "Manufacturer",
170 "Name",
171 "Part Number",
172 "Serial Number",
173 "fault",
174 "fru_type",
175 "is_fru",
176 "present",
177 "version",
178 ],
179 "BMC": [
180 "fault",
181 "fru_type",
182 "is_fru",
183 "manufacturer",
184 "present",
185 "version",
186 ],
187 "MAIN_PLANAR": [
188 "Custom Field 1",
189 "Custom Field 2",
190 "Custom Field 3",
191 "Custom Field 4",
192 "Custom Field 5",
193 "Custom Field 6",
194 "Custom Field 7",
195 "Custom Field 8",
196 "Part Number",
197 "Serial Number",
198 "Type",
199 "fault",
200 "fru_type",
201 "is_fru",
202 "present",
203 "version",
204 ],
205 "SYSTEM": [
206 "Custom Field 1",
207 "Custom Field 2",
208 "Custom Field 3",
209 "Custom Field 4",
210 "Custom Field 5",
211 "Custom Field 6",
212 "Custom Field 7",
213 "Custom Field 8",
214 "FRU File ID",
215 "Manufacturer",
216 "Model Number",
217 "Name",
218 "Serial Number",
219 "Version",
220 "fault",
221 "fru_type",
222 "is_fru",
223 "present",
224 "version",
225 ],
226 "CORE": [
227 "fault",
228 "fru_type",
229 "is_fru",
230 "present",
231 "version",
232 ],
233}