blob: 342c5ee31be51d17421d9cf4e399036b6105daba [file] [log] [blame]
import os
# Enable when ready with openbmc/openbmc-test-automation#203
# replace with new path /xyz/openbmc_project
OPENBMC_BASE_URI = '/org/openbmc/'
OPENBMC_BASE_DBUS = 'org.openbmc'
# org open power base URI.
OPENPOWER_BASE_URI = '/org/open_power/'
OPENPOWER_CONTROL = OPENPOWER_BASE_URI + 'control/'
# REST URI base endpoint paths.
CONTROL_URI = OPENBMC_BASE_URI + 'control/'
RECORDS_URI = OPENBMC_BASE_URI + 'records/'
BUTTONS_URI = OPENBMC_BASE_URI + 'buttons/'
SETTINGS_URI = OPENBMC_BASE_URI + 'settings/'
WATCHDOG_URI = OPENBMC_BASE_URI + 'watchdog/'
INVENTORY_URI = OPENBMC_BASE_URI + 'inventory/'
USER_MANAGER_URI = OPENBMC_BASE_URI + 'UserManager/'
NETWORK_MANAGER_URI = OPENBMC_BASE_URI + 'NetworkManager/'
TIME_MANAGER_URI = OPENBMC_BASE_URI + 'TimeManager/'
XYZ_NETWORK_MANAGER = '/xyz/openbmc_project/network/'
# Sensors base variables.
SENSORS_URI = '/xyz/openbmc_project/sensors/'
# State Manager base variables.
BMC_REBOOT_TRANS = 'xyz.openbmc_project.State.BMC.Transition.Reboot'
HOST_POWEROFF_TRANS = 'xyz.openbmc_project.State.Host.Transition.Off'
HOST_POWERON_TRANS = 'xyz.openbmc_project.State.Host.Transition.On'
HOST_REBOOT_TRANS = 'xyz.openbmc_project.State.Host.Transition.Reboot'
HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off'
HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running'
CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off'
CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On'
CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off'
CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On'
# State Manager URI variables.
SYSTEM_STATE_URI = '/xyz/openbmc_project/state/'
BMC_STATE_URI = '/xyz/openbmc_project/state/bmc0/'
HOST_STATE_URI = '/xyz/openbmc_project/state/host0/'
CHASSIS_STATE_URI = '/xyz/openbmc_project/state/chassis0/'
HOST_WATCHDOG_URI = '/xyz/openbmc_project/watchdog/host0/'
# Logging URI variables
BMC_LOGGING_URI = '/xyz/openbmc_project/logging/'
BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/'
# Software manager version
SOFTWARE_VERSION_URI = '/xyz/openbmc_project/software/'
ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active'
READY = 'xyz.openbmc_project.Software.Activation.Activations.Ready'
INVALID = 'xyz.openbmc_project.Software.Activation.Activations.Invalid'
ACTIVATING = 'xyz.openbmc_project.Software.Activation.Activations.Activating'
NOTREADY = 'xyz.openbmc_project.Software.Activation.Activations.NotReady'
FAILED = 'xyz.openbmc_project.Software.Activation.Activations.Failed'
SOFTWARE_ACTIVATION = 'xyz.openbmc_project.Software.Activation'
REQUESTED_ACTIVATION = SOFTWARE_ACTIVATION + '.RequestedActivations'
REQUESTED_ACTIVE = REQUESTED_ACTIVATION + '.Active'
REQUESTED_NONE = REQUESTED_ACTIVATION + '.None'
SOFTWARE_PURPOSE = 'xyz.openbmc_project.Software.Version.VersionPurpose'
VERSION_PURPOSE_HOST = SOFTWARE_PURPOSE + '.Host'
VERSION_PURPOSE_BMC = SOFTWARE_PURPOSE + '.BMC'
VERSION_PURPOSE_SYSTEM = SOFTWARE_PURPOSE + '.System'
# Image Upload Directory Path
IMAGE_UPLOAD_DIR_PATH = '/tmp/images/'
# Inventory URI
HOST_INVENTORY_URI = '/xyz/openbmc_project/inventory/'
# Led URI variable
LED_GROUPS_URI = '/xyz/openbmc_project/led/groups/'
LED_PHYSICAL_URI = '/xyz/openbmc_project/led/physical/'
# Host control URI variables.
CONTROL_HOST_URI = '/xyz/openbmc_project/control/host0/'
# Power restore variables.
POWER_RESTORE_URI = CONTROL_HOST_URI + 'power_restore_policy'
CONTROL_DBUS_BASE = 'xyz.openbmc_project.Control.'
RESTORE_LAST_STATE = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.Restore'
ALWAYS_POWER_ON = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOn'
ALWAYS_POWER_OFF = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOff'
# Dump URI variable
DUMP_URI = '/xyz/openbmc_project/dump/'
DUMP_ENTRY_URI = DUMP_URI + 'entry/'
# Boot progress variables.
STATE_DBUS_BASE = 'xyz.openbmc_project.State.'
OS_BOOT_START = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.OSStart'
OS_BOOT_OFF = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.Unspecified'
OS_BOOT_COMPLETE = STATE_DBUS_BASE + 'OperatingSystem.Status.OSStatus.BootComplete'
# Boot variables.
BOOT_SOURCE_DEFAULT = 'xyz.openbmc_project.Control.Boot.Source.Sources.Default'
BOOT_SOURCE_NETWORK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Network'
BOOT_SOURCE_DISK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Disk'
BOOT_SOURCE_CDROM = 'xyz.openbmc_project.Control.Boot.Source.Sources.ExternalMedia'
BOOT_MODE_SAFE = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Safe'
BOOT_MODE_SETUP = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Setup'
BOOT_MODE_REGULAR = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Regular'
'''
QEMU HTTPS variable:
By default lib/resource.txt AUTH URI construct is as
${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
${AUTH_SUFFIX} is populated here by default EMPTY else
the port from the OS environment
'''
def get_port_https():
# defaulted to empty string
l_suffix = ''
try:
l_https_port = os.getenv('HTTPS_PORT')
if l_https_port:
l_suffix = ':' + l_https_port
except:
print "Environment variable HTTPS_PORT not set,\
using default HTTPS port"
return l_suffix
AUTH_SUFFIX = {
"https_port": [get_port_https()],
}
# Update the ':Port number' to this variable
AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
# Here contains a list of valid Properties bases on fru_type after a boot.
INVENTORY_ITEMS = {
"CPU": [
"Custom Field 1",
"Custom Field 2",
"Custom Field 3",
"Custom Field 4",
"Custom Field 5",
"Custom Field 6",
"Custom Field 7",
"Custom Field 8",
"FRU File ID",
"Manufacturer",
"Name",
"Part Number",
"Serial Number",
"fault",
"fru_type",
"is_fru",
"present",
"version",
],
"DIMM": [
"Asset Tag",
"Custom Field 1",
"Custom Field 2",
"Custom Field 3",
"Custom Field 4",
"Custom Field 5",
"Custom Field 6",
"Custom Field 7",
"Custom Field 8",
"FRU File ID",
"Manufacturer",
"Model Number",
"Name",
"Serial Number",
"Version",
"fault",
"fru_type",
"is_fru",
"present",
"version",
],
"MEMORY_BUFFER": [
"Custom Field 1",
"Custom Field 2",
"Custom Field 3",
"Custom Field 4",
"Custom Field 5",
"Custom Field 6",
"Custom Field 7",
"Custom Field 8",
"FRU File ID",
"Manufacturer",
"Name",
"Part Number",
"Serial Number",
"fault",
"fru_type",
"is_fru",
"present",
"version",
],
"FAN": [
"fault",
"fru_type",
"is_fru",
"present",
"version",
],
"DAUGHTER_CARD": [
"Custom Field 1",
"Custom Field 2",
"Custom Field 3",
"Custom Field 4",
"Custom Field 5",
"Custom Field 6",
"Custom Field 7",
"Custom Field 8",
"FRU File ID",
"Manufacturer",
"Name",
"Part Number",
"Serial Number",
"fault",
"fru_type",
"is_fru",
"present",
"version",
],
"BMC": [
"fault",
"fru_type",
"is_fru",
"manufacturer",
"present",
"version",
],
"MAIN_PLANAR": [
"Custom Field 1",
"Custom Field 2",
"Custom Field 3",
"Custom Field 4",
"Custom Field 5",
"Custom Field 6",
"Custom Field 7",
"Custom Field 8",
"Part Number",
"Serial Number",
"Type",
"fault",
"fru_type",
"is_fru",
"present",
"version",
],
"SYSTEM": [
"Custom Field 1",
"Custom Field 2",
"Custom Field 3",
"Custom Field 4",
"Custom Field 5",
"Custom Field 6",
"Custom Field 7",
"Custom Field 8",
"FRU File ID",
"Manufacturer",
"Model Number",
"Name",
"Serial Number",
"Version",
"fault",
"fru_type",
"is_fru",
"present",
"version",
],
"CORE": [
"fault",
"fru_type",
"is_fru",
"present",
"version",
],
}