blob: 48cadda5789e91ac52ecd181d62416de61aaede3 [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'
25HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off'
26HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running'
27
28CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off'
29CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On'
30CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off'
31CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On'
32
33# State Manager URI variables.
34BMC_STATE_URI = '/xyz/openbmc_project/state/BMC0/'
35HOST_STATE_URI = '/xyz/openbmc_project/state/host0/'
36CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/'
37
George Keishing505d5b42017-02-21 11:01:54 -060038# Logging URI variables
39BMC_LOGGING_URI = '/xyz/openbmc_project/Logging/'
40BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'Entry/'
41
George Keishingfbeaecc2016-08-16 05:24:31 -050042'''
43 QEMU HTTPS variable:
44
45 By default lib/resource.txt AUTH URI construct is as
46 ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
47 ${AUTH_SUFFIX} is populated here by default EMPTY else
48 the port from the OS environment
49'''
George Keishingcf910442016-12-08 03:12:59 -060050
51
George Keishingfbeaecc2016-08-16 05:24:31 -050052def get_port_https():
53 # defaulted to empty string
54 l_suffix = ''
55 try:
56 l_https_port = os.getenv('HTTPS_PORT')
57 if l_https_port:
George Keishingcf910442016-12-08 03:12:59 -060058 l_suffix = ':' + l_https_port
George Keishingfbeaecc2016-08-16 05:24:31 -050059 except:
George Keishingcf910442016-12-08 03:12:59 -060060 print "Environment variable HTTPS_PORT not set,\
61 using default HTTPS port"
George Keishingfbeaecc2016-08-16 05:24:31 -050062 return l_suffix
63
George Keishingcf910442016-12-08 03:12:59 -060064AUTH_SUFFIX = {
65 "https_port": [get_port_https()],
George Keishingfbeaecc2016-08-16 05:24:31 -050066}
67
68# Update the ':Port number' to this variable
69AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
Chris Austenb29d2e82016-06-07 12:25:35 -050070
71# Here contains a list of valid Properties bases on fru_type after a boot.
George Keishingcf910442016-12-08 03:12:59 -060072INVENTORY_ITEMS = {
Chris Austenb29d2e82016-06-07 12:25:35 -050073 "CPU": [
74 "Custom Field 1",
75 "Custom Field 2",
76 "Custom Field 3",
77 "Custom Field 4",
78 "Custom Field 5",
79 "Custom Field 6",
80 "Custom Field 7",
81 "Custom Field 8",
82 "FRU File ID",
83 "Manufacturer",
84 "Name",
85 "Part Number",
86 "Serial Number",
87 "fault",
88 "fru_type",
89 "is_fru",
90 "present",
91 "version",
92 ],
93
94 "DIMM": [
95 "Asset Tag",
96 "Custom Field 1",
97 "Custom Field 2",
98 "Custom Field 3",
99 "Custom Field 4",
100 "Custom Field 5",
101 "Custom Field 6",
102 "Custom Field 7",
103 "Custom Field 8",
104 "FRU File ID",
105 "Manufacturer",
106 "Model Number",
107 "Name",
108 "Serial Number",
109 "Version",
110 "fault",
111 "fru_type",
112 "is_fru",
113 "present",
114 "version",
115 ],
116 "MEMORY_BUFFER": [
117 "Custom Field 1",
118 "Custom Field 2",
119 "Custom Field 3",
120 "Custom Field 4",
121 "Custom Field 5",
122 "Custom Field 6",
123 "Custom Field 7",
124 "Custom Field 8",
125 "FRU File ID",
126 "Manufacturer",
127 "Name",
128 "Part Number",
129 "Serial Number",
130 "fault",
131 "fru_type",
132 "is_fru",
133 "present",
134 "version",
135 ],
136 "FAN": [
137 "fault",
138 "fru_type",
139 "is_fru",
140 "present",
141 "version",
142 ],
143 "DAUGHTER_CARD": [
144 "Custom Field 1",
145 "Custom Field 2",
146 "Custom Field 3",
147 "Custom Field 4",
148 "Custom Field 5",
149 "Custom Field 6",
150 "Custom Field 7",
151 "Custom Field 8",
152 "FRU File ID",
153 "Manufacturer",
154 "Name",
155 "Part Number",
156 "Serial Number",
157 "fault",
158 "fru_type",
159 "is_fru",
160 "present",
161 "version",
162 ],
163 "BMC": [
164 "fault",
165 "fru_type",
166 "is_fru",
167 "manufacturer",
168 "present",
169 "version",
170 ],
171 "MAIN_PLANAR": [
172 "Custom Field 1",
173 "Custom Field 2",
174 "Custom Field 3",
175 "Custom Field 4",
176 "Custom Field 5",
177 "Custom Field 6",
178 "Custom Field 7",
179 "Custom Field 8",
180 "Part Number",
181 "Serial Number",
182 "Type",
183 "fault",
184 "fru_type",
185 "is_fru",
186 "present",
187 "version",
188 ],
189 "SYSTEM": [
190 "Custom Field 1",
191 "Custom Field 2",
192 "Custom Field 3",
193 "Custom Field 4",
194 "Custom Field 5",
195 "Custom Field 6",
196 "Custom Field 7",
197 "Custom Field 8",
198 "FRU File ID",
199 "Manufacturer",
200 "Model Number",
201 "Name",
202 "Serial Number",
203 "Version",
204 "fault",
205 "fru_type",
206 "is_fru",
207 "present",
208 "version",
209 ],
210 "CORE": [
211 "fault",
212 "fru_type",
213 "is_fru",
214 "present",
215 "version",
216 ],
217}