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