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