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. |
| 34 | BMC_STATE_URI = '/xyz/openbmc_project/state/BMC0/' |
| 35 | HOST_STATE_URI = '/xyz/openbmc_project/state/host0/' |
| 36 | CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/' |
| 37 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 38 | ''' |
| 39 | QEMU HTTPS variable: |
| 40 | |
| 41 | By default lib/resource.txt AUTH URI construct is as |
| 42 | ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX} |
| 43 | ${AUTH_SUFFIX} is populated here by default EMPTY else |
| 44 | the port from the OS environment |
| 45 | ''' |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 46 | |
| 47 | |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 48 | def get_port_https(): |
| 49 | # defaulted to empty string |
| 50 | l_suffix = '' |
| 51 | try: |
| 52 | l_https_port = os.getenv('HTTPS_PORT') |
| 53 | if l_https_port: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 54 | l_suffix = ':' + l_https_port |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 55 | except: |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 56 | print "Environment variable HTTPS_PORT not set,\ |
| 57 | using default HTTPS port" |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 58 | return l_suffix |
| 59 | |
George Keishing | cf91044 | 2016-12-08 03:12:59 -0600 | [diff] [blame] | 60 | AUTH_SUFFIX = { |
| 61 | "https_port": [get_port_https()], |
George Keishing | fbeaecc | 2016-08-16 05:24:31 -0500 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | # Update the ':Port number' to this variable |
| 65 | AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0] |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 66 | |
| 67 | # 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] | 68 | INVENTORY_ITEMS = { |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 69 | "CPU": [ |
| 70 | "Custom Field 1", |
| 71 | "Custom Field 2", |
| 72 | "Custom Field 3", |
| 73 | "Custom Field 4", |
| 74 | "Custom Field 5", |
| 75 | "Custom Field 6", |
| 76 | "Custom Field 7", |
| 77 | "Custom Field 8", |
| 78 | "FRU File ID", |
| 79 | "Manufacturer", |
| 80 | "Name", |
| 81 | "Part Number", |
| 82 | "Serial Number", |
| 83 | "fault", |
| 84 | "fru_type", |
| 85 | "is_fru", |
| 86 | "present", |
| 87 | "version", |
| 88 | ], |
| 89 | |
| 90 | "DIMM": [ |
| 91 | "Asset Tag", |
| 92 | "Custom Field 1", |
| 93 | "Custom Field 2", |
| 94 | "Custom Field 3", |
| 95 | "Custom Field 4", |
| 96 | "Custom Field 5", |
| 97 | "Custom Field 6", |
| 98 | "Custom Field 7", |
| 99 | "Custom Field 8", |
| 100 | "FRU File ID", |
| 101 | "Manufacturer", |
| 102 | "Model Number", |
| 103 | "Name", |
| 104 | "Serial Number", |
| 105 | "Version", |
| 106 | "fault", |
| 107 | "fru_type", |
| 108 | "is_fru", |
| 109 | "present", |
| 110 | "version", |
| 111 | ], |
| 112 | "MEMORY_BUFFER": [ |
| 113 | "Custom Field 1", |
| 114 | "Custom Field 2", |
| 115 | "Custom Field 3", |
| 116 | "Custom Field 4", |
| 117 | "Custom Field 5", |
| 118 | "Custom Field 6", |
| 119 | "Custom Field 7", |
| 120 | "Custom Field 8", |
| 121 | "FRU File ID", |
| 122 | "Manufacturer", |
| 123 | "Name", |
| 124 | "Part Number", |
| 125 | "Serial Number", |
| 126 | "fault", |
| 127 | "fru_type", |
| 128 | "is_fru", |
| 129 | "present", |
| 130 | "version", |
| 131 | ], |
| 132 | "FAN": [ |
| 133 | "fault", |
| 134 | "fru_type", |
| 135 | "is_fru", |
| 136 | "present", |
| 137 | "version", |
| 138 | ], |
| 139 | "DAUGHTER_CARD": [ |
| 140 | "Custom Field 1", |
| 141 | "Custom Field 2", |
| 142 | "Custom Field 3", |
| 143 | "Custom Field 4", |
| 144 | "Custom Field 5", |
| 145 | "Custom Field 6", |
| 146 | "Custom Field 7", |
| 147 | "Custom Field 8", |
| 148 | "FRU File ID", |
| 149 | "Manufacturer", |
| 150 | "Name", |
| 151 | "Part Number", |
| 152 | "Serial Number", |
| 153 | "fault", |
| 154 | "fru_type", |
| 155 | "is_fru", |
| 156 | "present", |
| 157 | "version", |
| 158 | ], |
| 159 | "BMC": [ |
| 160 | "fault", |
| 161 | "fru_type", |
| 162 | "is_fru", |
| 163 | "manufacturer", |
| 164 | "present", |
| 165 | "version", |
| 166 | ], |
| 167 | "MAIN_PLANAR": [ |
| 168 | "Custom Field 1", |
| 169 | "Custom Field 2", |
| 170 | "Custom Field 3", |
| 171 | "Custom Field 4", |
| 172 | "Custom Field 5", |
| 173 | "Custom Field 6", |
| 174 | "Custom Field 7", |
| 175 | "Custom Field 8", |
| 176 | "Part Number", |
| 177 | "Serial Number", |
| 178 | "Type", |
| 179 | "fault", |
| 180 | "fru_type", |
| 181 | "is_fru", |
| 182 | "present", |
| 183 | "version", |
| 184 | ], |
| 185 | "SYSTEM": [ |
| 186 | "Custom Field 1", |
| 187 | "Custom Field 2", |
| 188 | "Custom Field 3", |
| 189 | "Custom Field 4", |
| 190 | "Custom Field 5", |
| 191 | "Custom Field 6", |
| 192 | "Custom Field 7", |
| 193 | "Custom Field 8", |
| 194 | "FRU File ID", |
| 195 | "Manufacturer", |
| 196 | "Model Number", |
| 197 | "Name", |
| 198 | "Serial Number", |
| 199 | "Version", |
| 200 | "fault", |
| 201 | "fru_type", |
| 202 | "is_fru", |
| 203 | "present", |
| 204 | "version", |
| 205 | ], |
| 206 | "CORE": [ |
| 207 | "fault", |
| 208 | "fru_type", |
| 209 | "is_fru", |
| 210 | "present", |
| 211 | "version", |
| 212 | ], |
| 213 | } |