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