blob: 2070c5194bdd3e0b5ef40d0ca9261f6d7df4d12a [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/'
52
53
George Keishingfbeaecc2016-08-16 05:24:31 -050054'''
55 QEMU HTTPS variable:
56
57 By default lib/resource.txt AUTH URI construct is as
58 ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
59 ${AUTH_SUFFIX} is populated here by default EMPTY else
60 the port from the OS environment
61'''
George Keishingcf910442016-12-08 03:12:59 -060062
63
George Keishingfbeaecc2016-08-16 05:24:31 -050064def get_port_https():
65 # defaulted to empty string
66 l_suffix = ''
67 try:
68 l_https_port = os.getenv('HTTPS_PORT')
69 if l_https_port:
George Keishingcf910442016-12-08 03:12:59 -060070 l_suffix = ':' + l_https_port
George Keishingfbeaecc2016-08-16 05:24:31 -050071 except:
George Keishingcf910442016-12-08 03:12:59 -060072 print "Environment variable HTTPS_PORT not set,\
73 using default HTTPS port"
George Keishingfbeaecc2016-08-16 05:24:31 -050074 return l_suffix
75
George Keishingcf910442016-12-08 03:12:59 -060076AUTH_SUFFIX = {
77 "https_port": [get_port_https()],
George Keishingfbeaecc2016-08-16 05:24:31 -050078}
79
80# Update the ':Port number' to this variable
81AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
Chris Austenb29d2e82016-06-07 12:25:35 -050082
83# Here contains a list of valid Properties bases on fru_type after a boot.
George Keishingcf910442016-12-08 03:12:59 -060084INVENTORY_ITEMS = {
Chris Austenb29d2e82016-06-07 12:25:35 -050085 "CPU": [
86 "Custom Field 1",
87 "Custom Field 2",
88 "Custom Field 3",
89 "Custom Field 4",
90 "Custom Field 5",
91 "Custom Field 6",
92 "Custom Field 7",
93 "Custom Field 8",
94 "FRU File ID",
95 "Manufacturer",
96 "Name",
97 "Part Number",
98 "Serial Number",
99 "fault",
100 "fru_type",
101 "is_fru",
102 "present",
103 "version",
104 ],
105
106 "DIMM": [
107 "Asset Tag",
108 "Custom Field 1",
109 "Custom Field 2",
110 "Custom Field 3",
111 "Custom Field 4",
112 "Custom Field 5",
113 "Custom Field 6",
114 "Custom Field 7",
115 "Custom Field 8",
116 "FRU File ID",
117 "Manufacturer",
118 "Model Number",
119 "Name",
120 "Serial Number",
121 "Version",
122 "fault",
123 "fru_type",
124 "is_fru",
125 "present",
126 "version",
127 ],
128 "MEMORY_BUFFER": [
129 "Custom Field 1",
130 "Custom Field 2",
131 "Custom Field 3",
132 "Custom Field 4",
133 "Custom Field 5",
134 "Custom Field 6",
135 "Custom Field 7",
136 "Custom Field 8",
137 "FRU File ID",
138 "Manufacturer",
139 "Name",
140 "Part Number",
141 "Serial Number",
142 "fault",
143 "fru_type",
144 "is_fru",
145 "present",
146 "version",
147 ],
148 "FAN": [
149 "fault",
150 "fru_type",
151 "is_fru",
152 "present",
153 "version",
154 ],
155 "DAUGHTER_CARD": [
156 "Custom Field 1",
157 "Custom Field 2",
158 "Custom Field 3",
159 "Custom Field 4",
160 "Custom Field 5",
161 "Custom Field 6",
162 "Custom Field 7",
163 "Custom Field 8",
164 "FRU File ID",
165 "Manufacturer",
166 "Name",
167 "Part Number",
168 "Serial Number",
169 "fault",
170 "fru_type",
171 "is_fru",
172 "present",
173 "version",
174 ],
175 "BMC": [
176 "fault",
177 "fru_type",
178 "is_fru",
179 "manufacturer",
180 "present",
181 "version",
182 ],
183 "MAIN_PLANAR": [
184 "Custom Field 1",
185 "Custom Field 2",
186 "Custom Field 3",
187 "Custom Field 4",
188 "Custom Field 5",
189 "Custom Field 6",
190 "Custom Field 7",
191 "Custom Field 8",
192 "Part Number",
193 "Serial Number",
194 "Type",
195 "fault",
196 "fru_type",
197 "is_fru",
198 "present",
199 "version",
200 ],
201 "SYSTEM": [
202 "Custom Field 1",
203 "Custom Field 2",
204 "Custom Field 3",
205 "Custom Field 4",
206 "Custom Field 5",
207 "Custom Field 6",
208 "Custom Field 7",
209 "Custom Field 8",
210 "FRU File ID",
211 "Manufacturer",
212 "Model Number",
213 "Name",
214 "Serial Number",
215 "Version",
216 "fault",
217 "fru_type",
218 "is_fru",
219 "present",
220 "version",
221 ],
222 "CORE": [
223 "fault",
224 "fru_type",
225 "is_fru",
226 "present",
227 "version",
228 ],
229}