| George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 1 | import os | 
 | 2 |  | 
| George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 3 | # Enable when ready with openbmc/openbmc-test-automation#203 | 
 | 4 | # replace with new path /xyz/openbmc_project | 
 | 5 | OPENBMC_BASE_URI = '/org/openbmc/' | 
 | 6 | OPENBMC_BASE_DBUS = 'org.openbmc' | 
 | 7 |  | 
 | 8 | # REST URI base endpoint paths | 
 | 9 | CONTROL_URI = OPENBMC_BASE_URI + 'control/' | 
 | 10 | SENSORS_URI = OPENBMC_BASE_URI + 'sensors/' | 
 | 11 | RECORDS_URI = OPENBMC_BASE_URI + 'records/' | 
 | 12 | BUTTONS_URI = OPENBMC_BASE_URI + 'buttons/' | 
 | 13 | SETTINGS_URI = OPENBMC_BASE_URI + 'settings/' | 
 | 14 | WATCHDOG_URI = OPENBMC_BASE_URI + 'watchdog/' | 
 | 15 | INVENTORY_URI = OPENBMC_BASE_URI + 'inventory/' | 
 | 16 | USER_MANAGER_URI = OPENBMC_BASE_URI + 'UserManager/' | 
 | 17 | NETWORK_MANAGER_URI = OPENBMC_BASE_URI + 'NetworkManager/' | 
| Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 18 | TIME_MANAGER_URI = OPENBMC_BASE_URI + 'TimeManager/' | 
| George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 19 |  | 
| George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 20 | # State Manager base variables. | 
| Rahul Maheshwari | 2f8de6c | 2017-01-17 07:00:22 -0600 | [diff] [blame] | 21 | BMC_REBOOT_TRANS = 'xyz.openbmc_project.State.BMC.Transition.Reboot' | 
 | 22 |  | 
| George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 23 | HOST_POWEROFF_TRANS = 'xyz.openbmc_project.State.Host.Transition.Off' | 
 | 24 | HOST_POWERON_TRANS = 'xyz.openbmc_project.State.Host.Transition.On' | 
 | 25 | HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off' | 
 | 26 | HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running' | 
 | 27 |  | 
 | 28 | CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off' | 
 | 29 | CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On' | 
 | 30 | CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off' | 
 | 31 | CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On' | 
 | 32 |  | 
 | 33 | # State Manager URI variables. | 
| George Keishing | 3c332e0 | 2017-02-23 22:10:18 -0600 | [diff] [blame] | 34 | BMC_STATE_URI = '/xyz/openbmc_project/state/bmc0/' | 
| George Keishing | bec365b | 2017-01-19 01:28:41 -0600 | [diff] [blame] | 35 | HOST_STATE_URI = '/xyz/openbmc_project/state/host0/' | 
 | 36 | CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/' | 
 | 37 |  | 
| George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 38 | # Logging URI variables | 
| George Keishing | a71dd20 | 2017-02-24 00:49:40 -0600 | [diff] [blame] | 39 | BMC_LOGGING_URI = '/xyz/openbmc_project/logging/' | 
 | 40 | BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/' | 
| George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 41 |  | 
| George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 42 | # Software manager version | 
 | 43 | SOFTWARE_VERSION_URI = '/xyz/openbmc_project/software/' | 
 | 44 | ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active' | 
 | 45 |  | 
| George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 46 | ''' | 
 | 47 |   QEMU HTTPS variable: | 
 | 48 |  | 
 | 49 |   By default lib/resource.txt AUTH URI construct is as | 
 | 50 |   ${AUTH_URI}   https://${OPENBMC_HOST}${AUTH_SUFFIX} | 
 | 51 |   ${AUTH_SUFFIX} is populated here by default EMPTY else | 
 | 52 |   the port from the OS environment | 
 | 53 | ''' | 
| George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 54 |  | 
 | 55 |  | 
| George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 56 | def get_port_https(): | 
 | 57 |     # defaulted to empty string | 
 | 58 |     l_suffix = '' | 
 | 59 |     try: | 
 | 60 |         l_https_port = os.getenv('HTTPS_PORT') | 
 | 61 |         if l_https_port: | 
| George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 62 |             l_suffix = ':' + l_https_port | 
| George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 63 |     except: | 
| George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 64 |         print "Environment variable HTTPS_PORT not set,\ | 
 | 65 |               using default HTTPS port" | 
| George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 66 |     return l_suffix | 
 | 67 |  | 
| George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 68 | AUTH_SUFFIX = { | 
 | 69 |     "https_port": [get_port_https()], | 
| George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 70 | } | 
 | 71 |  | 
 | 72 | # Update the ':Port number' to this variable | 
 | 73 | AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0] | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 74 |  | 
 | 75 | # Here contains a list of valid Properties bases on fru_type after a boot. | 
| George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 76 | INVENTORY_ITEMS = { | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 77 |     "CPU": [ | 
 | 78 |         "Custom Field 1", | 
 | 79 |         "Custom Field 2", | 
 | 80 |         "Custom Field 3", | 
 | 81 |         "Custom Field 4", | 
 | 82 |         "Custom Field 5", | 
 | 83 |         "Custom Field 6", | 
 | 84 |         "Custom Field 7", | 
 | 85 |         "Custom Field 8", | 
 | 86 |         "FRU File ID", | 
 | 87 |         "Manufacturer", | 
 | 88 |         "Name", | 
 | 89 |         "Part Number", | 
 | 90 |         "Serial Number", | 
 | 91 |         "fault", | 
 | 92 |         "fru_type", | 
 | 93 |         "is_fru", | 
 | 94 |         "present", | 
 | 95 |         "version", | 
 | 96 |         ], | 
 | 97 |  | 
 | 98 |     "DIMM": [ | 
 | 99 |         "Asset Tag", | 
 | 100 |         "Custom Field 1", | 
 | 101 |         "Custom Field 2", | 
 | 102 |         "Custom Field 3", | 
 | 103 |         "Custom Field 4", | 
 | 104 |         "Custom Field 5", | 
 | 105 |         "Custom Field 6", | 
 | 106 |         "Custom Field 7", | 
 | 107 |         "Custom Field 8", | 
 | 108 |         "FRU File ID", | 
 | 109 |         "Manufacturer", | 
 | 110 |         "Model Number", | 
 | 111 |         "Name", | 
 | 112 |         "Serial Number", | 
 | 113 |         "Version", | 
 | 114 |         "fault", | 
 | 115 |         "fru_type", | 
 | 116 |         "is_fru", | 
 | 117 |         "present", | 
 | 118 |         "version", | 
 | 119 |         ], | 
 | 120 |     "MEMORY_BUFFER": [ | 
 | 121 |         "Custom Field 1", | 
 | 122 |         "Custom Field 2", | 
 | 123 |         "Custom Field 3", | 
 | 124 |         "Custom Field 4", | 
 | 125 |         "Custom Field 5", | 
 | 126 |         "Custom Field 6", | 
 | 127 |         "Custom Field 7", | 
 | 128 |         "Custom Field 8", | 
 | 129 |         "FRU File ID", | 
 | 130 |         "Manufacturer", | 
 | 131 |         "Name", | 
 | 132 |         "Part Number", | 
 | 133 |         "Serial Number", | 
 | 134 |         "fault", | 
 | 135 |         "fru_type", | 
 | 136 |         "is_fru", | 
 | 137 |         "present", | 
 | 138 |         "version", | 
 | 139 |         ], | 
 | 140 |     "FAN": [ | 
 | 141 |         "fault", | 
 | 142 |         "fru_type", | 
 | 143 |         "is_fru", | 
 | 144 |         "present", | 
 | 145 |         "version", | 
 | 146 |         ], | 
 | 147 |     "DAUGHTER_CARD": [ | 
 | 148 |         "Custom Field 1", | 
 | 149 |         "Custom Field 2", | 
 | 150 |         "Custom Field 3", | 
 | 151 |         "Custom Field 4", | 
 | 152 |         "Custom Field 5", | 
 | 153 |         "Custom Field 6", | 
 | 154 |         "Custom Field 7", | 
 | 155 |         "Custom Field 8", | 
 | 156 |         "FRU File ID", | 
 | 157 |         "Manufacturer", | 
 | 158 |         "Name", | 
 | 159 |         "Part Number", | 
 | 160 |         "Serial Number", | 
 | 161 |         "fault", | 
 | 162 |         "fru_type", | 
 | 163 |         "is_fru", | 
 | 164 |         "present", | 
 | 165 |         "version", | 
 | 166 |         ], | 
 | 167 |     "BMC": [ | 
 | 168 |         "fault", | 
 | 169 |         "fru_type", | 
 | 170 |         "is_fru", | 
 | 171 |         "manufacturer", | 
 | 172 |         "present", | 
 | 173 |         "version", | 
 | 174 |         ], | 
 | 175 |     "MAIN_PLANAR": [ | 
 | 176 |         "Custom Field 1", | 
 | 177 |         "Custom Field 2", | 
 | 178 |         "Custom Field 3", | 
 | 179 |         "Custom Field 4", | 
 | 180 |         "Custom Field 5", | 
 | 181 |         "Custom Field 6", | 
 | 182 |         "Custom Field 7", | 
 | 183 |         "Custom Field 8", | 
 | 184 |         "Part Number", | 
 | 185 |         "Serial Number", | 
 | 186 |         "Type", | 
 | 187 |         "fault", | 
 | 188 |         "fru_type", | 
 | 189 |         "is_fru", | 
 | 190 |         "present", | 
 | 191 |         "version", | 
 | 192 |         ], | 
 | 193 |     "SYSTEM": [ | 
 | 194 |         "Custom Field 1", | 
 | 195 |         "Custom Field 2", | 
 | 196 |         "Custom Field 3", | 
 | 197 |         "Custom Field 4", | 
 | 198 |         "Custom Field 5", | 
 | 199 |         "Custom Field 6", | 
 | 200 |         "Custom Field 7", | 
 | 201 |         "Custom Field 8", | 
 | 202 |         "FRU File ID", | 
 | 203 |         "Manufacturer", | 
 | 204 |         "Model Number", | 
 | 205 |         "Name", | 
 | 206 |         "Serial Number", | 
 | 207 |         "Version", | 
 | 208 |         "fault", | 
 | 209 |         "fru_type", | 
 | 210 |         "is_fru", | 
 | 211 |         "present", | 
 | 212 |         "version", | 
 | 213 |         ], | 
 | 214 |     "CORE": [ | 
 | 215 |         "fault", | 
 | 216 |         "fru_type", | 
 | 217 |         "is_fru", | 
 | 218 |         "present", | 
 | 219 |         "version", | 
 | 220 |         ], | 
 | 221 | } |