1import os 2 3# 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/' 18TIME_MANAGER_URI = OPENBMC_BASE_URI + 'TimeManager/' 19 20# State Manager base variables. 21BMC_REBOOT_TRANS = 'xyz.openbmc_project.State.BMC.Transition.Reboot' 22 23HOST_POWEROFF_TRANS = 'xyz.openbmc_project.State.Host.Transition.Off' 24HOST_POWERON_TRANS = 'xyz.openbmc_project.State.Host.Transition.On' 25HOST_REBOOT_TRANS = 'xyz.openbmc_project.State.Host.Transition.Reboot' 26HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off' 27HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running' 28 29CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off' 30CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On' 31CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off' 32CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On' 33 34# State Manager URI variables. 35BMC_STATE_URI = '/xyz/openbmc_project/state/bmc0/' 36HOST_STATE_URI = '/xyz/openbmc_project/state/host0/' 37CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/' 38 39# Logging URI variables 40BMC_LOGGING_URI = '/xyz/openbmc_project/logging/' 41BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/' 42 43# Software manager version 44SOFTWARE_VERSION_URI = '/xyz/openbmc_project/software/' 45ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active' 46READY = 'xyz.openbmc_project.Software.Activation.Activations.Ready' 47INVALID = 'xyz.openbmc_project.Software.Activation.Activations.Invalid' 48ACTIVATING = 'xyz.openbmc_project.Software.Activation.Activations.Activating' 49 50# Inventory URI 51HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/' 52 53# Led URI variable 54LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/' 55LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/' 56 57 58''' 59 QEMU HTTPS variable: 60 61 By default lib/resource.txt AUTH URI construct is as 62 ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX} 63 ${AUTH_SUFFIX} is populated here by default EMPTY else 64 the port from the OS environment 65''' 66 67 68def get_port_https(): 69 # defaulted to empty string 70 l_suffix = '' 71 try: 72 l_https_port = os.getenv('HTTPS_PORT') 73 if l_https_port: 74 l_suffix = ':' + l_https_port 75 except: 76 print "Environment variable HTTPS_PORT not set,\ 77 using default HTTPS port" 78 return l_suffix 79 80AUTH_SUFFIX = { 81 "https_port": [get_port_https()], 82} 83 84# Update the ':Port number' to this variable 85AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0] 86 87# Here contains a list of valid Properties bases on fru_type after a boot. 88INVENTORY_ITEMS = { 89 "CPU": [ 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 "Name", 101 "Part Number", 102 "Serial Number", 103 "fault", 104 "fru_type", 105 "is_fru", 106 "present", 107 "version", 108 ], 109 110 "DIMM": [ 111 "Asset Tag", 112 "Custom Field 1", 113 "Custom Field 2", 114 "Custom Field 3", 115 "Custom Field 4", 116 "Custom Field 5", 117 "Custom Field 6", 118 "Custom Field 7", 119 "Custom Field 8", 120 "FRU File ID", 121 "Manufacturer", 122 "Model Number", 123 "Name", 124 "Serial Number", 125 "Version", 126 "fault", 127 "fru_type", 128 "is_fru", 129 "present", 130 "version", 131 ], 132 "MEMORY_BUFFER": [ 133 "Custom Field 1", 134 "Custom Field 2", 135 "Custom Field 3", 136 "Custom Field 4", 137 "Custom Field 5", 138 "Custom Field 6", 139 "Custom Field 7", 140 "Custom Field 8", 141 "FRU File ID", 142 "Manufacturer", 143 "Name", 144 "Part Number", 145 "Serial Number", 146 "fault", 147 "fru_type", 148 "is_fru", 149 "present", 150 "version", 151 ], 152 "FAN": [ 153 "fault", 154 "fru_type", 155 "is_fru", 156 "present", 157 "version", 158 ], 159 "DAUGHTER_CARD": [ 160 "Custom Field 1", 161 "Custom Field 2", 162 "Custom Field 3", 163 "Custom Field 4", 164 "Custom Field 5", 165 "Custom Field 6", 166 "Custom Field 7", 167 "Custom Field 8", 168 "FRU File ID", 169 "Manufacturer", 170 "Name", 171 "Part Number", 172 "Serial Number", 173 "fault", 174 "fru_type", 175 "is_fru", 176 "present", 177 "version", 178 ], 179 "BMC": [ 180 "fault", 181 "fru_type", 182 "is_fru", 183 "manufacturer", 184 "present", 185 "version", 186 ], 187 "MAIN_PLANAR": [ 188 "Custom Field 1", 189 "Custom Field 2", 190 "Custom Field 3", 191 "Custom Field 4", 192 "Custom Field 5", 193 "Custom Field 6", 194 "Custom Field 7", 195 "Custom Field 8", 196 "Part Number", 197 "Serial Number", 198 "Type", 199 "fault", 200 "fru_type", 201 "is_fru", 202 "present", 203 "version", 204 ], 205 "SYSTEM": [ 206 "Custom Field 1", 207 "Custom Field 2", 208 "Custom Field 3", 209 "Custom Field 4", 210 "Custom Field 5", 211 "Custom Field 6", 212 "Custom Field 7", 213 "Custom Field 8", 214 "FRU File ID", 215 "Manufacturer", 216 "Model Number", 217 "Name", 218 "Serial Number", 219 "Version", 220 "fault", 221 "fru_type", 222 "is_fru", 223 "present", 224 "version", 225 ], 226 "CORE": [ 227 "fault", 228 "fru_type", 229 "is_fru", 230 "present", 231 "version", 232 ], 233} 234