Deprecate REST test suites under tests directory
Changes:
- Remove tests directory as part of legacy REST
clean up.
Reference: openbmc/openbmc-test-automation/releases/tag/v4.0-stable
Tested:
- NA
Change-Id: I7e07d79c40f38e55fd6da88d799e2bbeb85c6997
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/tests/__init__.robot b/tests/__init__.robot
deleted file mode 100644
index e38e93b..0000000
--- a/tests/__init__.robot
+++ /dev/null
@@ -1,76 +0,0 @@
-*** Settings ***
-Documentation Set metadata for test suite.
-
-Library SSHLibrary
-Resource ../lib/connection_client.robot
-Resource ../lib/rest_client.robot
-Resource ../lib/utils.robot
-Resource ../lib/code_update_utils.robot
-
-Suite Setup System Driver Data
-
-*** Variables ***
-
-${DRIVER_CMD} cat /etc/os-release | grep ^VERSION_ID=
-
-*** Keyword ***
-
-System Driver Data
- [Documentation] System driver information and enable defaults settings.
- Run Keyword And Ignore Error Clear System Entry From Knownhosts
- Wait Until Keyword Succeeds 2 min 30 sec Open Connection And Log In
- Run Keyword And Ignore Error Log BMC Driver Details
- Run Keyword And Ignore Error Log PNOR Driver Details
- Run Keyword And Ignore Error Log BMC Model
- Run Keyword And Ignore Error Enable Core Dump On BMC
-
- Run Keyword If ${REDFISH_SUPPORTED}
- ... Redfish Default
- ... ELSE
- ... REST Default
-
-REST Default
- [Documentation] Set REST defaults.
-
- Run Keyword And Ignore Error Set Boot Defaults
- Run Keyword And Ignore Error Set BMC Power Policy ${ALWAYS_POWER_OFF}
- Run Keyword If ${FIELD_MODE} == ${True}
- ... Enable Field Mode And Verify Unmount
- Run Keyword And Ignore Error Clear BMC Gard Record
-
-
-Redfish Default
- [Documentation] Set REST defaults.
-
- Redfish.Login
- Run Keyword And Ignore Error Redfish Set Boot Default Disabled None
- Run Keyword And Ignore Error Redfish Set Power Restore Policy AlwaysOff
- Redfish.Logout
-
-
-Set Boot Defaults
- [Documentation] Set boot defaults.
- Set Control Boot Mode ${CONTROL_HOST_URI}/boot ${BOOT_MODE_REGULAR}
- Set Control Boot Mode
- ... ${CONTROL_HOST_URI}/boot/one_time ${BOOT_MODE_REGULAR}
-
-Log BMC Driver Details
- [Documentation] Get BMC driver details and log.
-
- ${output} ${stderr}= Execute Command ${DRIVER_CMD}
- ... return_stderr=True
- Should Be Empty ${stderr}
- Log ${output}
- [Return] ${output}
-
-Log PNOR Driver Details
- [Documentation] Get PNOR driver details and log.
- # Until the new REST interface is available using pflash to
- # capture the PNOR details.
- ${software}= Get Host Software Objects Details
- Log ${software}
-
-Log BMC Model
- [Documentation] Fetch BMC Model name from system and log.
- ${bmc_model}= Get BMC System Model
- Log BMC Model=${bmc_model}
diff --git a/tests/ipmi/test_fru.robot b/tests/ipmi/test_fru.robot
deleted file mode 100644
index 6c69cde..0000000
--- a/tests/ipmi/test_fru.robot
+++ /dev/null
@@ -1,233 +0,0 @@
-*** Settings ***
-Documentation Test IPMI FRU data.
-
-Resource ../../lib/rest_client.robot
-Resource ../../lib/ipmi_client.robot
-Resource ../../lib/openbmc_ffdc.robot
-Resource ../../lib/boot_utils.robot
-Library ../../lib/ipmi_utils.py
-Library ../../data/model.py
-
-Test Teardown Test Teardown Execution
-Suite Setup Suite Setup Execution
-
-
-*** Test Cases ***
-
-Test FRU Info At Power On
- [Documentation] Verify FRU info via IPMI and REST at power on.
- [Tags] Test_FRU_Info_At_Power_On
-
- ${component_name_list}= Get FRU Component Name List ${OPENBMC_MODEL}
- &{ipmi_rest_fru_field_map}= Get Ipmi Rest Fru Field Map ${OPENBMC_MODEL}
- Set Global Variable ${ipmi_rest_fru_field_map}
- Rprint Vars ipmi_rest_fru_field_map component_name_list
-
- FOR ${component_name} IN @{component_name_list}
- Verify FRU Info ${component_name}
- END
-
-
-*** Keywords ***
-
-Get Component Fru Info Via REST
- [Documentation] Get FRU Information Via REST for the given component.
- [Arguments] ${component_name}
-
- # Description of argument(s):
- # component_name The name of the component (e.g. "cpu", "dimm", etc.).
-
- ${inventory_uris}= Read Properties ${HOST_INVENTORY_URI}list quiet=${1}
- # From the inventory_uris, select just the ones for the component of
- # interest.
- ${component_uris}= Get Matches ${inventory_uris}
- ... regexp=^.*[0-9a-z_].${component_name}\[0-9]*$
-
- # Get the component information for each record.
- ${component_frus}= Create List
- FOR ${component_uri} IN @{component_uris}
- ${result}= Read Properties ${component_uri} quiet=${1}
- ${component}= Fetch From Right ${component_uri} /
- Set To Dictionary ${result} fru_device_description ${component}
- Append To List ${component_frus} ${result}
- END
- [Return] ${component_frus}
-
-
-Verify FRU Info
- [Documentation] Verify FRU information of given component.
- [Arguments] ${component_name}
-
- # Description of argument(s):
- # component_name The name of the component (e.g. "cpu", "dimm", etc.).
-
- ${ipmi_fru_component_info}= Get Component FRU Info ${component_name}
- ... ${fru_objs}
- # Example of output from "Get Component FRU Info" keyword for CPU component.
- #
- # ipmi_fru_info:
- # ipmi_fru_info[0]:
- # [fru_device_description]: cpu0 (ID 1)
- # [board_mfg_date]: Sun Dec 31 18:00:00 1995
- # [board_mfg]: <Manufacturer Name>
- # [board_product]: PROCESSOR MODULE
- # [board_serial]: YA1934301835
- # [board_part_number]: 02CY211
- # ipmi_fru_info[1]:
- # [fru_device_description]: cpu1 (ID 2)
- # [board_mfg_date]: Sun Dec 31 18:00:00 1995
- # [board_mfg]: <Manufacturer Name>
- # [board_product]: PROCESSOR MODULE
- # [board_serial]: YA1934301834
- # [board_part_number]: 02CY211
-
- ${rest_fru_component_info}= Get Component FRU Info Via REST
- ... ${component_name}
- # Example of output from "Get Component FRU Info Via REST" keyword for
- # CPU component.
- #
- # rest_fru_info:
- # rest_fru_info[0]:
- # [FieldReplaceable]: 1
- # [BuildDate]: 1996-01-01 - 00:00:00
- # [fru_device_description]: cpu0
- # [Cached]: 0
- # [SerialNumber]: YA1934301835
- # [Functional]: 1
- # [Version]: 22
- # [Model]: <blank>
- # [PrettyName]: PROCESSOR MODULE
- # [PartNumber]: 02CY211
- # [Present]: 1
- # [Manufacturer]: <Manufacturer Name>
- # rest_fru_info[1]:
- # [FieldReplaceable]: 1
- # [BuildDate]: 1996-01-01 - 00:00:00
- # [fru_device_description]: cpu1
- # [Cached]: 0
- # [SerialNumber]: YA1934301834
- # [Functional]: 1
- # [Version]: 22
- # [Model]: <blank>
- # [PrettyName]: PROCESSOR MODULE
- # [PartNumber]: 02CY211
- # [Present]: 1
- # [Manufacturer]: <Manufacturer Name>
-
- ${inventory_uris}= Read Properties
- ... ${HOST_INVENTORY_URI}list quiet=${1}
-
- # From the inventory_uris, select just the ones for the component of
- # interest. Example for cpu:
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
- ${component_uris}= Get Matches ${inventory_uris}
- ... regexp=^.*[0-9a-z_].${component_name}\[0-9]*$
-
- FOR ${uri} IN @{component_uris}
- ${sub_component}= Fetch From Right ${uri} /
- ${ipmi_index}= Get Index Of FRU Sub Component Info
- ... ${ipmi_fru_component_info} ${sub_component}
- ${rest_index}= Get Index Of FRU Sub Component Info
- ... ${rest_fru_component_info} ${sub_component}
- ${ipmi_fru_sub_component}=
- ... Get From List ${ipmi_fru_component_info} ${ipmi_index}
- ${rest_fru_sub_component}=
- ... Get From List ${rest_fru_component_info} ${rest_index}
- Compare IPMI And REST FRU Component Info ${ipmi_fru_sub_component}
- ... ${rest_fru_sub_component} ${component_name}
- END
-
-
-Get Index Of FRU Sub Component Info
- [Documentation] Get index of FRU sub component info from FRU component
- ... data.
- [Arguments] ${fru_component_info} ${sub_component}
- # fru_component_info FRU component data as a list of dictionaries.
- # ipmi_cpu_fru_info[0]:
- # fru_device_description: cpu0 (ID 1)
- # board_mfg_date: Sun Dec 31 18:00:00 1995
- # board_mfg: <Manufacturer Name>
- # board_product: PROCESSOR MODULE
- # board_serial: YA1934302970
- # board_part_number: 02CY211
- # ipmi_cpu_fru_info[1]:
- # fru_device_description: cpu1 (ID 2)
- # board_mfg_date: Sun Dec 31 18:00:00 1995
- # board_mfg: <Manufacturer Name>
- # board_product: PROCESSOR MODULE
- # board_serial: YA1934302965
- # board_part_number: 02CY211
- # sub_component Sub component name (e.g. "cpu0", "cpu1", etc.).
-
- ${sub_component_count}= Get Length ${fru_component_info}
- ${index}= Set Variable ${0}
-
- FOR ${rest_fru_sub_component} IN @{fru_component_info}
- ${fru_component_section}=
- ... Get From List ${fru_component_info} ${index}
- # Get FRU name from IPMI's fru_device_description field.
- # Example "cpu0" from "cpu0 (ID 1)".
- ${fru_name}= Fetch From Left
- ... ${fru_component_section['fru_device_description']} ${SPACE}
- ${status}= Run Keyword And Return Status Should Be Equal
- ... ${fru_name} ${sub_component}
- Exit For Loop If '${status}' == '${True}'
- ${index}= Evaluate ${index} + 1
- Exit For Loop If ${index} >= ${sub_component_count}
- END
- [Return] ${index}
-
-
-Compare IPMI And REST FRU Component Info
- [Documentation] Compare IPMI And REST FRU Component data objects.
- [Arguments] ${ipmi_fru_component_obj} ${rest_fru_component_obj}
- ... ${component_name}
-
- # Description of argument(s):
- # ipmi_fru_component_obj IPMI FRU component data in dictionary.
- # Example:
- # fru_device_description: cpu0 (ID 1)
- # board_mfg_date: Sun Dec 31 18:00:00 1995
- # board_mfg: <Manufacturer Name>
- # board_product: PROCESSOR MODULE
- # board_serial: YA1934302970
- # board_part_number: 02CY211
- # rest_fru_component_obj REST FRU component data in dictionary.
- # Example:
- # FieldReplaceable: 1
- # BuildDate: 1996-01-01 - 00:00:00
- # Cached: 0
- # SerialNumber: YA1934302970
- # Functional: 1
- # Version: 22
- # Model: <blank>
- # PrettyName: PROCESSOR MODULE
- # PartNumber: 02CY211
- # Present: 1
- # Manufacturer: <Manufacturer Name>
- # component_name The name of the component (e.g. "cpu", "dimm", etc.).
-
- # Get key_map from ipmi_rest_fru_field_map.
- ${key_map}= Set Variable ${ipmi_rest_fru_field_map['${component_name}']}
- FOR ${ipmi_key} IN @{ipmi_rest_fru_field_map['${component_name}'].keys()}
- ${rest_key}= Set Variable ${key_map['${ipmi_key}']}
- Should Contain ${rest_fru_component_obj['${rest_key}']}
- ... ${ipmi_fru_component_obj['${ipmi_key}']}
- ... msg=Comparison failed.
- END
-
-
-Test Teardown Execution
- [Documentation] Do the post test teardown.
-
- FFDC On Test Case Fail
-
-
-Suite Setup Execution
- [Documentation] Do test setup initialization.
-
- REST Power On stack_mode=skip quiet=1
- ${fru_objs}= Get Fru Info
- Set Suite Variable ${fru_objs}
-
diff --git a/tests/ipmi/test_general_ipmi.robot b/tests/ipmi/test_general_ipmi.robot
deleted file mode 100755
index 127e3a4..0000000
--- a/tests/ipmi/test_general_ipmi.robot
+++ /dev/null
@@ -1,222 +0,0 @@
-*** Settings ***
-Documentation This suite is for testing general IPMI functions.
-
-Resource ../../lib/ipmi_client.robot
-Resource ../../lib/openbmc_ffdc.robot
-Resource ../../lib/boot_utils.robot
-Resource ../../lib/utils.robot
-Resource ../../lib/bmc_network_utils.robot
-Resource ../../lib/logging_utils.robot
-Library ../../lib/ipmi_utils.py
-Variables ../../data/ipmi_raw_cmd_table.py
-Library ../../lib/gen_misc.py
-Library ../../lib/gen_robot_valid.py
-
-Test Setup Log to Console ${EMPTY}
-Test Teardown FFDC On Test Case Fail
-
-*** Variables ***
-
-${allowed_temp_diff}= ${1}
-${allowed_power_diff}= ${10}
-
-*** Test Cases ***
-
-Test Watchdog Reset Via IPMI And Verify Using REST
- [Documentation] Test watchdog reset via IPMI and verify using REST.
- [Tags] Test_Watchdog_Reset_Via_IPMI_And_Verify_Using_REST
-
- Initiate Host Boot
-
- Set Watchdog Enabled Using REST ${1}
-
- Watchdog Object Should Exist
-
- # Resetting the watchdog via IPMI.
- Run IPMI Standard Command mc watchdog reset
-
- # Verify the watchdog is reset using REST after an interval of 1000ms.
- Sleep 1000ms
- ${watchdog_time_left}=
- ... Read Attribute ${HOST_WATCHDOG_URI} TimeRemaining
- Should Be True
- ... ${watchdog_time_left}<${1200000} and ${watchdog_time_left}>${2000}
- ... msg=Watchdog timer didn't reset.
-
-
-Test Watchdog Off Via IPMI And Verify Using REST
- [Documentation] Test watchdog off via IPMI and verify using REST.
- [Tags] Test_Watchdog_Off_Via_IPMI_And_Verify_Using_REST
-
- Initiate Host Boot
-
- Set Watchdog Enabled Using REST ${1}
-
- Watchdog Object Should Exist
-
- # Turn off the watchdog via IPMI.
- Run IPMI Standard Command mc watchdog off
-
- # Verify the watchdog is off using REST
- ${watchdog_state}= Read Attribute ${HOST_WATCHDOG_URI} Enabled
- Should Be Equal ${watchdog_state} ${0}
- ... msg=msg=Verification failed for watchdog off check.
-
-
-Verify Get Device ID
- [Documentation] Verify get device ID command output.
- [Tags] Verify_Get_Device_ID
-
- # Example of get device ID command output:
- # Device ID : 0
- # Device Revision : 0
- # Firmware Revision : 2.01
- # IPMI Version : 2.0
- # Manufacturer ID : 42817
- # Manufacturer Name : Unknown (0xA741)
- # Product ID : 16975 (0x424f)
- # Product Name : Unknown (0x424F)
- # Device Available : yes
- # Provides Device SDRs : yes
- # Additional Device Support :
- # Sensor Device
- # SEL Device
- # FRU Inventory Device
- # Chassis Device
- # Aux Firmware Rev Info :
- # 0x04
- # 0x38
- # 0x00
- # 0x03
-
- # Verify Manufacturer and Product IDs, etc. directly from json file.
- ${device_id_config}= Get Device Id Config
- ${mc_info}= Get MC Info
-
- Rprint Vars device_id_config mc_info
- Valid Value ${mc_info['device_id']} [${device_id_config['id']}]
- Valid Value ${mc_info['device_revision']} [${device_id_config['device_revision']}]
-
- # Get firmware revision from mc info command output i.e. 2.01
- ${ipmi_fw_major_version} ${ipmi_fw_minor_version}=
- ... Split String ${mc_info['firmware_revision']} .
- # Convert minor firmware version from BCD format to integer. i.e. 01 to 1
- ${ipmi_fw_minor_version}= Convert To Integer ${ipmi_fw_minor_version}
-
- # Get BMC version from BMC CLI i.e. 2.2 from "v2.2-253-g00050f1"
- ${bmc_version_full}= Get BMC Version
- ${bmc_version}=
- ... Remove String Using Regexp ${bmc_version_full} ^[^0-9]+ [^0-9\.].*
-
- # Get major and minor version from BMC version i.e. 2 and 1 from 2.1
- @{major_minor_version}= Split String ${bmc_version} .
-
- Should Be Equal As Strings ${ipmi_fw_major_version} ${major_minor_version[0]}
- ... msg=Major version mismatch.
- Should Be Equal As Strings ${ipmi_fw_minor_version} ${major_minor_version[1]}
- ... msg=Minor version mismatch.
-
- Valid Value mc_info['ipmi_version'] ['2.0']
-
- Valid Value ${mc_info['manufacturer_id']} [${device_id_config['manuf_id']}]
- ${product_id_hex} = Convert To Hex ${device_id_config['prod_id']} lowercase=True length=4 prefix=0x
- Valid Value mc_info['product_id'] ['${device_id_config['prod_id']} (${product_id_hex})']
-
- Valid Value mc_info['device_available'] ['yes']
- Valid Value mc_info['provides_device_sdrs'] ['yes']
- Should Contain ${mc_info['additional_device_support']} Sensor Device
- Should Contain ${mc_info['additional_device_support']} SEL Device
- Should Contain
- ... ${mc_info['additional_device_support']} FRU Inventory Device
- Should Contain ${mc_info['additional_device_support']} Chassis Device
-
- # Auxiliary revision data verification.
- ${aux_version}= Get Aux Version ${bmc_version_full}
-
- # From aux_firmware_rev_info field ['0x04', '0x38', '0x00', '0x03']
- ${bmc_aux_version}= Catenate
- ... SEPARATOR=
- ... ${mc_info['aux_firmware_rev_info'][0][2:]}
- ... ${mc_info['aux_firmware_rev_info'][1][2:]}
- ... ${mc_info['aux_firmware_rev_info'][2][2:]}
- ... ${mc_info['aux_firmware_rev_info'][3][2:]}
-
- Should Be Equal As Integers
- ... ${bmc_aux_version} ${aux_version}
- ... msg=BMC aux version ${bmc_aux_version} does not match expected value of ${aux_version}.
-
-
-Test IPMI Restriction Mode
- [Documentation] Set restricition mode via REST and verify IPMI operation.
- [Tags] Test_IPMI_Restriction_Mode
- # Forego normal test setup:
- [Setup] No Operation
- [Teardown] Run Keywords FFDC On Test Case Fail AND
- ... Set IPMI Restriction Mode xyz.openbmc_project.Control.Security.RestrictionMode.Modes.None
-
- # By default no IPMI operations are restricted.
- # /xyz/openbmc_project/control/host0/restriction_mode/attr/RestrictionMode
- # {
- # "data": "xyz.openbmc_project.Control.Security.RestrictionMode.Modes.None",
- # "message": "200 OK",
- # "status": "ok"
- # }
-
- # Refer to: #openbmc/phosphor-host-ipmid/blob/master/host-ipmid-whitelist.conf
- # Set the restriction mode to Allowed list IPMI commands only:
- # /xyz/openbmc_project/control/host0/restriction_mode/attr/RestrictionMode
- # {
- # "data": "xyz.openbmc_project.Control.Security.RestrictionMode.Modes.Whitelist",
- # "message": "200 OK",
- # "status": "ok"
- # }
-
- Set IPMI Restriction Mode xyz.openbmc_project.Control.Security.RestrictionMode.Modes.Whitelist
-
- # Attempt allowed listed operation expecting success.
- IPMI Power On
-
- # Attempt non allowed listed operation expecting failure.
- Run Keyword And Expect Error *Insufficient privilege level*
- ... Run Inband IPMI Standard Command lan set 1 access on
-
-
-*** Keywords ***
-
-Set Watchdog Enabled Using REST
- [Documentation] Set watchdog Enabled field using REST.
- [Arguments] ${value}
-
- # Description of argument(s):
- # value Integer value (eg. "0-Disabled", "1-Enabled").
-
- ${value_dict}= Create Dictionary data=${value}
- ${resp}= OpenBMC Put Request ${HOST_WATCHDOG_URI}attr/Enabled
- ... data=${value_dict}
-
-
-Fetch Details From LAN Print
- [Documentation] Fetch details from LAN print.
- [Arguments] ${field_name}
-
- # Description of argument(s):
- # ${field_name} Field name to be fetched from LAN print
- # (e.g. "MAC Address", "Source").
-
- ${stdout}= Run IPMI Standard Command lan print
- ${fetch_value}= Get Lines Containing String ${stdout} ${field_name}
- ${value_fetch}= Fetch From Right ${fetch_value} :${SPACE}
- [Return] ${value_fetch}
-
-
-Set IPMI Restriction Mode
- [Documentation] Set the IPMI restriction mode.
- [Arguments] ${restriction_mode}
-
- # Description of argument(s):
- # restriction_mode IPMI valid restriction modes.
-
- ${valueDict}= Create Dictionary data=${restriction_mode}
-
- Write Attribute ${CONTROL_HOST_URI}restriction_mode/
- ... RestrictionMode data=${valueDict}
diff --git a/tests/ipmi/test_sensors_ipmi.robot b/tests/ipmi/test_sensors_ipmi.robot
deleted file mode 100644
index e524335..0000000
--- a/tests/ipmi/test_sensors_ipmi.robot
+++ /dev/null
@@ -1,394 +0,0 @@
-*** Settings ***
-Documentation Test IPMI sensor IDs.
-
-Resource ../../lib/rest_client.robot
-Resource ../../lib/ipmi_client.robot
-Resource ../../lib/openbmc_ffdc.robot
-Resource ../../lib/state_manager.robot
-Library ../../data/model.py
-Resource ../../lib/boot_utils.robot
-Resource ../../lib/utils.robot
-
-Test Teardown Test Teardown Execution
-
-*** Test Cases ***
-
-DIMM Present And Not Present
- [Documentation] Verify the IPMI sensor for DIMM3 present and not present.
- [Tags] DIMM_Present_And_Not_Present
-
- # Set the dimm3 Present to 1
- Run IPMI Command
- ... 0x04 0x30 0xac 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00
- Verify The Attribute
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/dimm3 Present ${1}
-
- # Set the dimm3 Present to 0
- Run IPMI Command
- ... 0x04 0x30 0xac 0xa9 0xff 0x00 0x00 0x40 0x00 0x00 0x20 0x00
- Verify The Attribute
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/dimm3 Present ${0}
-
-
-DIMM Functional And Not Functional
- [Documentation] Verify that the DIMM3 is functional.
- [Tags] DIMM_Functional_And_Not_Functional
-
- # Set the dimm3 Functional to 0
- Run IPMI Command
- ... 0x04 0x30 0xac 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00
- Verify The Attribute
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/dimm3
- ... Functional ${0}
- # Set the dimm3 Functional to 1
- Run IPMI Command
- ... 0x04 0x30 0xac 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00
- Verify The Attribute
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/dimm3
- ... Functional ${1}
-
-
-CPU Functional
- [Documentation] Verify the IPMI sensor for CPU functional.
- [Tags] CPU_Functional
- [Template] Check Functional Bit
-
- # sensor_id component
- 0x5a cpu0
-
-
-CPU Not Functional
- [Documentation] Verify the IPMI sensor for CPU not functional.
- [Tags] CPU_Not_Functional
- [Template] Check Not Functional Bit
-
- # sensor_id component
- 0x5a cpu0
-
-
-GPU Functional
- [Documentation] Verify the IPMI sensor GPU for functional.
- [Tags] GPU_Functional
- [Template] Check Functional Bit
-
- # sensor_id component
- 0xC5 gv100card0
-
-
-GPU Not Functional
- [Documentation] Verify the IPMI sensor GPU for not functional.
- [Tags] GPU_Not_Functional
- [Template] Check Not Functional Bit
-
- # sensor_id component
- 0xC5 gv100card0
-
-
-Core Present
- [Documentation] Verify the IPMI sensor for core present.
- [Tags] Core_Present
- [Template] Check Present Bit
-
- # sensor_id component
- 0x1e cpu0/core4
-
-
-Core Not Present
- [Documentation] Verify the IPMI sensor for core not present.
- [Tags] Core_Not_Present
- [Template] Check Not Present Bit
-
- # sensor_id component
- 0x1e cpu0/core4
-
-
-Core Functional
- [Documentation] Verify the IPMI sensor for core functional.
- [Tags] Core_Functional
- [Template] Check Functional Bit
-
- # sensor_id component
- 0x1e cpu0/core4
-
-
-Core Not Functional
- [Documentation] Verify the IPMI sensor for core not functional.
- [Tags] Core_Not_Functional
- [Template] Check Not Functional Bit
-
- # sensor_id component
- 0x1e cpu0/core4
-
-
-# Operating System State Test Cases.
-
-Set BootProgress To OSStart And Verify
- [Documentation] Set BootProgress To OSStart and verify.
- [Tags] Set_BootProgress_To_OSStart_And_Verify
- [Template] Check BootProgress
-
- # BootProgressID BootProgress
- 0x13 ${OS_BOOT_START}
-
-
-Set OperatingSystemState To CBoot And Verify
- [Documentation] Set Operating System State to "CBoot"
- ... and verify using REST.
- [Tags] Set_OperatingSystemState_To_CBoot_And_Verify
- [Template] Check OperatingSystemState
-
- # OperatingSystemStateID OperatingSystemState
- 0x02 ${OS_BOOT_CBOOT}
-
-
-Set OperatingSystemState To PXEBoot And Verify
- [Documentation] Set Operating System State to "PXEBoot"
- ... and verify using REST.
- [Tags] Set_OperatingSystemState_To_PXEBoot_And_Verify
- [Template] Check OperatingSystemState
-
- # OperatingSystemStateID OperatingSystemState
- 0x05 ${OS_BOOT_PXE}
-
-
-Set OperatingSystemState To BootComplete And Verify
- [Documentation] Set Operating System State to "BootComplete"
- ... and verify using REST.
- [Tags] Set_OperatingSystemState_To_BootComplete_And_Verify
- [Template] Check OperatingSystemState
-
- # OperatingSystemStateID OperatingSystemState
- 0x40 ${OS_BOOT_COMPLETE}
-
-
-Set OperatingSystemState To CDROMBoot And Verify
- [Documentation] Set Operating System State to "CDROMBoot"
- ... and verify using REST.
- [Tags] Set_OperatingSystemState_To_CDROMBoot_And_Verify
- [Template] Check OperatingSystemState
-
- # OperatingSystemStateID OperatingSystemState
- 0x10 ${OS_BOOT_CDROM}
-
-
-Set OperatingSystemState To ROMBoot And Verify
- [Documentation] Set Operating System State to "ROMBoot"
- ... and verify using REST.
- [Tags] Set_OperatingSystemState_To_ROMBoot_And_Verify
- [Template] Check OperatingSystemState
-
- # OperatingSystemStateID OperatingSystemState
- 0x20 ${OS_BOOT_ROM}
-
-
-Set OperatingSystemState To DiagBoot And Verify
- [Documentation] Set Operating System State to "DiagBoot"
- ... and verify using REST.
- [Tags] Set_OperatingSystemState_To_DiagBoot_And_Verify
- [Template] Check OperatingSystemState
-
- # OperatingSystemStateID OperatingSystemState
- 0x08 ${OS_BOOT_DIAGBOOT}
-
-
-# Boot Progress Test Cases.
-
-Set BootProgress To MemoryInit And Verify
- [Documentation] Set BootProgress to "MemoryInit" and verify.
- [Tags] Set_BootProgress_To_MemoryInit_And_Verify
- [Template] Check BootProgress
-
- # BootProgressID BootProgress
- 0x01 ${OS_BOOT_MEM}
-
-
-Set BootProgress To MotherboardInit And Verify
- [Documentation] Set BootProgress to "MotherboardInit" and verify.
- [Tags] Set_BootProgress_To_MotherboardInit_And_Verify
- [Template] Check BootProgress
-
- # BootProgressID BootProgress
- 0x14 ${OS_BOOT_MOTHERBOARD}
-
-
-Set BootProgress To SecondaryProcInit And Verify
- [Documentation] Set BootProgress to "SecondaryProcInit" and verify.
- [Tags] Set_BootProgress_To_SecondaryProcInit_And_Verify
- [Template] Check BootProgress
-
- # BootProgressID BootProgress
- 0x03 ${OS_BOOT_SECPCI}
-
-
-Set BootProgress To PCIinit And Verify
- [Documentation] Set BootProgress to "PCIinit" and verify.
- [Tags] Set_BootProgress_To_PCIinit_And_Verify
- [Template] Check BootProgress
-
- #BootProgressID BootProgress
- 0x07 ${OS_BOOT_PCI}
-
-
-Set BootProgress To Unspecified And Verify
- [Documentation] Set BootProgress to "Unspecified" and verify.
- [Tags] Set_BootProgress_To_Unspecified_And_Verify
- [Template] Check BootProgress
-
- # BootProgressID BootProgress
- 0x00 ${OS_BOOT_OFF}
-
-
-TPM Enable and Disable
- [Documentation] Enable and disable TPM.
- [Tags] TPM_Enable_and_Disable
-
- # Set the TPMEnable to 0
- Run IPMI Command
- ... 0x04 0x30 0xD7 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
- Verify The Attribute ${CONTROL_URI}/host0/TPMEnable TPMEnable ${0}
-
- # Set the TPMEnable to 1
- Run IPMI Command
- ... 0x04 0x30 0xD7 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 0x00
- Verify The Attribute ${CONTROL_URI}/host0/TPMEnable TPMEnable ${1}
-
-
-Autoreboot Enable and Disable
- [Documentation] Enable and disable Autoreboot.
- [Tags] Autoreboot_Enable_and_Disable
-
- # Set the TPMEnable to 0
- Run IPMI Command
- ... 0x04 0x30 0xDA 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00
- Verify The Attribute ${CONTROL_URI}/host0/auto_reboot AutoReboot ${0}
-
- # Set the TPMEnable to 1
- Run IPMI Command
- ... 0x04 0x30 0xDA 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 0x00
- Verify The Attribute ${CONTROL_URI}/host0/auto_reboot AutoReboot ${1}
-
-
-Verify IPMI BT Capabilities Command
- [Documentation] Verify IPMI BT capability command response.
- [Tags] Verify_IPMI_BT_Capabilities_Command
- [Setup] Run Keywords REST Hard Power Off AND REST Power On
-
- ${output}= Run IPMI command 0x06 0x36
- Should Be True "${output}" == " 01 3f 3f 0a 01"
- ... msg=Incorrect Output.
-
-
-OCC Active Disable And Enable
- [Documentation] OCC active disable and enable.
- [Tags] OCC_Active_Disable_And_Enable
-
- REST Power On stack_mode=skip quiet=1
-
- # Set the OccActive to 0
- Run IPMI Command
- ... 0x04 0x30 0x08 0xa8 0x00 0x01 0x00 0x02 0x00 0x00 0x00 0x00
- Verify The Attribute ${OPENPOWER_CONTROL}/occ0 OccActive ${0}
-
- # Set the OccActive to 1
- Run IPMI Command
- ... 0x04 0x30 0x08 0xa8 0x00 0x02 0x00 0x01 0x00 0x00 0x00 0x00
- Verify The Attribute ${OPENPOWER_CONTROL}/occ0 OccActive ${1}
-
-
-*** Keywords ***
-
-Check Present Bit
- [Documentation] Set the present field to 1 and verify.
- [Arguments] ${sensor_id} ${component}
-
- # Description of argument(s):
- # sensor_id Corresponding to OperatingSystemState.
- # component Component name.
-
- Run IPMI Command
- ... 0x04 0x30 ${sensor_id} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
- Verify The Attribute
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component}
- ... Present ${1}
-
-
-Check Not Present Bit
- [Documentation] Set the present field to 1 and verify.
- [Arguments] ${sensor_id} ${component}
-
- # Description of argument(s):
- # sensor_id Corresponding to OperatingSystemState.
- # component Component name.
-
- Run IPMI Command
- ... 0x04 0x30 ${sensor_id} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
- Verify The Attribute
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component}
- ... Present ${0}
-
-
-Check Functional Bit
- [Documentation] Set the functional to 1 and verify.
- [Arguments] ${sensor_id} ${component}
-
- # Description of argument(s):
- # sensor_id Corresponding to OperatingSystemState.
- # component Component name.
-
- Run IPMI Command
- ... 0x04 0x30 ${sensor_id} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00
- Verify The Attribute
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component}
- ... Functional ${1}
-
-
-Check Not Functional Bit
- [Documentation] Set the functional to 0 and verify.
- [Arguments] ${sensor_id} ${component}
-
- # Description of argument(s):
- # sensor_id Corresponding to OperatingSystemState.
- # component Component name.
-
- Run IPMI Command
- ... 0x04 0x30 ${sensor_id} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00
- Verify The Attribute
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component}
- ... Functional ${0}
-
-
-Check OperatingSystemState
- [Documentation] Set OperatingSystemState and verify.
- [Arguments] ${sensor_id} ${OperatingSystemState}
-
- # Description of argument(s):
- # sensor_id Corresponding to OperatingSystemState.
- # OperatingSystemState OperatingSystemState to be set.
-
- Run IPMI Command
- ... 0x04 0x30 0x05 0xa9 0x00 ${sensor_id} 0x00 0x00 0x00 0x00 0x00 0x00
- ${resp}= Read Attribute ${SYSTEM_STATE_URI}/host0 OperatingSystemState
- Should Be Equal ${OperatingSystemState} ${resp}
-
-
-Check BootProgress
- [Documentation] Set the Bootprogress and verify.
- [Arguments] ${BootProgressID} ${BootProgress}
-
- # Description of argument(s):
- # BootProgressID Corresponding to BootProgress.
- # BootProgress BootProgress to be set.
-
- Run IPMI Command
- ... 0x04 0x30 0x03 0xa8 0x00 0x04 0x00 0x00 0x00 0x00 ${BootProgressID} 0x00
- ${resp}= Read Attribute ${SYSTEM_STATE_URI}/host0 BootProgress
- Should Be Equal ${BootProgress} ${resp}
-
-
-Test Teardown Execution
- [Documentation] Do the post test teardown.
- ... 1. Capture FFDC on test failure.
- ... 2. Close all open SSH connections.
-
- FFDC On Test Case Fail
-
diff --git a/tests/test_boot_devices.robot b/tests/test_boot_devices.robot
deleted file mode 100644
index 2a723c6..0000000
--- a/tests/test_boot_devices.robot
+++ /dev/null
@@ -1,395 +0,0 @@
-*** Settings ***
-
-Documentation This testsuite is for testing the Boot Device Functions
-
-Resource ../lib/rest_client.robot
-Resource ../lib/ipmi_client.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/utils.robot
-Resource ../lib/boot_utils.robot
-
-Suite Setup Test Suite Setup
-Test Teardown Post Test Case Execution
-
-*** Variables ***
-
-${stack_mode} skip
-
-
-*** Test Cases ***
-
-Set The Boot Source As Default Using REST API
- [Documentation] Set default boot source via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Source_As_Default_Using_REST_API
-
- Set Boot Source ${BOOT_SOURCE_DEFAULT}
-
- ${boot_source}=
- ... Read Attribute ${CONTROL_HOST_URI}boot BootSource
- Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DEFAULT}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} No override
-
-
-Set The Boot Source As Default Using Ipmitool
- [Documentation] Set default boot source via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Source_As_Default_Using_Ipmitool
-
- Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
-
- ${boot_source}=
- ... Read Attribute ${CONTROL_HOST_URI}boot BootSource
- Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DEFAULT}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} No override
-
-
-Set The Boot Source As Network Using REST API
- [Documentation] Set boot source as Network via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Source_As_Network_Using_REST_API
-
- Set Boot Source ${BOOT_SOURCE_NETWORK}
-
- ${boot_source}=
- ... Read Attribute ${CONTROL_HOST_URI}boot BootSource
- Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_NETWORK}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Force PXE
-
-
-Set The Boot Source As Network Using Ipmitool
- [Documentation] Set boot source as Network via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Source_As_Network_Using_Ipmitool
-
- Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
-
- ${boot_source}=
- ... Read Attribute ${CONTROL_HOST_URI}boot BootSource
- Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_NETWORK}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Force PXE
-
-
-Set The Boot Source As Disk Using REST API
- [Documentation] Set boot source as Disk via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Source_As_Disk_Using_REST_API
-
- Set Boot Source ${BOOT_SOURCE_DISK}
-
- ${boot_source}=
- ... Read Attribute ${CONTROL_HOST_URI}boot BootSource
- Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DISK}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Force Boot from default Hard-Drive
-
-
-Set The Boot Source As Disk Using Ipmitool
- [Documentation] Set boot source as Disk via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Source_As_Disk_Using_Ipmitool
-
- Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
-
- ${boot_source}=
- ... Read Attribute ${CONTROL_HOST_URI}boot BootSource
- Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_DISK}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Force Boot from default Hard-Drive
-
-
-Set The Boot Mode As Safe Using REST API
- [Documentation] Set boot mode as Safe via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Mode_As_Safe_Using_REST_API
-
- Set Boot Mode ${BOOT_MODE_SAFE}
-
- ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}boot BootMode
- Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SAFE}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Safe-Mode
-
-
-Set The Boot Mode As Safe Using Ipmitool
- [Documentation] Set boot mode as Safe via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Mode_As_Safe_Using_Ipmitool
-
- Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
-
- ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}boot BootMode
- Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SAFE}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Safe-Mode
-
-
-Set The Boot Source As CDROM Using REST API
- [Documentation] Set boot source as CDROM via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Source_As_CDROM_Using_REST_API
-
- Set Boot Source ${BOOT_SOURCE_CDROM}
-
- ${boot_source}=
- ... Read Attribute ${CONTROL_HOST_URI}boot BootSource
- Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_CDROM}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Force Boot from CD/DVD
-
-
-Set The Boot Source As CDROM Using Ipmitool
- [Documentation] Set boot source as CDROM via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Source_As_CDROM_Using_Ipmitool
-
- Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
-
- ${boot_source}=
- ... Read Attribute ${CONTROL_HOST_URI}boot BootSource
- Should Be Equal As Strings ${boot_source} ${BOOT_SOURCE_CDROM}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Force Boot from CD/DVD
-
-
-Set The Boot Mode As Setup Using REST API
- [Documentation] Set boot mode as Setup via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Mode_As_Setup_Using_REST_API
-
- Set Boot Mode ${BOOT_MODE_SETUP}
-
- ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}boot BootMode
- Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SETUP}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Force Boot into BIOS Setup
-
-
-Set The Boot Mode As Setup Using Ipmitool
- [Documentation] Set boot mode as Setup via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Mode_As_Setup_Using_Ipmitool
-
- Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
-
- ${boot_mode}= Read Attribute ${CONTROL_HOST_URI}boot BootMode
- Should Be Equal As Strings ${boot_mode} ${BOOT_MODE_SETUP}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Force Boot into BIOS Setup
-
-
-Set The Boot Type As Legacy Using REST API
- [Documentation] Set boot type as Legacy via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Type_As_Legacy_Using_REST_API
-
- Pass Execution If '${PLATFORM_ARCH_TYPE}' != 'x86'
- ... BootType selector is implemented only in x86 arch
-
- Set Boot Type ${BOOT_TYPE_LEGACY}
-
- ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot BootType
- Should Be Equal As Strings ${boot_type} ${BOOT_TYPE_LEGACY}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} BIOS PC Compatible (legacy) boot
-
-
-Set The Boot Type As Legacy Using Ipmitool
- [Documentation] Set boot type as Legacy via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Type_As_Legacy_Using_Ipmitool
-
- Pass Execution If '${PLATFORM_ARCH_TYPE}' != 'x86'
- ... BootType selector is implemented only in x86 arch
-
- Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
-
- ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot BootType
- Should Be Equal As Strings ${boot_type} ${BOOT_TYPE_LEGACY}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} BIOS PC Compatible (legacy) boot
-
-
-Set The Boot Type As EFI Using REST API
- [Documentation] Set boot type as EFI via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Type_As_EFI_Using_REST_API
-
- Pass Execution If '${PLATFORM_ARCH_TYPE}' != 'x86'
- ... BootType selector is implemented only in x86 arch
-
- Set Boot Type ${BOOT_TYPE_EFI}
-
- ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot BootType
- Should Be Equal As Strings ${boot_type} ${BOOT_TYPE_EFI}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} BIOS EFI boot
-
-
-Set The Boot Type As EFI Using Ipmitool
- [Documentation] Set boot type as EFI via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_The_Boot_Type_As_EFI_Using_Ipmitool
-
- Pass Execution If '${PLATFORM_ARCH_TYPE}' != 'x86'
- ... BootType selector is implemented only in x86 arch
-
- Run IPMI command 0x0 0x8 0x05 0xA0 0x00 0x00 0x00 0x00
-
- ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot BootType
- Should Be Equal As Strings ${boot_type} ${BOOT_TYPE_EFI}
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} BIOS EFI boot
-
-
-Set Boot As Enabled Using REST API
- [Documentation] Enable boot override via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_Boot_As_Enabled_Using_REST_API
-
- Set Boot Enable True
-
- ${boot_enable}= Read Attribute ${CONTROL_HOST_URI}boot Enabled
- Should Be Equal As Strings ${boot_enable} True
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Boot Flag Valid
-
-
-Set Boot As Enabled Using Ipmitool
- [Documentation] Enable boot override via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_Boot_As_Enabled_Using_Ipmitool
-
- Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
-
- ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot Enabled
- Should Be Equal As Strings ${boot_type} True
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Boot Flag Valid
-
-
-Set Boot As Disabled Using REST API
- [Documentation] Disable boot override via REST and verify with both
- ... REST and IPMI.
- [Tags] Set_Boot_As_Disabled_Using_REST_API
-
- Set Boot Enable False
-
- ${boot_enable}= Read Attribute ${CONTROL_HOST_URI}boot Enabled
- Should Be Equal As Strings ${boot_enable} False
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Boot Flag Invalid
-
-
-Set Boot As Disabled Using Ipmitool
- [Documentation] Disable boot override via IPMI and verify with both
- ... REST and IPMI.
- [Tags] Set_Boot_As_Disabled_Using_Ipmitool
-
- Run IPMI command 0x0 0x8 0x05 0x00 0x00 0x00 0x00 0x00
-
- ${boot_type}= Read Attribute ${CONTROL_HOST_URI}boot Enabled
- Should Be Equal As Strings ${boot_type} False
-
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Boot Flag Invalid
-
-
-*** Keywords ***
-
-Set Boot Enable
- [Documentation] Set boot enable.
- [Arguments] ${boot_enable}
- # Description of argument(s):
- # boot_enable Boot enable status which need to be set.
-
- ${valueDict}= Create Dictionary data=${boot_enable}
- Write Attribute ${CONTROL_HOST_URI}boot Enabled
- ... data=${valueDict}
-
-Set Boot Source
- [Documentation] Set given boot source.
- [Arguments] ${boot_source}
- # Description of argument(s):
- # boot_source Boot source which need to be set.
-
- ${valueDict}= Create Dictionary data=${boot_source}
- Write Attribute ${CONTROL_HOST_URI}boot BootSource
- ... data=${valueDict}
-
-
-Set Boot Mode
- [Documentation] Set given boot mode.
- [Arguments] ${boot_mode}
- # Description of argument(s):
- # boot_mode Boot mode which need to be set.
-
- ${valueDict}= Create Dictionary data=${boot_mode}
- Write Attribute ${CONTROL_HOST_URI}boot BootMode
- ... data=${valueDict}
-
-
-Set Boot Type
- [Documentation] Set given boot type.
- [Arguments] ${boot_type}
- # Description of argument(s):
- # boot_type Boot type which need to be set.
-
- ${valueDict}= Create Dictionary data=${boot_type}
- Write Attribute ${CONTROL_HOST_URI}boot BootType
- ... data=${valueDict}
-
-
-Response Should Be Equal
- [Documentation] Verify that the output is equal to the given args.
- [Arguments] ${args}
- Should Be Equal ${OUTPUT} ${args}
-
-Read the Attribute
- [Documentation] Read the given attribute.
- [Arguments] ${uri} ${parm}
- ${output}= Read Attribute ${uri} ${parm}
- Set Test Variable ${OUTPUT} ${output}
-
-Post Test Case Execution
- [Documentation] Do the post test teardown.
-
- FFDC On Test Case Fail
- Set Boot Source ${BOOT_SOURCE_DEFAULT}
- Set Boot Mode ${BOOT_MODE_REGULAR}
- Run Keyword If '${PLATFORM_ARCH_TYPE}' == 'x86'
- ... Set Boot Type ${BOOT_TYPE_EFI}
- Set Boot Enable false
-
-Test Suite Setup
- [Documentation] Do the initial suite setup.
-
- Smart Power Off
-
- # Set boot policy to default i.e. one time enabled.
- ${valueDict}= Create Dictionary data=${1}
- Write Attribute ${CONTROL_HOST_URI}boot/one_time Enabled
- ... data=${valueDict}
diff --git a/tests/test_boot_policies.robot b/tests/test_boot_policies.robot
deleted file mode 100644
index a65c469..0000000
--- a/tests/test_boot_policies.robot
+++ /dev/null
@@ -1,178 +0,0 @@
-*** Settings ***
-
-Documentation This testsuite is for testing boot policy function.
-
-Resource ../lib/rest_client.robot
-Resource ../lib/ipmi_client.robot
-Resource ../lib/utils.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/state_manager.robot
-Resource ../lib/boot_utils.robot
-
-Suite Setup Suite Setup Execution
-Test Teardown FFDC On Test Case Fail
-Suite Teardown Suite Teardown Execution
-
-Force Tags boot_policy_test
-
-*** Variables ***
-${ONETIME} ${1}
-${PERMANENT} ${0}
-
-${stack_mode} skip
-
-*** Test Cases ***
-
-Set Boot Policy To ONETIME via REST
- [Documentation] Set boot policy to ONETIME using REST URI and verify
- ... using ipmitool.
- [Tags] Set_Boot_Policy_To_ONETIME_via_REST
-
- Set Boot Policy ${ONETIME}
- ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled
- Should Be Equal ${boot} ${ONETIME}
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Options apply to only next boot
-
-Set Boot Policy To PERMANENT via REST
- [Documentation] Set boot policy to PERMANENT using REST URI and verify
- ... using ipmitool.
- [Tags] Set_Boot_Policy_To_PERMANENT_via_REST
-
- Set Boot Policy ${PERMANENT}
- ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled
- Should Be Equal ${boot} ${PERMANENT}
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Options apply to all future boots
-
-Set Boot Policy To ONETIME via IPMITOOL
- [Documentation] Set boot policy to ONETIME via ipmitool and verify
- ... using REST URI.
- [Tags] Set_Boot_Policy_To_ONETIME_via_IPMITOOL
-
- Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
- ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled
- Should Be Equal ${boot} ${ONETIME}
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Options apply to only next boot
-
-Set Boot Policy To PERMANENT via IPMITOOL
- [Documentation] Set boot policy to PERMANENT via ipmitool and verify
- ... using REST URI.
- [Tags] Set_Boot_Policy_To_PERMANENT_via_IPMITOOL
-
- Run IPMI command 0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x0
- ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled
- Should Be Equal ${boot} ${PERMANENT}
- ${output}= Run IPMI Standard Command chassis bootparam get 5
- Should Contain ${output} Options apply to all future boots
-
-Test Boot Order via REST
- [Documentation] Set boot policy to PERMANENT and boot device to CDROM
- ... and verify that the order doesn't change post power on.
- [Tags] Test_Boot_Order_via_REST
-
-
- Set Boot Policy ${PERMANENT}
- Set Boot Source ${BOOT_SOURCE_CDROM}
-
- ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled
- Should Be Equal ${boot} ${PERMANENT}
-
- ${flag}= Read Attribute ${CONTROL_URI}host0/boot/ BootSource
- Should Be Equal ${flag} ${BOOT_SOURCE_CDROM}
-
-Persist ONETIME Boot Policy After Reset
- [Documentation] Verify ONETIME boot policy order does not change
- ... on warm reset.
- [Tags] Persist_ONETIME_Boot_Policy_After_Reset
-
- Set Boot Policy ${ONETIME}
- Set Boot Source ${BOOT_SOURCE_NETWORK}
-
- OBMC Reboot (off)
-
- ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled
- Should Be Equal ${boot} ${ONETIME}
-
- ${flag}= Read Attribute ${CONTROL_URI}host0/boot/ BootSource
- Should Be Equal ${flag} ${BOOT_SOURCE_NETWORK}
-
-Persist PERMANENT Boot Policy After Reset
- [Documentation] Verify PERMANENT boot policy order does not change
- ... on warm reset.
- [Tags] Persist_PERMANENT_Boot_Policy_After_Reset
-
- Set Boot Policy ${PERMANENT}
- Set Boot Source ${BOOT_SOURCE_CDROM}
-
- OBMC Reboot (off)
-
- ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled
- Should Be Equal ${boot} ${PERMANENT}
-
- ${flag}= Read Attribute ${CONTROL_URI}host0/boot/ BootSource
- Should Be Equal ${flag} ${BOOT_SOURCE_CDROM}
-
-Verify Boot Mode Persistency After BMC Reboot
- [Documentation] Verify boot mode persistency after BMC reboot.
- [Tags] Verify_Boot_Mode_Persistency_After_BMC_Reboot
- [Teardown] Run Keywords Restore Bootmode Setting
- ... AND FFDC On Test Case Fail
-
- # Record initial bootmode setting.
- ${boot_mode}= Read Attribute
- ... ${CONTROL_HOST_URI}/boot BootMode
- Set Suite Variable ${initial_boot_mode} ${boot_mode}
-
- # Set bootmode to non default value.
- Set Boot Mode ${BOOT_MODE_SAFE}
-
- OBMC Reboot (off)
-
- ${boot_mode_after}= Read Attribute
- ... ${CONTROL_HOST_URI}/boot BootMode
-
- Should Be Equal As Strings
- ... ${boot_mode_after} ${BOOT_MODE_SAFE}
-
-*** Keywords ***
-
-Set Boot Mode
- [Documentation] Set the host boot mode via REST.
- [Arguments] ${args}
- ${bootmode}= Set Variable ${args}
- ${valueDict}= Create Dictionary data=${bootmode}
- Write Attribute ${CONTROL_HOST_URI}/boot/ BootMode data=${valueDict}
-
-Set Boot Policy
- [Documentation] Set the host boot policy via REST.
- [Arguments] ${args}
- ${bootpolicy}= Set Variable ${args}
- ${valueDict}= Create Dictionary data=${bootpolicy}
- Write Attribute
- ... ${CONTROL_HOST_URI}/boot/one_time Enabled data=${valueDict}
-
-Set Boot Source
- [Documentation] Set given boot source.
- [Arguments] ${boot_source}
- # Description of argument(s):
- # boot_source Boot source which need to be set.
-
- ${valueDict}= Create Dictionary data=${boot_source}
- Write Attribute ${CONTROL_HOST_URI}/boot/ BootSource data=${valueDict}
-
-Suite Teardown Execution
- [Documentation] Restore default settings.
- Set Boot Policy ${ONETIME}
- Set Boot Source ${BOOT_SOURCE_DEFAULT}
-
-Suite Setup Execution
- [Documentation] Do the initial suite setup.
-
- Smart Power Off
-
-Restore Bootmode Setting
- [Documentation] Restore initial bootmode setting.
-
- Set Boot Mode ${initial_boot_mode}
diff --git a/tests/test_event_notification.robot b/tests/test_event_notification.robot
deleted file mode 100644
index 1aeb17d..0000000
--- a/tests/test_event_notification.robot
+++ /dev/null
@@ -1,58 +0,0 @@
-*** Settings ***
-Documentation Event notification test cases.
-
-Library ../lib/gen_cmd.py
-Library ../lib/var_funcs.py
-Library ../lib/gen_robot_valid.py
-Library ../lib/gen_robot_keyword.py
-Resource ../lib/resource.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/rest_client.robot
-
-Test Setup Printn
-
-Test Teardown FFDC On Test Case Fail
-
-*** Test Cases ***
-
-Subscribe And Verify Event Notification
- [Documentation] Subscribe and verify event notification.
- [Tags] Subscribe_And_Verify_Event_Notification
- [Teardown] Run Keyword And Ignore Error Kill Cmd ${popen}
-
- ${cmd_buf}= Catenate event_notification_util.py --quiet=1 --host=${OPENBMC_HOST}
- ... --password=${OPENBMC_PASSWORD} --dbus_path=${CONTROL_HOST_URI}power_cap
- ${popen}= Shell Cmd ${cmd_buf} return_stderr=1 fork=1
- Rprint Vars popen.pid
- Qprint Timen Allow child event_notification_util.py job to begin to wait for the event notification.
- Run Key U Sleep \ 5 seconds
-
- # Get current reading for debug.
- ${original_power_cap_settings}= Read Properties ${CONTROL_HOST_URI}power_cap quiet=1
- Rprint Vars original_power_cap_settings
-
- # Set power limit out of range.
- ${power_cap}= Evaluate random.randint(1000, 3000) modules=random
- Rprint Vars original_power_cap_settings power_cap
- ${data}= Create Dictionary data=${power_cap}
- Write Attribute ${CONTROL_HOST_URI}power_cap PowerCap data=${data}
-
- Qprint Timen Wait for child event_notification_util.py job to see the event notification.
- Run Key U Sleep \ 5 seconds
-
- Qprint Timen Retrieving output from spawned event_notification_util.py job.
- ${rc} ${stdout} ${stderr}= Kill Cmd ${popen}
- Run Keyword If ${rc} Log to Console ${stderr}
- Valid Value rc [0]
- ${event_notification}= Key Value Outbuf To Dict ${stdout} process_indent=1
- Rprint Vars event_notification
-
- # Example output:
- # interface: xyz.openbmc_project.Control.Power.Cap
- # path: /xyz/openbmc_project/control/host0/power_cap
- # event: PropertiesChanged
- # properties:
- # PowerCap: 1318
-
- Valid Value event_notification['event'] ['PropertiesChanged']
- Valid Value event_notification['properties']['powercap'] ['${power_cap}']
\ No newline at end of file
diff --git a/tests/test_hardware_sensors.robot b/tests/test_hardware_sensors.robot
deleted file mode 100644
index 9086211..0000000
--- a/tests/test_hardware_sensors.robot
+++ /dev/null
@@ -1,373 +0,0 @@
-*** Settings ***
-Documentation Suite to test hardware sensors.
-
-Resource ../lib/utils.robot
-Resource ../lib/boot_utils.robot
-Resource ../lib/state_manager.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/ipmi_client.robot
-Variables ../data/ipmi_raw_cmd_table.py
-
-Suite Setup Suite Setup Execution
-Test Teardown Test Teardown Execution
-
-*** Test Cases ***
-
-
-Verify System Ambient Temperature
- [Documentation] Check the ambient sensor temperature.
- [Tags] Verify_System_Ambient_Temperature
-
- # Example:
- # /xyz/openbmc_project/sensors/temperature/ambient
- # {
- # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
- # "Value": 25.767
- # }
-
- ${temp_data}= Read Properties ${SENSORS_URI}temperature/ambient
- Should Be Equal As Strings
- ... ${temp_data["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- Should Be True ${temp_data["Value"]} <= ${50}
- ... msg=System working temperature crossed 50 degree celsius.
-
-
-Verify Fan Sensors Attributes
- [Documentation] Check fan attributes.
- [Tags] Verify_Fan_Sensors_Attributes
-
- # Example:
- # "/xyz/openbmc_project/sensors/fan_tach/fan0_0",
- # "/xyz/openbmc_project/sensors/fan_tach/fan0_1",
- # "/xyz/openbmc_project/sensors/fan_tach/fan1_0",
- # "/xyz/openbmc_project/sensors/fan_tach/fan1_1",
- # "/xyz/openbmc_project/sensors/fan_tach/fan2_0",
- # "/xyz/openbmc_project/sensors/fan_tach/fan2_1",
- # "/xyz/openbmc_project/sensors/fan_tach/fan3_0",
- # "/xyz/openbmc_project/sensors/fan_tach/fan3_1"
-
- ${fans}= Get Endpoint Paths /xyz/openbmc_project/sensors/ fan*
-
- # Access the properties of the fan and it should contain
- # the following entries:
- # /xyz/openbmc_project/sensors/fan_tach/fan0_0
- # {
- # "Functional": true,
- # "MaxValue": 0.0,
- # "MinValue": 0.0,
- # "Target": 10500,
- # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
- # "Value": 0.0
- # }
-
- FOR ${entry} IN @{fans}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0
- Run Keyword And Ignore Error Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
- Should Be True ${json["data"]["Value"]} >= 0
- END
-
-Verify PCIE Sensors Attributes
- [Documentation] Probe PCIE attributes.
- [Tags] Verify_PCIE_Sensors_Attributes
- # Example:
- # /xyz/openbmc_project/sensors/temperature/pcie
- ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie
-
- # Access the properties of the PCIE and it should contain
- # the following entries:
- # /xyz/openbmc_project/sensors/temperature/pcie
- # {
- # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
- # "Value": 29.625
- # }
-
-
- FOR ${entry} IN @{temp_pcie}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- Should Be True ${json["data"]["Value"]} > 0
- END
-
-
-Verify Rail Voltage Sensors Attributes
- [Documentation] Check rail voltage attributes.
- [Tags] Verify_Rail_Voltage_Sensors_Attributes
- # Example of one of the entries returned by 'Get Endpoint Paths':
- # /xyz/openbmc_project/sensors/voltage/rail_1_voltage
- # /xyz/openbmc_project/sensors/voltage/rail_2_voltage
- ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail*
-
- # Example:
- # Access the properties of the rail voltage and it should contain
- # the following entries:
- # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage":
- # {
- # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
- # "Value": 5.097
- # },
-
- FOR ${entry} IN @{temp_rail}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
- Should Be True ${json["data"]["Value"]} > 0
- END
-
-
-Verify VDN Temperature Sensors Attributes
- [Documentation] Check vdn temperature attributes.
- [Tags] Verify_VDN_Temperature_Sensors_Attributes
- # Example of one of the entries returned by 'Get Endpoint Paths':
- # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
- ${temp_vdn}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdn_temp
-
- # Example:
- # Access the properties of the rail voltage and it should contain
- # the following entries:
- # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
- # {
- # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
- # "Value": 3.000
- # }
-
- FOR ${entry} IN @{temp_vdn}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- Should Be True ${json["data"]["Value"]} > 0
- END
-
-Verify VCS Temperature Sensors Attributes
- [Documentation] Check vcs temperature attributes.
- [Tags] Verify_VCS_Temperature_Sensors_Attributes
- # Example of one of the entries returned by 'Get Endpoint Paths':
- # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
- ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp
-
- # Example:
- # Access the properties of the rail voltage and it should contain
- # the following entries:
- # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
- # {
- # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
- # "Value": 31.000
- # },
-
-
- FOR ${entry} IN @{temp_vcs}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- Should Be True ${json["data"]["Value"]} > 0
- END
-
-
-Verify VDD Temperature Sensors Attributes
- [Documentation] Check vdd temperature attributes.
- [Tags] Verify_VDD_Temperature_Sensors_Attributes
- # Example of one of the entries returned by 'Get Endpoint Paths':
- # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
- ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp
-
- # Example:
- # Access the properties of the rail voltage and it should contain
- # the following entries:
- # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
- # {
- # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
- # "Value": 4.000
- # }
-
- FOR ${entry} IN @{temp_vdd}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- Should Be True ${json["data"]["Value"]} > 0
- END
-
-
-Verify VDDR Temperature Sensors Attributes
- [Documentation] Check vddr temperature attributes.
- [Tags] Verify_VDDR_Temperature_Sensors_Attributes
- # Example of one of the entries returned by 'Get Endpoint Paths':
- # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
- ${temp_vddr}=
- ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp
-
- # Example:
- # Access the properties of the rail voltage and it should contain
- # the following entries:
- # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
- # {
- # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
- # "Value": 4.000
- # }
-
- FOR ${entry} IN @{temp_vddr}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- Should Be True ${json["data"]["Value"]} > 0
- END
-
-Verify Power Sensors Attributes
- [Documentation] Check power sensor attributes.
- [Tags] Verify_Power_Sensors_Attributes
- # Example:
- # /xyz/openbmc_project/sensors/power/power_1
- # /xyz/openbmc_project/sensors/power/power_2
- # /xyz/openbmc_project/sensors/power/power0
- # /xyz/openbmc_project/sensors/power/POWER1
- # /xyz/openbmc_project/sensors/power/POWER_1
-
- ${power}= Get Endpoint Paths /xyz/openbmc_project/sensors/ power*
-
- # Access the properties of the power sensors and it should contain
- # the following entries:
- # /xyz/openbmc_project/sensors/power/power_1
- # {
- # "MaxValue": 255.0,
- # "MinValue": 0.0,
- # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts",
- # "Value": 0.0
- # }
-
- FOR ${entry} IN @{power}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0
- Should Be True ${json["data"]["Value"]} >= 0
- END
-
-
-Verify Voltage Sensors Attributes
- [Documentation] Check voltage sensors attributes.
- [Tags] Verify_Voltage_Sensors_Attributes
-
- # Example:
- # "/xyz/openbmc_project/sensors/voltage/voltage0",
- # "/xyz/openbmc_project/sensors/voltage/voltage_1",
- # "/xyz/openbmc_project/sensors/voltage/VOLTAGE_2",
- # "/xyz/openbmc_project/sensors/voltage/VOLTAGE1",
- # "/xyz/openbmc_project/sensors/voltage/voltage".
-
- ${voltage}= Get Endpoint Paths /xyz/openbmc_project/sensors/voltage/ *
-
- # Access the properties of the voltage sensors and it should contain
- # the following entries:
- # /xyz/openbmc_project/sensors/voltage/voltage0
- # {
- # "MaxValue": 255.0,
- # "MinValue": 0.0,
- # "Unit": xyz.openbmc_project.Sensor.Value.Unit.Volts
- # "Value": 0.0
- # }
-
- FOR ${entry} IN @{voltage}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Run Keyword And Ignore Error Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
- Run Keyword And Ignore Error Should Be True ${json["data"]["Value"]} >= 0
- END
-
-
-Verify Current Sensors Attributes
- [Documentation] Check current sensors attributes.
- [Tags] Verify_Current_Sensors_Attributes
-
- # Example:
- # "/xyz/openbmc_project/sensors/current/current0",
- # "/xyz/openbmc_project/sensors/current/current_1",
- # "/xyz/openbmc_project/sensors/current/CURRENT_2",
- # "/xyz/openbmc_project/sensors/current/CURRENT1",
- # "/xyz/openbmc_project/sensors/current/current".
-
- ${current}= Get Endpoint Paths /xyz/openbmc_project/sensors/ curr*
-
- # Access the properties of the current sensors and it should contain
- # the following entries:
- # /xyz/openbmc_project/sensors/current/current0
- # {
- # "MaxValue": 255.0,
- # "MinValue": 0.0,
- # "Unit": xyz.openbmc_project.Sensor.Value.Unit.Amperes
- # "Value": 0.0
- # }
-
- FOR ${entry} IN @{current}
- ${resp}= OpenBMC Get Request ${entry}
- ${json}= To JSON ${resp.content}
- Run Keyword And Ignore Error Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Amperes
- Should Be True ${json["data"]["Value"]} >= 0
- END
-
-
-Verify Power Redundancy Using REST
- [Documentation] Verify power redundancy is enabled.
- [Tags] Verify_Power_Redundancy_Using_REST
-
- # Example:
- # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
- # {
- # "error": 0,
- # "units": "",
- # "value": "Enabled"
- # }
-
- # Power Redundancy is a read-only attribute. It cannot be set.
-
- # Pass if sensor is in /xyz and it's enabled.
- ${redundancy_setting}= Read Attribute
- ... ${OPENBMC_BASE_URI}control/power_supply_redundancy
- ... PowerSupplyRedundancyEnabled
- Should Be Equal As Integers ${redundancy_setting} ${1}
- ... msg=PowerSupplyRedundancyEnabled not set as expected.
-
-
-Verify Power Redundancy Using IPMI
- [Documentation] Verify IPMI reports Power Redundancy is enabled.
- [Tags] Verify_Power_Redundancy_Using_IPMI
-
- # Refer to data/ipmi_raw_cmd_table.py for command definition.
- # Power Redundancy is a read-only attribute. It cannot be set.
-
- ${output}= Run IPMI Standard Command
- ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]}
-
- ${scanning}= Set Variable
- ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]}
- ${no_scanning}= Set Variable
- ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]}
-
- ${enabled_scanning}= Evaluate $scanning in $output
- ${enabled_no_scanning}= Evaluate $no_scanning in $output
-
- # Either enabled_scanning or enabled_noscanning should be True.
- Should Be True ${enabled_scanning} or ${enabled_no_scanning}
- ... msg=Failed IPMI power redundancy check, result=${output}.
-
-
-*** Keywords ***
-
-Suite Setup Execution
- [Documentation] Do the initial test suite setup.
- # - Power off.
- # - Boot Host.
- REST Power Off stack_mode=skip
- REST Power On
-
-Test Teardown Execution
- [Documentation] Do the post test teardown.
- # - Capture FFDC on test failure.
- # - Delete error logs.
- # - Close all open SSH connections.
-
- FFDC On Test Case Fail
- Delete All Error Logs
- Close All Connections
diff --git a/tests/test_host_console.robot b/tests/test_host_console.robot
deleted file mode 100644
index 1bbecf5..0000000
--- a/tests/test_host_console.robot
+++ /dev/null
@@ -1,53 +0,0 @@
-*** Settings ***
-Documentation This suite will test the host console
-
-Resource ../lib/resource.robot
-Resource ../lib/utils.robot
-
-Library SSHLibrary
-
-Suite Setup Open Connection And Log In
-Test Setup Test Setup Execution
-Suite Teardown Close All Connections
-
-*** Variables ***
-
-${HOST_LOG_PATH} /var/lib/obmc/hostlogs
-
-
-*** Test Cases ***
-
-Verify Host Console Connection
- [Documentation] Connect the obmc-console from BMC and verify the logs.
- [Tags] Verify_Host_Console_Connection
-
- Write obmc-console-client
- Write \n
- ${write}= Read Until login:
- Write ${OS_USERNAME}
- ${pass}= Read Until Password:
- Write ${OS_PASSWORD}
- Write hostname
- Write exit
-
- BMC Execute Command rm -rf ${HOST_LOG_PATH}
- ${id} ${stderr} ${rc}= BMC Execute Command ps | grep hostlogger | grep -v grep | cut -c2-5
-
- # Flush the messages generated in buffer and store as a log file.
- BMC Execute Command kill -s USR1 ${id}
- Sleep 5s
- ${gz_file} ${stderr} ${rc}= BMC Execute Command ls ${HOST_LOG_PATH}
- BMC Execute Command gunzip ${HOST_LOG_PATH}/${gz_file}
- Sleep 5s
- ${log_file} ${stderr} ${rc}= BMC Execute Command ls ${HOST_LOG_PATH}
- ${string_compare} = BMC Execute Command grep hostname ${HOST_LOG_PATH}/${log_file}
- Should Be True ${string_compare} hostname
-
-
-*** Keywords ***
-
-Test Setup Execution
- [Documentation] Do test case setup tasks.
-
- Should Not Be Empty ${OS_USERNAME}
- Should Not Be Empty ${OS_PASSWORD}
diff --git a/tests/test_inventory.robot b/tests/test_inventory.robot
deleted file mode 100644
index 96fdc7d..0000000
--- a/tests/test_inventory.robot
+++ /dev/null
@@ -1,713 +0,0 @@
-*** Settings ***
-Documentation System inventory related test.
-
-Resource ../lib/rest_client.robot
-Resource ../lib/utils.robot
-Resource ../lib/state_manager.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/list_utils.robot
-Resource ../lib/boot_utils.robot
-Resource ../lib/fan_utils.robot
-Library ../lib/utilities.py
-Library Collections
-
-Variables ../data/variables.py
-Variables ../data/inventory.py
-
-Suite Setup Suite Setup Execution
-Test Teardown FFDC On Test Case Fail
-
-Force Tags Inventory
-
-***Variables***
-
-${LOOP_COUNT} ${1}
-
-*** Test Cases ***
-
-Verify System Inventory Path
- [Documentation] Check if system inventory path exist.
- [Tags] Verify_System_Inventory_Path
- # When the host is booted, system inventory path should exist.
- # Example: /xyz/openbmc_project/inventory/system
- Get Inventory system
-
-
-Verify Boxelder Present Property
- [Documentation] Boxelder should be present by default.
- [Tags] Verify_Boxelder_Present_Property
- # Example:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc":
- # {
- # "BuildDate": "",
- # "FieldReplaceable": 0,
- # "Manufacturer": "<Manufacturer Name>",
- # "Model": "",
- # "PartNumber": "01DH051",
- # "Present": 1,
- # "PrettyName": "BMC PLANAR ",
- # "SerialNumber": "000000000000"
- # },
- ${json_data}= Get Inventory system/chassis/motherboard/boxelder/bmc
- Should Be True ${json_data["data"]["Present"]}
- Should Not Be Equal As Strings
- ... ${json_data["data"]["SerialNumber"]} 000000000000
- ... msg=BMC planar serial number invalid.
-
-
-Verify UUID Entry
- [Documentation] UUID entry should exist in BMC planar property.
- [Tags] Verify_UUID_Entry
- # Example:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc":
- # {
- # "BuildDate": "",
- # "FieldReplaceable": 0,
- # "Manufacturer": "<Manufacturer Name>",
- # "Model": "",
- # "PartNumber": "01DH051",
- # "Present": 1,
- # "PrettyName": "BMC PLANAR ",
- # "SerialNumber": "000000000000"
- # "UUID": ""
- # },
- ${resp}= OpenBMC Get Request
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/boxelder/bmc/attr/UUID
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
-
-
-Verify Boxelder MAC Address Property Is Populated
- [Documentation] Boxelder should be present by default.
- [Tags] Verify_Boxelder_MAC_Address_Property_Is_Populated
- # Example:
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc/ethernet
- # {
- # "FieldReplaceable": 0,
- # "MACAddress": "00:00:00:00:00:00",
- # "Present": 1,
- # "PrettyName": ""
- # }
-
- ${json_data}= Get Inventory
- ... system/chassis/motherboard/boxelder/bmc/ethernet
- Should Be True ${json_data["data"]["Present"]}
- Should Not Be Equal As Strings
- ... ${json_data["data"]["MACAddress"]} 00:00:00:00:00:00
-
- # eth0 Link encap:Ethernet HWaddr 70:E2:84:14:23:F9
- ${mac_addr} ${stderr} ${rc}= BMC Execute Command
- ... /sbin/ifconfig -a | grep eth0 | grep HWaddr | awk -F'HWaddr ' '{print $2}'
- ... return_stderr=True
- Should Be Empty ${stderr}
- Should Be Equal As Strings ${json_data["data"]["MACAddress"]}
- ... ${mac_addr.strip()} msg=MAC address configured incorrectly.
- ... ignore_case=True
-
-
-Verify Chassis Motherboard Properties
- [Documentation] Check if chassis motherboard properties are
- ... populated valid.
- [Tags] Verify_Chassis_Motherboard_Properties
- # When the host is booted, the following properties should
- # be populated Manufacturer, PartNumber, SerialNumber and
- # it should not be zero's.
- # Example:
- # "data": {
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard": {
- # "BuildDate": "",
- # "Manufacturer": "0000000000000000",
- # "Model": "",
- # "PartNumber": "0000000",
- # "Present": 0,
- # "PrettyName": "SYSTEM PLANAR ",
- # "SerialNumber": "000000000000"
- # }
- ${properties}= Get Inventory system/chassis/motherboard
- Should Not Be Equal As Strings
- ... ${properties["data"]["PartNumber"]} 0000000
- ... msg=motherboard part number invalid.
- Should Not Be Equal As Strings
- ... ${properties["data"]["SerialNumber"]} 000000000000
- ... msg=motherboard serial number invalid.
-
-Verify CPU Present
- [Documentation] Check if the FRU "Present" is set for CPU's.
- [Tags] Verify_CPU_Present
- # System inventory cpu list:
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
- # Example:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
- # "FieldReplaceable": 1,
- # "BuildDate": "",
- # "Cached": 0,
- # "SerialNumber": "YA3933741574",
- # "Version": "10",
- # "Model": "",
- # "PrettyName": "PROCESSOR MODULE",
- # "PartNumber": "01HL322",
- # "Present": 1,
- # "Manufacturer": "<Manufacturer Name>"
- # },
- # The CPU properties "Present" should be boolean 1.
-
- ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu
- FOR ${cpu_uri} IN @{cpu_list}
- ${present}= Read Attribute ${cpu_uri} Present
- Should Be True ${present}
- END
-
-Verify DIMM Present
- [Documentation] Check if the FRU "Present" is set for DIMM's.
- [Tags] Verify_DIMM_Present
- # Example:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
- # "FieldReplaceable": 1,
- # "BuildDate": "",
- # "Cached": 0,
- # "SerialNumber": "0x0300cf4f",
- # "Version": "0x00",
- # "Model": "M393A1G40EB1-CRC ",
- # "PrettyName": "0x0c",
- # "PartNumber": "",
- # "Present": 1,
- # "Manufacturer": "0xce80"
- # },
-
- # The DIMM properties "Present" should be boolean 1.
-
- ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
- FOR ${dimm_uri} IN @{dimm_list}
- ${present}= Read Attribute ${dimm_uri} Present
- Should Be True ${present}
- END
-
-Verify FRU Properties
- [Documentation] Verify the FRU properties fields.
- [Tags] Verify_FRU_Properties
- # Example:
- # A FRU would have "FieldReplaceable" set to boolean 1 and should have
- # the following entries
- # "fru": [
- # "FieldReplaceable"
- # "BuildDate",
- # "Cached"
- # "SerialNumber",
- # "Version",
- # "Model",
- # "PrettyName",
- # "PartNumber",
- # "Present",
- # "Manufacturer",
- # ]
- # and FRU which doesn't have one of this fields is an error.
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
- # "FieldReplaceable": 1,
- # "BuildDate": "",
- # "Cached": 0,
- # "SerialNumber": "0x0300cf4f",
- # "Version": "0x00",
- # "Model": "M393A1G40EB1-CRC ",
- # "PrettyName": "0x0c",
- # "PartNumber": "",
- # "Present": 1,
- # "Manufacturer": "0xce80"
- # },
-
- ${system_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system *
- ${fru_list}= Qualified FRU List @{system_list}
- Validate FRU Properties Fields fru EQU @{fru_list}
-
-
-Verify GPU Properties
- [Documentation] Verify the GPU properties fields.
- [Tags] Verify_GPU_Properties
- # Example:
- # A GPU property should have the following entries:
- # "gpu":[
- # "FieldReplaceable",
- # "PrettyName",
- # "Present",
- # "Functional"
- # ]
- # GPU inventory:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card2": {
- # "FieldReplaceable": 1,
- # "Functional": 1,
- # "Present": 1,
- # "PrettyName": ""
- # },
-
-
- ${system_list}= Get Endpoint Paths
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard gv*
- Validate FRU Properties Fields gpu EQU @{system_list}
-
-
-Verify Core Properties
- [Documentation] Verify the core property fields.
- [Tags] Verify_Core_Properties
- # Example:
- # A core property should have the following entries:
- # "core":[
- # "PrettyName",
- # "Present",
- # "Functional"
- # ]
- # core inventory:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core0": {
- # "Functional": 1,
- # "Present": 1,
- # "PrettyName": ""
- # },
-
- ${system_list}= Get Endpoint Paths
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard core*
- Validate FRU Properties Fields core EQU @{system_list}
-
-
-Verify Fan Properties
- [Documentation] Verify the fan property fields.
- [Tags] Verify_Fan_Properties
- # Example:
- # A fan property should have the following entries:
- # "core":[
- # "PrettyName",
- # "Present",
- # "MeetsMinimumShipLevel",
- # "Functional"
- # ]
- # fan inventory:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": {
- # "Functional": 1,
- # "MeetsMinimumShipLevel": 1,
- # "Present": 1,
- # "PrettyName": "fan0"
- # },
-
- ${water_cooled}= Is Water Cooled
-
- ${system_list}= Get Endpoint Paths
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard fan*
-
- Printn
- Rprint Vars water_cooled system_list
-
- Run Keyword If ${water_cooled}
- ... Validate FRU Properties Fields fan_wc SUBSET @{system_list}
- ... ELSE
- ... Validate FRU Properties Fields fan EQU @{system_list}
-
-
-Verify Core Functional State
- [Documentation] Verify that "Present" core property is set if "Functional"
- ... core property is set.
- [Tags] Verify_Core_Functional_State
- # Example:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core5":{
- # "Functional": 1,
- # "Present": 1,
- # "PrettyName": ""
- # },
- ${core_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system core
- FOR ${core_uri} IN @{core_list}
- ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${core_uri}
- Continue For Loop If '${status}' == '${False}'
- ${present}= Read Attribute ${core_uri} Present
- Should Be True ${present}
- ... msg=${core_uri} is functional but not present.
- END
-
-
-Verify DIMM Functional State
- [Documentation] Verify that "Present" DIMM property is set if "Functional"
- ... DIMM property is set.
- [Tags] Verify_DIMM_Functional_State
- # Example:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
- # "BuildDate": "",
- # "Cached": 0,
- # "FieldReplaceable": 1,
- # "Functional": 1,
- # "Manufacturer": "0xce80",
- # "Model": "M393A1G40EB1-CRC ",
- # "PartNumber": "",
- # "Present": 1,
- # "PrettyName": "0x0c",
- # "SerialNumber": "0x0300cf4f",
- # "Version": "0x00"
- # },
-
- ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
- FOR ${dimm_uri} IN @{dimm_list}
- ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${dimm_uri}
- Continue For Loop If '${status}' == '${False}'
- ${present}= Read Attribute ${dimm_uri} Present
- Should Be True ${present}
- ... msg=${dimm_uri} is functional but not present.
- END
-
-
-Verify Fan Functional State
- [Documentation] Verify that "Present" fan property is set if "Functional"
- ... fan property is set.
- [Tags] Verify_Fan_Functional_State
- # Example:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": {
- # "Functional": 1,
- # "Present": 1,
- # "PrettyName": "fan0"
- # },
-
- ${fan_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system fan*
- Should Not Be Empty ${fan_list}
- FOR ${fan_uri} IN @{fan_list}
- ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${fan_uri}
- Continue For Loop If '${status}' == '${False}'
- ${present}= Read Attribute ${fan_uri} Present
- Should Be True ${present}
- ... msg=${fan_uri} is functional but "Present" is not set.
- END
-
-
-Verify CPU Functional State
- [Documentation] Verify that "Present" CPU property is set if "Functional"
- ... CPU property is set.
- [Tags] Verify_CPU_Functional_State
-
- # Example of cpu* endpoint data:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
- # "Functional": 1,
- # "Present": 1,
- # "PrettyName": "cpu0"
- # },
-
- ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu*
- Should Not Be Empty ${cpu_list}
- FOR ${cpu_uri} IN @{cpu_list}
- ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${cpu_uri}
- Continue For Loop If '${status}' == '${False}'
- ${present}= Read Attribute ${cpu_uri} Present
- Should Be True ${present}
- ... msg=${cpu_uri} is functional but "Present" is not set.
- END
-
-
-Verify GPU Functional State
- [Documentation] Verify that "Functional" GPU property is set if "Present"
- ... GPU property is set
- [Tags] Verify_GPU_Functional_State
-
- # Example of gv* endpoint data:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4": {
- # "Functional": 1,
- # "Present": 1,
- # "PrettyName": ""
- # },
-
-
- ${gpu_list}= Get Endpoint Paths
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard gv*
- Should Not Be Empty ${gpu_list}
- FOR ${gpu_uri} IN @{gpu_list}
- ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${gpu_uri}
- Continue For Loop If '${status}' == '${False}'
- ${present}= Read Attribute ${gpu_uri} Present
- Should Be True ${present}
- ... msg=${gpu_uri} is functional but "Present" is not set.
- END
-
-Check Air Or Water Cooled
- [Documentation] Check if this system is Air or water cooled.
- [Tags] Check_Air_Or_Water_Cooled
- # Example:
- # "/xyz/openbmc_project/inventory/system/chassis": {
- # "AirCooled": 1,
- # "WaterCooled": 0
- # },
-
- ${air_cooled}= Read Attribute
- ... /xyz/openbmc_project/inventory/system/chassis AirCooled
- Log AirCooled:${air_cooled}
-
- ${water_cooled}= Read Attribute
- ... /xyz/openbmc_project/inventory/system/chassis WaterCooled
- Log WaterCooled:${water_cooled}
-
- Run Keyword If ${air_cooled}==${0} and ${water_cooled}==${0}
- ... Fail Neither AirCooled or WaterCooled.
-
-Verify Minimal CPU Inventory
- [Documentation] Verify minimal CPU inventory.
- [Tags] Verify_Minimal_CPU_Inventory
- [Template] Minimum Inventory
-
- # item minimum_count
- cpu 1
-
-Verify Minimal DIMM Inventory
- [Documentation] Verify minimal DIMM inventory.
- [Tags] Verify_Minimal_DIMM_Inventory
- [Template] Minimum Inventory
-
- # item minimum_count
- dimm 2
-
-Verify Minimal Core Inventory
- [Documentation] Verify minimal core inventory.
- [Tags] Verify_Minimal_Core_Inventory
- [Template] Minimum Inventory
-
- # item minimum_count
- core 1
-
-Verify Minimal Memory Buffer Inventory
- [Documentation] Verify minimal memory buffer inventory.
- [Tags] Verify_Minimal_Memory_Buffer_Inventory
- [Template] Minimum Inventory
-
- # item minimum_count
- memory_buffer 1
-
-Verify Minimal Fan Inventory
- [Documentation] Verify minimal fan inventory.
- [Tags] Verify_Minimal_Fan_Inventory
- [Template] Minimum Inventory
-
- # item minimum_count
- fan 2
-
-Verify Minimal Main Planar Inventory
- [Documentation] Verify minimal main planar inventory.
- [Tags] Verify_Minimal_Main_Planar_Inventory
- [Template] Minimum Inventory
-
- # item minimum_count
- main_planar 1
-
-Verify Minimal System Inventory
- [Documentation] Verify minimal system inventory.
- [Tags] Verify_Minimal_System_Inventory
- [Template] Minimum Inventory
-
- # item minimum_count
- system 1
-
-Verify Minimal Power Supply Inventory
- [Documentation] Verify minimal power supply inventory.
- [Tags] Verify_Minimal_Power_Supply_Inventory
- [Template] Minimum Inventory
- # Example:
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0",
- # "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1",
-
- # item minimum_count
- powersupply 1
-
-
-Verify Inventory List After Reboot
- [Documentation] Verify inventory list after reboot.
- [Tags] Verify_Inventory_List_After_Reboot
-
- Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reboot
-
-
-Verify Inventory List After Reset
- [Documentation] Verify inventory list after reset.
- [Tags] Verify_Inventory_List_After_Reset
-
- Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reset
-
-*** Keywords ***
-
-Suite Setup Execution
- [Documentation] Do the initial suite setup.
-
- Smart Power Off
- REST Power On
- Delete All Error Logs
-
-Get Inventory
- [Documentation] Get the properties of an endpoint.
- [Arguments] ${endpoint}
- # Description of arguments:
- # endpoint string for which url path ending.
- # Example: "system" is the endpoint for url
- # /xyz/openbmc_project/inventory/system
- ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint}
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
- ${jsondata}= To JSON ${resp.content}
- [Return] ${jsondata}
-
-
-Qualified FRU List
- [Documentation] Build the list of valid FRUs.
- [Arguments] @{system_list}
- # Description of arguments:
- # system_list List of system inventory URLs.
- # Example:
- # /xyz/openbmc_project/inventory/system/chassis/motherboard
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm2
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm3
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm4
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm5
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm6
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm7
-
- ${fru_list}= Create List
- FOR ${fru_uri} IN @{system_list}
- ${resp}= OpenBMC Get Request ${fru_uri}/attr/FieldReplaceable
- ... quiet=${1}
- ${jsondata}= To JSON ${resp.content}
- ${status}= Run Keyword And Return Status
- ... Should Be True ${jsondata['data']} == ${1}
- Run Keyword If '${status}' == '${True}'
- ... Append To List ${fru_list} ${fru_uri}
- END
-
- ${fru_valid_list}= Filter GPU FRU Entries ${fru_list}
-
- [Return] ${fru_valid_list}
-
-
-Filter GPU FRU Entries
- [Documentation] Remove GPU entries from FRU list and return the result.
- [Arguments] ${fru_list}
-
- # Description of arguments:
- # fru_list List of FRU system inventory URIs.
- # Example FRUs list:
- # [u'/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card0',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card1',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card3',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4']
-
- # Example of the matched GPU FRUs entries:
- # [u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card0',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card1',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card3',
- # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4']
-
- ${gpu_matches}= Get Matches ${fru_list} *gv*
-
- Remove Values From List ${fru_list} @{gpu_matches}
- [Return] ${fru_list}
-
-
-Validate FRU Properties Fields
- [Documentation] Compare valid FRUs from system to expected FRU set.
- [Arguments] ${fru_type} ${comparison_type} @{fru_list}
-
- # Description of argument(s):
- # fru_type FRU type name (e.g. "gpu", "fru", "fan", etc.).
- # comparison_type A string indicating the comparison method.
- # "EQU" for equality, "SUBSET" for subset comparison.
- # fru_list List of FRU URLs.
-
- # Get the pre-defined fru_type attributes from the inventory dictionary
- # for the fru_type. Example:
- # set(['Version', 'PartNumber', 'SerialNumber', 'FieldReplaceable',
- # 'BuildDate', 'Present', 'Manufacturer', 'PrettyName', 'Cached', 'Model'])
- ${fru_set}= List To Set ${inventory_dict['${fru_type}']}
-
- Rprint Vars fru_set
-
- # Iterate through the url of the FRU and compare its attributes with
- # the pre-defined fru_type attributes.
- FOR ${fru_url_path} IN @{fru_list}
- ${fru_field}= Read Properties ${fru_url_path}
- ${fru_keys}= List To Set ${fru_field.viewkeys()}
- Rprint Vars fru_keys
- Run Keyword If '${comparison_type}' == 'EQU'
- ... Should Be Equal ${fru_keys} ${fru_set}
- ... ELSE
- ... Should Be True $fru_set.issubset($fru_keys)
- END
-
-
-Check URL Property Is Functional
- [Documentation] Verify that the given url property is functional.
- [Arguments] ${url_path}
- # Description of arguments:
- # url_path Full url path of the inventory object.
- # Example: DIMM / core property url's
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0
- ${state}= Read Attribute ${url_path} Functional
- Should Be True ${state}
-
-Choose Boot Option
- [Documentation] Choose BMC reset or host reboot.
- [Arguments] ${option}
-
- Run Keyword If '${option}' == 'reboot'
- ... Verify Inventory List Before And After Reboot
- ... ELSE
- ... Verify Inventory List Before And After Reset
-
-
-Verify Inventory List Before And After Reboot
- [Documentation] Verify inventory list before and after reboot.
-
- REST Power On stack_mode=skip quiet=1
- Delete All Error Logs
- ${inventory_before}= Get URL List ${HOST_INVENTORY_URI}
- Host Reboot
- Delete All Error Logs
- ${inventory_after}= Get URL List ${HOST_INVENTORY_URI}
- Lists Should Be Equal ${inventory_before} ${inventory_after}
-
-
-Verify Inventory List Before And After Reset
- [Documentation] Verify inventory list before and after BMC reset.
-
- REST Power On stack_mode=skip quiet=1
- Delete All Error Logs
- ${inventory_before}= Get URL List ${HOST_INVENTORY_URI}
- OBMC Reboot (run)
- Delete All Error Logs
- ${inventory_after}= Get URL List ${HOST_INVENTORY_URI}
- Lists Should Be Equal ${inventory_before} ${inventory_after}
-
-
-Minimum Inventory
- [Documentation] Check for minimum inventory.
- [Arguments] ${item} ${minimum_count}
-
- # Description of argument(s):
- # item Inventory name (example: "fan/cpu/dimm/etc").
- # minimum_count The minimum number of the given item.
-
- ${count}= Get Number Hardware Items ${item}
- Should Be True ${count}>=${minimum_count}
-
-Get Number Hardware Items
- [Documentation] Get the count of the total present currently on inventory.
- [Arguments] ${item}
-
- # Description of argument(s):
- # item Inventory name (example: "fan/cpu/dimm/etc").
-
- ${count_inventory} Set Variable ${0}
- ${list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system/
- ... ${item}
-
- FOR ${element} IN @{list}
- ${present}= Read Properties ${element}
- ${count_inventory}= Set Variable if ${present['Present']} == 1
- ... ${count_inventory+1} ${count_inventory}
- END
- [return] ${count_inventory}
diff --git a/tests/test_led.robot b/tests/test_led.robot
deleted file mode 100644
index cc1f125..0000000
--- a/tests/test_led.robot
+++ /dev/null
@@ -1,100 +0,0 @@
-*** Settings ***
-
-Documentation Test the functions of system LEDs.
-
-Resource ../lib/rest_client.robot
-Resource ../lib/state_manager.robot
-Resource ../lib/resource.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/utils.robot
-
-Test Teardown FFDC On Test Case Fail
-
-Force Tags System_LED
-
-*** Variables ***
-
-
-*** Test Cases ***
-
-Test Heartbeat LED And Verify Via REST
- [Documentation] Turn On Off heartbeat LED and verify via REST.
- [Tags] Test_Heartbeat_LED_And_Verify_Via_REST
- [Template] Set System LED State
-
- #LED Name LED State
- heartbeat On
- heartbeat Off
-
-Test Beep LED And Verify Via REST
- [Documentation] Turn On Off beep LED and verify via REST.
- [Tags] Test_Beep_LED_And_Verify_Via_REST
- [Template] Set System LED State
-
- #LED Name LED State
- beep On
- beep Off
-
-Test Identify LED And Verify Via REST
- [Documentation] Turn On Off identify LED and verify via REST.
- [Tags] Test_Identify_LED_And_Verify_Via_REST
- [Template] Set System LED State
-
- #LED Name LED State
- identify On
- identify Off
-
-Test Power LED And Verify Via REST
- [Documentation] Turn On/Off power LED and verify via REST.
- [Tags] Test_Power_LED_And_Verify_Via_REST
- [Template] Set System LED State
-
- # LED Name LED State
- rear_power On
- rear_power Off
- front_power On
- front_power Off
-
-Test Fault LED And Verify Via REST
- [Documentation] Turn On/Off fault LED and verify via REST.
- [Tags] Test_Fault_LED_And_Verify_Via_REST
- [Template] Set System LED State
-
- # LED Name LED State
- rear_fault On
- rear_fault Off
- front_fault On
- front_fault Off
-
-Test Rear Identify LED And Verify Via REST
- [Documentation] Turn On/Off identify LED and verify via REST.
- [Tags] Test_Rear_Identify_LED_And_Verify_Via_REST
- [Template] Set System LED State
-
- #LED Name LED State
- rear_id On
- rear_id Off
- front_id On
- front_id Off
-
-
-Verify Rear Power LED With Host Power Off
- [Documentation] Verify power LED state with host power off.
- [Tags] Verify_Rear_Power_LED_With_Host_Power_Off
-
- REST Power Off
- ${resp}= Get System LED State rear_power
- Should Be Equal ${resp} Blink
- ${resp}= Get System LED State front_power
- Should Be Equal ${resp} Blink
-
-
-Verify Rear Power LED With Host Power On
- [Documentation] Verify power LED state with host power on.
- [Tags] Verify_Rear_Power_LED_With_Host_Power_On
-
- REST Power On
- ${resp}= Get System LED State rear_power
- Should Be Equal ${resp} On
- ${resp}= Get System LED State front_power
- Should Be Equal ${resp} On
diff --git a/tests/test_ledgroup.robot b/tests/test_ledgroup.robot
deleted file mode 100644
index ae9290a..0000000
--- a/tests/test_ledgroup.robot
+++ /dev/null
@@ -1,169 +0,0 @@
-*** Settings ***
-
-Documentation Test LED groups in OpenBMC.
-
-Resource ../lib/rest_client.robot
-Resource ../lib/resource.robot
-Resource ../lib/openbmc_ffdc.robot
-
-Suite Setup Setup The Suite
-Test Teardown FFDC On Test Case Fail
-
-Force Tags LED_Group
-
-*** Variables ***
-
-
-*** Test Cases ***
-
-Verify CPU Fault LEDs Group
- [Documentation] Verify CPU's fault LEDs.
- [Tags] Verify_CPU_Fault_LEDs_Group
-
- Verify LED Group cpu fault
-
-Verify Fan Fault LEDs Group
- [Documentation] Verify fan's fault LEDs.
- [Tags] Verify_Fan_Fault_LEDs_Group
-
- Verify LED Group fan fault
-
-Verify DIMM Fault LEDs Group
- [Documentation] Verify DIMM's fault LEDs.
- [Tags] Verify_DIMM_Fault_LEDs_Group
-
- Verify LED Group dimm fault
-
-Verify GPU Fault LEDs Group
- [Documentation] Verify GPU's fault LEDs.
- [Tags] Verify_GPU_Fault_LEDs_Group
-
- Verify LED Group gv100card fault
-
-Verify Power Supply Fault LEDs Group
- [Documentation] Verify power supply's fault LEDs.
- [Tags] Verify_Power_Supply_Fault_LEDs_Group
-
- Verify LED Group powersupply fault
-
-Verify Enclosure Fault LED Group
- [Documentation] Validate enclosure's fault LED.
- [Tags] Verify_Enclosure_Fault_LED_Group
-
- Verify LED Group enclosure fault
-
-Verify Power State LEDs Group
- [Documentation] Verify power state LEDs.
- [Tags] Verify_Power_State_LEDs_Group
-
- Verify LED Group power
-
-Verify Enclosure Identify LED Group
- [Documentation] Validate enclosure's identify LED.
- [Tags] Verify_Enclosure_Identify_LED_Group
-
- Verify LED Group enclosure identify
-
-Verify Fan Identify LEDs Group
- [Documentation] Verify fan's identify LEDs.
- [Tags] Verify_Fan_Identify_LEDs_Group
-
- Verify LED Group fan identify
-
-Verify Other Fault LEDs Group
- [Documentation] Verify other fault LEDs.
- [Tags] Verify_Other_Fault_LEDs_Group
-
- Verify LED Group system_fault
- Verify LED Group boxelder_fault
- Verify LED Group bmc_fault
- Verify LED Group motherboard_fault
-
-Verify Enclosure Fault LED On Assertion
- [Documentation] Verify enclosure fault LED on assertion.
- [Tags] Verify_Enclosure_Fault_LED_On_Assertion
-
- Set LED State On cpu0_fault
- ${resp}= Get System LED State rear_fault
- Should Be Equal ${resp} On
-
-
-Verify Rear Power LED Association With Group LED
- [Documentation] Verify rear power LED state association with
- ... power on group LED.
- [Tags] Verify_Rear_Power_LED_Association_With_Group_LED
-
- Set LED State On power_on
- ${resp}= Get System LED State rear_power
- Should Be Equal ${resp} On
-
- Set LED State Off power_on
- ${resp}= Get System LED State rear_power
- Should Be Equal ${resp} Blink
-
-
-***Keywords***
-
-Set LED State
- [Documentation] Set state of given LED to on or off.
- [Arguments] ${state} ${led_name}
- # Description of arguments:
- # state LED's state to set, i.e. On or Off
- # led_name Name of LED
-
- ${data}= Run Keyword If
- ... '${state}' == 'On' Create Dictionary data=${True}
- ... ELSE IF '${state}' == 'Off' Create Dictionary data=${False}
- ... ELSE Fail msg=Invalid LED state
-
- ${resp}= OpenBMC Put Request
- ... ${LED_GROUPS_URI}${led_name}/attr/Asserted data=${data}
- ${jsondata}= to JSON ${resp.content}
- Should Be Equal As Strings ${jsondata['status']} ok
-
-Verify LED Group
- [Documentation] Set and validate state of all LEDs with given name.
- [Arguments] ${led_prefix} ${led_suffix}=${EMPTY}
- # Description of arguments:
- # led_prefix LED name's prefix
- # led_suffix LED name's suffix
-
- ${led_list}= Get LED List ${led_prefix} ${led_suffix}
-
- ${list_length}= Get Length ${led_list}
- Should Be True ${list_length} > 0
- ... msg=No ${led_prefix} ${led_suffix} LED found
-
- FOR ${led} IN @{led_list}
- Set LED State On ${led}
- ${resp}= Get LED State XYZ ${led}
- Should Be Equal ${resp} ${1}
- Set LED State Off ${led}
- ${resp}= Get LED State XYZ ${led}
- Should Be Equal ${resp} ${0}
- END
-
-Setup The Suite
- [Documentation] Test setup before running this suite.
-
- ${resp}= Read Properties ${LED_GROUPS_URI}
- Set Suite Variable ${LED_GROUPS} ${resp}
-
-Get LED List
- [Documentation] Returns all LEDs with given name.
- [Arguments] ${led_prefix} ${led_suffix}=${EMPTY}
- # Description of arguments:
- # led_prefix LED name's prefix
- # led_suffix LED name's suffix
-
- ${list}= Get Matches
- ... ${LED_GROUPS} regexp=^.*[0-9a-z_].${led_prefix}.*${led_suffix}
- ${led_list}= Create List
-
- FOR ${element} IN @{list}
- ${element}= Remove String ${element} ${LED_GROUPS_URI}
- Append To List ${led_list} ${element}
- END
- Sort List ${led_list}
-
- [Return] ${led_list}
diff --git a/tests/test_power_supply.robot b/tests/test_power_supply.robot
deleted file mode 100644
index f2c0e94..0000000
--- a/tests/test_power_supply.robot
+++ /dev/null
@@ -1,184 +0,0 @@
-*** Settings ***
-Documentation Test power supply telemetry.
-
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/open_power_utils.robot
-Resource ../lib/boot_utils.robot
-Resource ../lib/logging_utils.robot
-
-Test Teardown FFDC On Test Case Fail
-
-*** Variables ***
-
-# -----------------------------------
-# Output Current and Wattage Limits
-# -----------------------------------
-# * 200 VAC (200 - 208 VAC) ... 2104W
-# * 230 VAC (207 - 253 VAC) ... 2226W
-# * 277 VAC (249 - 305 VAC) ... 2226W
-# -----------------------------------
-
-# With a loaded HTX work-load the wattage is typically within half of the upper
-# limit. If the power drawn goes beyond the upper power limit, this test will
-# fail.
-${upper_power_limit} ${2104}
-${lower_power_limit} ${100}
-${power_data_collection_interval} ${30}
-
-# Every n seconds, the system collects the following for each power supply
-# (e.g. ps0, ps1, etc):
-# - The average power being drawn over the interval.
-# - The maximum power drawn over the interval.
-# At any given time, such readings can be obtained from the system.
-# The lists shown below are examples of such data
-# ---------------------------------------------------------------------
-# /org/open_power/sensors/aggregation/per_30s/ps0_input_power/average
-# [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 225, 290, 255, 207, 124, 20]
-# (max, min) (290, 20)
-
-# /org/open_power/sensors/aggregation/per_30s/ps1_input_power/average
-# [19, 19, 20, 20, 19, 20, 20, 20, 20, 20, 69, 321, 286, 265, 228, 104]
-# (max, min) (321, 19)
-
-# /org/open_power/sensors/aggregation/per_30s/ps0_input_power/maximum
-# [20, 20, 20, 22, 22, 22, 22, 20, 22, 22, 338, 346, 308, 258, 172, 20]
-# (max, min) (346, 20)
-
-# /org/open_power/sensors/aggregation/per_30s/ps1_input_power/maximum
-# [24, 26, 26, 26, 26, 26, 26, 26, 26, 26, 322, 364, 338, 308, 258, 240]
-# (max, min) (364, 24)
-# ---------------------------------------------------------------------
-
-# To collect 3 iteration of sampling data.
-${LOOP_COUNT} ${3}
-
-
-*** Test Cases ***
-
-Power Supply Test When Host Off
- [Documentation] Check that power consumption is within limits when host
- ... is off.
- [Tags] Power_Supply_Test_When_Host_Off
-
- REST Power Off stack_mode=skip
- ${power_sensor_path}= Get Sensors Aggregation URL List
- ... /org/open_power/sensors/
-
- Check Power Telemetry When Host Off ${power_sensor_path}
-
-
-Power Supply Test When Host On
- [Documentation] Check that power consumption is within limits when host
- ... is on.
- [Tags] Power_Supply_Test_When_Host_On
-
- REST Power On
- ${power_sensor_path}= Get Sensors Aggregation URL List
- ... /org/open_power/sensors/
-
- Repeat Keyword ${LOOP_COUNT} times
- ... Check Power Telemetry When Host On ${power_sensor_path}
-
-
-Power Supply Error Logging Test At Runtime
- [Documentation] Check that power supply error is logged when one of the
- ... power supply inputs is unplugged.
- [Tags] Power_Supply_Error_Logging_Test_At_Runtime
- [Teardown] Run Keywords FFDC On Test Case Fail AND
- ... Set Power Supply Present ${1}
-
- REST Power On stack_mode=skip
-
- Set Power Supply Present ${0}
-
- Wait Until Keyword Succeeds 30 sec 10 sec
- ... Logging Entry Should Exist
- ... xyz.openbmc_project.Inventory.Error.NotPresent
-
-*** Keywords ***
-
-Check Power Telemetry When Host On
- [Documentation] Check that power consumption is within limits when host
- ... is on.
- [Arguments] ${power_paths}
-
- # Description of argument(s):
- # power_paths A list of power paths (example list element
- # "/org/open_power/sensors/aggregation/per_30s/ps0_input_power/average").
-
- Reset 30s Aggregation Power Readings
- # sleep for 3 minutes to get 6-7 readings.
- Sleep 3m
-
- # Check for "average" aggregation.
- FOR ${power_path} IN @{power_paths[0]}
- ${averages}= Get Sensors Aggregation Data ${power_path}
- ${max} ${min}= Evaluate (max(@{averages}), min(@{averages}))
- Should Be True ${max} < ${upper_power_limit}
- ... msg=Wattage ${max} crossed ${upper_power_limit}.
- Should Be True ${min} >= ${lower_power_limit}
- ... msg=Wattage ${min} below ${lower_power_limit}.
- END
-
- # Check for "maximum" aggregation.
- FOR ${power_path} IN @{power_paths[1]}
- ${maximums}= Get Sensors Aggregation Data ${power_path}
- ${max} ${min}= Evaluate (max(@{maximums}), min(@{maximums}))
- Should Be True ${max} < ${upper_power_limit}
- ... msg=Wattage ${max} crossed ${upper_power_limit}.
- Should Be True ${min} >= ${lower_power_limit}
- ... msg=Wattage ${min} below ${lower_power_limit}.
- END
-
- # Every 30 seconds the power wattage data is updated.
- Sleep ${power_data_collection_interval}s
-
-
-Check Power Telemetry When Host Off
- [Documentation] Check that power consumption is within limits when host
- ... is off.
- [Arguments] ${power_paths}
-
- # Description of argument(s):
- # power_paths A list of power paths (example list element
- # "/org/open_power/sensors/aggregation/per_30s/ps0_input_power/average").
-
- # Every 30 seconds the power wattage data is updated.
- Sleep ${power_data_collection_interval}s
-
- # Check for "average" aggregation.
- FOR ${power_path} IN @{power_paths[0]}
- ${averages}= Get Sensors Aggregation Data ${power_path}
- Should Be True ${averages[0]} < ${lower_power_limit}
- ... msg=Wattage ${averages[0]} more than ${lower_power_limit}.
- END
-
- # Check for "maximum" aggregation.
- FOR ${power_path} IN @{power_paths[1]}
- ${maximums}= Get Sensors Aggregation Data ${power_path}
- Should Be True ${maximums[0]} < ${lower_power_limit}
- ... msg=Wattage ${maximums[0]} more than ${lower_power_limit}.
- END
-
-
-Reset 30s Aggregation Power Readings
- [Documentation] Reset 30s Aggregation Power Readings to ensure readings
- ... are collected after Power Supplies are done powering up.
-
- BMC Execute Command /bin/systemctl restart power-supply-monitor@0.service
- BMC Execute Command /bin/systemctl restart power-supply-monitor@1.service
- # wait for services to restart.
- Sleep 10s
-
-
-Set Power Supply Present
- [Documentation] Clear error log and set power present field.
- [Arguments] ${power_present_setting}
-
- # Description of argument(s):
- # power_present_setting Enable or disable power present field (e.g."0/1").
-
- ${data}= Create Dictionary data=${power_present_setting}
- Write Attribute
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/powersupply0
- ... Present data=${data}
diff --git a/tests/test_remote_logging.robot b/tests/test_remote_logging.robot
deleted file mode 100644
index b6be429..0000000
--- a/tests/test_remote_logging.robot
+++ /dev/null
@@ -1,398 +0,0 @@
-*** Settings ***
-Documentation Remote logging test for rsyslog.
-
-# Program arguments:
-# REMOTE_LOG_SERVER_HOST The host name or IP address of the remote
-# logging server.
-# REMOTE_LOG_SERVER_PORT The port number for the remote logging server.
-# REMOTE_USERNAME The username for the remote logging server.
-# REMOTE_PASSWORD The password for the remote logging server.
-
-Library String
-Resource ../../lib/openbmc_ffdc.robot
-Resource ../../lib/boot_utils.robot
-Resource ../../lib/remote_logging_utils.robot
-Resource ../../lib/bmc_redfish_resource.robot
-Resource ../../lib/ipmi_client.robot
-Resource ../../lib/bmc_redfish_resource.robot
-Resource ../../lib/ipmi_client.robot
-Library ../../lib/ipmi_utils.py
-Library ../../lib/gen_misc.py
-
-Suite Setup Suite Setup Execution
-Test Setup Test Setup Execution
-Test Teardown FFDC On Test Case Fail
-
-*** Variables ***
-
-# Strings to check from journald.
-${BMC_STOP_MSG} Stopping Network IPMI daemon
-${BMC_START_MSG} Starting Flush Journal to Persistent Storage
-${BMC_BOOT_MSG} Startup finished in
-${BMC_SYSLOG_REGEX} dropbear|vrm-control.sh
-${RSYSLOG_REGEX} start|exiting on signal 15|there are no active actions configured
-${RSYSLOG_RETRY_REGEX} suspended
-${valid_password} 0penBmc1
-${max_password_length} 20
-
-*** Test Cases ***
-
-Test BMC Hostname Service And Verify
- [Documentation] Write to hostname interface and verify via REST and
- ... 'hostname' command.
- [Tags] Test_BMC_Hostname_Service_And_Verify
-
- ${openbmc_host_name} ${openbmc_ip} ${openbmc_short_name}=
- ... Get Host Name IP host=${OPENBMC_HOST} short_name=1
-
- ${host_name_dict}= Create Dictionary data=${openbmc_short_name}
- Write Attribute ${NETWORK_MANAGER}config HostName data=${host_name_dict}
- ... verify=${TRUE} expected_value=${openbmc_short_name}
-
- ${hostname} ${stderr} ${rc}= BMC Execute Command hostname
-
- Should Be Equal As Strings ${hostname} ${openbmc_short_name}
- ... msg=The hostname interface ${openbmc_short_name} and command value ${hostname} do not match.
-
- # Override the suite hostname variable if this test is executed.
- Set Suite Variable ${bmc_hostname} ${openbmc_short_name}
-
-
-Verify REST Logging On BMC Journal When Disabled
- [Documentation] Enable REST logging and verify from journald.
- [Tags] Verify_REST_Logging_On_BMC_Journal_When_Disabled
-
- ${log_dict}= Create Dictionary data=${False}
- Write Attribute ${BMC_LOGGING_URI}${/}rest_api_logs Enabled data=${log_dict}
- ... verify=${True} expected_value=${False}
-
- # If it was enabled prior, this REST footprint will show up.
- # Takes around 5 seconds for the REST to restart service when policy is changed.
- Sleep 10s
-
- ${login_footprint}= Catenate login json: None 200 OK
- # Example: Just get the message part of the syslog
- # user:root POST http://xx.xx.xx.xx/login json: None 200 OK
- ${cmd}= Catenate SEPARATOR= --no-pager | egrep '${login_footprint}'
-
- Start Journal Log filter=${cmd}
- Initialize OpenBMC
- Sleep 5s
- ${bmc_journald}= Stop Journal Log
-
- Should Be Empty ${bmc_journald}
- ... msg=${bmc_journald} contains unexpected REST entries.
-
-
-Verify REST Logging On BMC Journal When Enabled
- [Documentation] Enable REST logging and verify from journald.
- [Tags] Verify_REST_Logging_On_BMC_Journal_When_Enabled
-
- ${log_dict}= Create Dictionary data=${True}
- Write Attribute ${BMC_LOGGING_URI}${/}rest_api_logs Enabled data=${log_dict}
- ... verify=${True} expected_value=${True}
-
- Sleep 5s
-
- Start Journal Log
- Initialize OpenBMC
- Log Out OpenBMC
- ${bmc_journald}= Stop Journal Log
-
- Should Contain ${bmc_journald} login json: None 200 OK
- ... msg=${bmc_journald} doesn't contains REST entries.
-
-
-Test Remote API Valid Config Combination
- [Documentation] Verify valid combination of address and port.
- [Tags] Test_Remote_API_Valid_Config_Combination
- [Template] Verify Configure Remote Logging Server
- # Forego normal test setup:
- [Setup] No Operation
-
- # Address Port Expected result
- ${EMPTY} ${REMOTE_LOG_SERVER_PORT} ${True}
- ${REMOTE_LOG_SERVER_HOST} ${REMOTE_LOG_SERVER_PORT} ${True}
- ${REMOTE_LOG_SERVER_HOST} ${0} ${True}
-
-
-Test Remote API Invalid Config Combination
- [Documentation] Verify invalid combination of address and port.
- [Tags] Test_Remote_API_Invalid_Config_Combination
- [Template] Verify Configure Remote Logging Server
- # Forego normal test setup:
- [Setup] No Operation
-
- # Address Port Expected result
- ${0} ${REMOTE_LOG_SERVER_PORT} ${False}
- "0" ${REMOTE_LOG_SERVER_PORT} ${False}
- ${REMOTE_LOG_SERVER_HOST} ${EMPTY} ${False}
- ${REMOTE_LOG_SERVER_HOST} "0" ${False}
-
-
-Test Remote Logging REST Interface And Verify Config
- [Documentation] Test remote logging interface and configuration.
- [Tags] Test_Remote_Logging_REST_Interface_And_Verify_Config
-
- Verify Rsyslog Config On BMC
-
-
-Test Remote Logging Invalid Port Config And Verify BMC Journald
- [Documentation] Test remote logging interface and configuration.
- [Tags] Test_Remote_Logging_Invalid_Port_Config_And_Verify_BMC_Journald
-
- # Invalid port derived by (REMOTE_LOG_SERVER_PORT + 1) port config setting.
- ${INVALID_PORT}= Evaluate ${REMOTE_LOG_SERVER_PORT} + ${1}
- Configure Remote Log Server With Parameters
- ... remote_host=${REMOTE_LOG_SERVER_HOST} remote_port=${INVALID_PORT}
-
- Sleep 3s
- # rsyslogd[1870]: action 'action 0' suspended,
- # next retry is Fri Sep 14 05:47:39 2018 [v8.29.0 try http://www.rsyslog.com/e/2007 ]
- ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
- ... journalctl -b --no-pager | egrep 'rsyslog.*${RSYSLOG_RETRY_REGEX}'
-
- Should Contain ${bmc_journald} ${RSYSLOG_RETRY_REGEX}
- ... msg=${bmc_journald} doesn't contain rsyslog retry entries.
-
-
-Verify BMC Journald Synced To Remote Logging Server
- [Documentation] Check that BMC journald is sync to remote rsyslog.
- [Tags] Verify_BMC_Journald_Synced_To_Remote_Logging_Server
-
- # Restart BMC dump service and get the last entry of the journald.
- # Example:
- # systemd[1]: Started Phosphor Dump Manager.
- BMC Execute Command
- ... systemctl restart xyz.openbmc_project.Dump.Manager.service
-
- ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
- ... journalctl --no-pager | grep 'Started Phosphor Dump Manager'
-
- # systemd[1]: Started Phosphor Dump Manager.
- ${cmd}= Catenate SEPARATOR= egrep '${bmc_hostname}.*Started Phosphor Dump Manager' /var/log/syslog
- ${remote_journald}= Remote Logging Server Execute Command command=${cmd}
-
- # TODO: rsyslog configuration and time date template to match BMC journald.
- # Compare the BMC journlad log. Example:
- # systemd[1]: Started Phosphor Dump Manager.
- Should Contain ${remote_journald} ${bmc_journald.split('${bmc_hostname}')[1][0]}
- ... msg= ${bmc_journald} doesn't match remote rsyslog:${remote_journald}.
-
-
-Verify Journald Post BMC Reset
- [Documentation] Check that BMC journald is sync'ed to remote rsyslog after
- ... BMC reset.
- [Tags] Verify_Journald_Post_BMC_Reset
-
- ${hostname} ${stderr} ${rc}= BMC Execute Command hostname
- OBMC Reboot (off)
-
- ${cmd}= Catenate grep ${hostname} /var/log/syslog |
- ... egrep '${BMC_STOP_MSG}|${BMC_START_MSG}|${BMC_BOOT_MSG}'
- ${remote_journald}= Remote Logging Server Execute Command command=${cmd}
-
- # 1. Last reboot message to verify.
- Should Contain ${remote_journald} ${BMC_STOP_MSG}
- ... msg=The remote journald doesn't contain the IPMI shutdown message: ${BMC_STOP_MSG}.
-
- # 2. Earliest booting message on journald.
- Should Contain ${remote_journald} ${BMC_START_MSG}
- ... msg=The remote journald doesn't contain the start message: ${BMC_START_MSG}.
-
- # 3. Unique boot to standby message.
- # Startup finished in 9.961s (kernel) + 1min 59.039s (userspace) = 2min 9.000s
- ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
- ... journalctl -b --no-pager | egrep '${BMC_BOOT_MSG}'
-
- Should Contain ${remote_journald}
- ... ${bmc_journald.split('${hostname}')[1]}
- ... msg=The remote journald doesn't contain the boot message: ${BMC_BOOT_MSG}.
-
-
-Verify BMC Journald Contains No Credential Data
- [Documentation] Check that BMC journald doesn't log any credential data.
- [Tags] Verify_BMC_Journald_Contains_No_Credential_Data
-
- Initialize OpenBMC
-
- Create Redfish And IPMI Users
-
- # Time for user manager to sync.
- Sleep 5 s
-
- Open Connection And Log In
- ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
- ... journalctl -o json-pretty | cat
-
- Should Not Contain Any ${bmc_journald} ${OPENBMC_PASSWORD} ${valid_password}
- ... ignore_case=False msg=Journald logs BMC credentials/password ${OPENBMC_PASSWORD}.
-
-
-Audit BMC SSH Login And Remote Logging
- [Documentation] Check that the SSH login to BMC is logged and synced to
- ... remote logging server.
- [Tags] Audit_BMC_SSH_Login_And_Remote_Logging
-
- ${login_footprint}= Catenate Started SSH Per-Connection Server
- # Example: Just get the message part of the syslog
- # Started SSH Per-Connection Server (xx.xx.xx.xx:51292)
- ${cmd}= Catenate SEPARATOR= --no-pager | egrep '${login_footprint}'
- ... | awk -F': ' '{print $2}'
-
- Start Journal Log filter=${cmd}
- Open Connection And Log In
- Sleep 5s
- ${bmc_journald}= Stop Journal Log
- @{ssh_entry}= Split To Lines ${bmc_journald}
-
- ${cmd}= Catenate SEPARATOR= egrep -E '*${bmc_hostname}.*${login_footprint}' /var/log/syslog
-
- ${remote_journald}= Remote Logging Server Execute Command command=${cmd}
-
- Should Contain ${remote_journald} ${ssh_entry[0]}
- ... msg=${remote_journald} don't contain ${bmc_journald} entry.
-
-
-Verify Rsyslog Does Not Log On BMC
- [Documentation] Check that rsyslog journald doesn't log on BMC.
- [Tags] Verify_Rsyslog_Does_Not_Log_On_BMC
-
- # Expected filter rsyslog entries.
- # Example:
- # syslogd[3356]:
- # [origin software="rsyslogd" swVersion="8.29.0" x-pid="3356" x-info="http://www.rsyslog.com"]
- # exiting on signal 15.
- # rsyslogd[3364]:
- # [origin software="rsyslogd" swVersion="8.29.0" x-pid="3364" x-info="http://www.rsyslog.com"] start
- ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
- ... journalctl -b --no-pager | egrep 'rsyslog' | egrep -Ev '${RSYSLOG_REGEX}|${RSYSLOG_RETRY_REGEX}'
- ... ignore_err=${1}
-
- Should Be Empty ${bmc_journald}
- ... msg=${bmc_journald} contains unexpected rsyslog entries.
-
-
-Boot Host And Verify Data Is Synced To Remote Server
- [Documentation] Boot host and verify the power on sequence logs are synced
- ... to remote logging server.
- [Tags] Boot_Host_And_Verify_Data_Is_Synced_To_Remote_Server
-
- # Filter kernel dmesg from the journald log.
- # Example: xx.xx.xx kernel:
-
- ${openbmc_host_name} ${openbmc_ip} ${openbmc_short_name}=
- ... Get Host Name IP host=${OPENBMC_HOST} short_name=1
-
- ${cmd}= Catenate SEPARATOR= --no-pager | egrep -Ev '${BMC_SYSLOG_REGEX}
- ... |${openbmc_short_name} kernel' | awk -F': ' '{print $2}'
-
- # Example: Just get the message part of the syslog
- # Started OpenPOWER OCC Active Disable.
- Start Journal Log filter=${cmd}
-
- # Irrespective of the outcome, the journald should be synced.
- Run Keyword And Ignore Error Redfish Power On
- ${bmc_journald}= Stop Journal Log
-
- ${cmd}= Catenate SEPARATOR= egrep -a '${bmc_hostname}' /var/log/syslog
- ${remote_journald}= Remote Logging Server Execute Command command=${cmd}
-
- @{lines}= Split To Lines ${bmc_journald}
-
- FOR ${line} IN @{lines}
- Log To Console \n ${line}
- Should Contain ${remote_journald} ${line}
- ... mgs=${line} line doesn't contain in ${remote_journald}.
- END
-
-
-*** Keywords ***
-
-Suite Setup Execution
- [Documentation] Do the suite setup.
-
- Should Not Be Empty ${REMOTE_LOG_SERVER_HOST}
- Should Not Be Empty ${REMOTE_LOG_SERVER_PORT}
- Should Not Be Empty ${REMOTE_USERNAME}
- Should Not Be Empty ${REMOTE_PASSWORD}
- Ping Host ${REMOTE_LOG_SERVER_HOST}
- Remote Logging Server Execute Command true
- Remote Logging Interface Should Exist
-
- ${hostname} ${stderr} ${rc}= BMC Execute Command /bin/hostname
- Set Suite Variable ${bmc_hostname} ${hostname}
- Configure Remote Log Server With Parameters
-
-
-Test Setup Execution
- [Documentation] Do the test setup.
-
- # Retain only the past 1 second log:
- BMC Execute Command journalctl --vacuum-time=1s
-
- ${config_status}= Run Keyword And Return Status
- ... Get Remote Log Server Configured
-
- Run Keyword If ${config_status}==${FALSE}
- ... Configure Remote Log Server With Parameters
-
-
-Remote Logging Interface Should Exist
- [Documentation] Check that the remote logging URI exist.
-
- ${resp}= OpenBMC Get Request ${REMOTE_LOGGING_URI}
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
-
-
-Verify Configure Remote Logging Server
- [Documentation] Configure the remote logging REST interface on BMC.
- [Arguments] ${remote_host} ${remote_port} ${expectation}
-
- # Description of argument(s):
- # remote_host The host name or IP address of the remote logging server
- # (e.g. "xx.xx.xx.xx").
- # remote_port Remote ryslog server port number (e.g. "514").
- # expectation Expect boolean True/False.
-
-
- ${status}= Run Keyword And Return Status
- ... Configure Remote Log Server With Parameters remote_host=${remote_host} remote_port=${remote_port}
-
- Should Be Equal ${status} ${expectation}
- ... msg=Test result ${status} and expectation ${expectation} do not match.
-
-
-Create Redfish And IPMI Users
- [Documentation] Create a valid Redfish and IPMI local user accounts and
- ... delete them.
-
- # Create redfish local valid user.
- ${redfish_username}= Generate Random String 8 [LETTERS]
-
- Redfish.Login
-
- ${payload}= Create Dictionary
- ... UserName=${redfish_username} Password=${valid_password}
- ... RoleId=Administrator Enabled=${True}
- Redfish.Post /redfish/v1/AccountService/Accounts body=&{payload}
- ... valid_status_codes=[${HTTP_CREATED}]
-
- # Delete newly created user.
- Redfish.Delete /redfish/v1/AccountService/Accounts/${redfish_username}
-
- Redfish.Logout
-
- # Create IPMI local valid user.
- ${random_username}= Generate Random String 8 [LETTERS]
- Set Test Variable ${random_username}
- ${random_userid}= Evaluate random.randint(2, 15) modules=random
- IPMI Create User ${random_userid} ${random_username}
-
- Run IPMI Standard Command user set password ${random_userid} ${valid_password}
-
- ${msg}= Run IPMI Standard Command user test ${random_userid} ${max_password_length} ${valid_password}
- Should Contain ${msg} Success
-
- # Delete IPMI user.
- Run IPMI Standard Command user set name ${random_userid} ""
diff --git a/tests/test_rest_interfaces.robot b/tests/test_rest_interfaces.robot
deleted file mode 100644
index 6fa10b9..0000000
--- a/tests/test_rest_interfaces.robot
+++ /dev/null
@@ -1,485 +0,0 @@
-*** Settings ***
-Documentation Verify REST services Get/Put/Post/Delete.
-
-Resource ../lib/rest_client.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/resource.robot
-Resource ../lib/utils.robot
-Library Collections
-
-Test Teardown FFDC On Test Case Fail
-
-*** Variables ***
-
-*** Test Cases ***
-
-REST Login Session To BMC
- [Documentation] Test REST session log-in.
- [Tags] REST_Login_Session_To_BMC
-
- Initialize OpenBMC
- # Raw GET REST operation to verify session is established.
- ${resp}= Get Request openbmc /xyz/openbmc_project/
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
-
-
-REST Logout Session To BMC
- [Documentation] Test REST session log-out.
- [Tags] REST_Logout_Session_To_BMC
-
- Initialize OpenBMC
- Log Out OpenBMC
- # Raw GET REST operation to verify session is logout.
- ${resp}= Get Request openbmc /xyz/openbmc_project/
- Should Be Equal As Strings ${resp.status_code} ${HTTP_UNAUTHORIZED}
-
-
-REST Delete All Sessions And Expect Error
- [Documentation] Test REST empty cache using delete operation.
- [Tags] REST_Delete_All_Sessions_And_Expect_Error
-
- # Throws exception:
- # Non-existing index or alias 'openbmc'.
-
- Initialize OpenBMC
- Delete All Sessions
- # Raw GET REST operation and expect exception error.
- Run Keyword And Expect Error
- ... Non-existing index or alias 'openbmc'.
- ... Get Request openbmc /xyz/openbmc_project/
-
-
-Multiple Requests On BMC Using Single REST Session
- [Documentation] Trigger multiple REST operations using an active
- ... connection session.
- [Tags] Multiple_Requests_On_BMC_Using_Single_REST_Session
-
- Initialize OpenBMC
-
- # Session object "openbmc".
- ${resp}= Get Request openbmc /xyz/openbmc_project/state/
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
-
- ${resp}= Get Request openbmc /xyz/openbmc_project/software/enumerate
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
-
-
-Verify REST JSON Data On Success
- [Documentation] Verify JSON data success response messages.
- [Tags] Verify_REST_JSON_Data_On_Success
- # Example:
- # Response code:200, Content:{
- # "data": [
- # "/xyz/openbmc_project/sensors",
- # "/xyz/openbmc_project/inventory",
- # "/xyz/openbmc_project/software",
- # "/xyz/openbmc_project/object_mapper",
- # "/xyz/openbmc_project/logging"
- # ],
- # "message": "200 OK",
- # "status": "ok"
- # }
-
- ${resp}= OpenBMC Get Request /xyz/openbmc_project/
- ${jsondata}= To JSON ${resp.content}
- Should Not Be Empty ${jsondata["data"]}
- Should Be Equal As Strings ${jsondata["message"]} 200 OK
- Should Be Equal As Strings ${jsondata["status"]} ok
-
-
-Verify REST JSON Data On Failure
- [Documentation] Verify JSON data failure response messages.
- [Tags] Verify_REST_JSON_Data_On_Failure
- # Example:
- # Response code:404, Content:{
- # "data": {
- # "description": "org.freedesktop.DBus.Error.FileNotFound: path or object not found:
- # /xyz/idont/exist"
- # },
- # "message": "404 Not Found",
- # "status": "error"
- # }
-
- ${resp}= OpenBMC Get Request /xyz/idont/exist/
- ${jsondata}= To JSON ${resp.content}
- Should Contain ${jsondata["data"]["description"]}
- ... org.freedesktop.DBus.Error.FileNotFound: path or object not found
- Should Be Equal As Strings ${jsondata["message"]} 404 Not Found
- Should Be Equal As Strings ${jsondata["status"]} error
-
-
-Verify REST Get Message JSON Compliant
- [Documentation] Verify REST "GET" message is JSON format compliant.
- [Tags] Verify_REST_Get_Message_JSON_Compliant
- # For testing if the REST message is JSON format compliant using a
- # generic BMC state path /xyz/openbmc_project/state object and path
- # walking through to ensure the parent object, trailing slash and
- # attribute message response are intact.
-
- # Object attribute data.
- # Example:
- # Response code:200, Content:{
- # "data": {
- # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready",
- # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None"
- # },
- # "message": "200 OK",
- # "status": "ok"
- # }
-
- Verify JSON Response Content
- ... /xyz/openbmc_project/state/bmc0 DATA_NOT_EMPTY
-
- # Object trailing slash attribute data.
- # Example:
- # Response code:200, Content:{
- # "data": [],
- # "message": "200 OK",
- # "status": "ok"
- # }
-
- Verify JSON Response Content /xyz/openbmc_project/state/bmc0/
-
- # Attribute data.
- # Example:
- # Response code:200, Content:{
- # "data": "xyz.openbmc_project.State.BMC.BMCState.Ready",
- # "message": "200 OK",
- # "status": "ok"
- # }
-
- Verify JSON Response Content
- ... /xyz/openbmc_project/state/bmc0/attr/CurrentBMCState DATA_NOT_EMPTY
-
-
-Verify REST Post Message JSON Compliant
- [Documentation] Verify REST "POST" message is JSON format compliant.
- [Tags] Verify_REST_Post_Message_JSON_Compliant
- # Example:
- # Response code:200, Content:{
- # "data": null,
- # "message": "200 OK",
- # "status": "ok"
- # }
-
- # Clear existing gard records, if any.
- ${data}= Create Dictionary data=@{EMPTY}
- ${resp}= Openbmc Post Request ${OPENPOWER_CONTROL}gard/action/Reset
- ... data=${data}
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
- ${jsondata}= To JSON ${resp.content}
- Should Be Equal ${jsondata["data"]} ${None}
- Should Be Equal As Strings ${jsondata["message"]} 200 OK
- Should Be Equal As Strings ${jsondata["status"]} ok
-
-
-Verify REST Bad Request Post Message JSON Compliant
- [Documentation] Verify REST "POST" message is JSON format compliant.
- [Tags] Verify_REST_Bad_Request_Post_Message_JSON_Compliant
- # Example:
- # {
- # "data": {
- # "description": "Version already exists or failed to be extracted"
- # },
- # "message": "400 Bad Request",
- # "status": "error"
- # }
-
- # Generate 1KB file size
- Run dd if=/dev/zero of=dummyfile bs=1 count=0 seek=1KB
- OperatingSystem.File Should Exist dummyfile
-
- # Get the content of the file and upload to BMC
- ${image_data}= OperatingSystem.Get Binary File dummyfile
-
- # Get REST session to BMC
- Initialize OpenBMC
-
- # Create the REST payload headers and data
- ${data}= Create Dictionary data ${image_data}
- ${headers}= Create Dictionary Content-Type=application/octet-stream
- ... X-Auth-Token=${XAUTH_TOKEN} Accept=application/octet-stream
- Set To Dictionary ${data} headers ${headers}
-
- ${resp}= Post Request openbmc /upload/image &{data}
- Should Be Equal As Strings ${resp.status_code} ${HTTP_BAD_REQUEST}
- ${jsondata}= To JSON ${resp.content}
- Should Be Equal ${jsondata["data"]["description"]}
- ... Version already exists or failed to be extracted
- Should Be Equal As Strings ${jsondata["message"]} 400 Bad Request
- Should Be Equal As Strings ${jsondata["status"]} error
- Delete All Error Logs
-
-
-Check Response Codes HTTP_UNSUPPORTED_MEDIA_TYPE
- [Documentation] REST "Post" response status test for
- ... HTTP_UNSUPPORTED_MEDIA_TYPE.
- [Tags] Check_Response_Codes_HTTP_UNSUPPORTED_MEDIA_TYPE
-
- # Example:
- # Response code:415, Content:{
- # "data": {
- # "description": "Expecting content type 'application/octet-stream', got 'application/json'"
- # },
- # "message": "415 Unsupported Media Type",
- # "status": "error"
- # }
-
- Initialize OpenBMC
-
- # Create the REST payload headers and EMPTY data
- ${data}= Create Dictionary data ${EMPTY}
- ${headers}= Create Dictionary Content-Type=application/json X-Auth-Token=${XAUTH_TOKEN}
- Set To Dictionary ${data} headers ${headers}
-
- ${resp}= Post Request openbmc /upload/image &{data}
- Should Be Equal As Strings
- ... ${resp.status_code} ${HTTP_UNSUPPORTED_MEDIA_TYPE}
-
- ${jsondata}= To JSON ${resp.content}
- Should Be Equal As Strings ${jsondata["data"]["description"]}
- ... Expecting content type 'application/octet-stream', got 'application/json'
- Should Be Equal As Strings
- ... ${jsondata["message"]} 415 Unsupported Media Type
- Should Be Equal As Strings ${jsondata["status"]} error
-
-
-Get Response Codes
- [Documentation] REST "Get" response status test.
- [Tags] Get_Response_Codes
- [Template] Execute Get And Check Response
-
- # Expect status URL Path
- ${HTTP_OK} /xyz/openbmc_project/
- ${HTTP_OK} /xyz/openbmc_project/state/enumerate
- ${HTTP_NOT_FOUND} /xyz/i/dont/exist/
-
-
-Get Data
- [Documentation] REST "Get" request url and expect the
- ... response OK and data non empty.
- [Tags] Get_Data
- [Template] Execute Get And Check Data
-
- # URL Path
- /xyz/openbmc_project/
- /xyz/openbmc_project/list
- /xyz/openbmc_project/state/enumerate
-
-
-Get Data Validation
- [Documentation] REST "Get" request url and expect the
- ... pre-defined string in response data.
- [Tags] Get_Data_Validation
- [Template] Execute Get And Verify Data
-
- # URL Path Expect Data
- /xyz/openbmc_project/ /xyz/openbmc_project/logging
- /org/i/dont/exist/ path or object not found
-
-
-Put Response Codes
- [Documentation] REST "Put" request url and expect the REST pre-defined
- ... codes.
- [Tags] Put_Response_Codes
- [Template] Execute Put And Check Response
-
- # Expect status URL Path
- ${HTTP_METHOD_NOT_ALLOWED} /
- ${HTTP_NOT_FOUND} /xyz/
- ${HTTP_FORBIDDEN} /xyz/i/dont/exist/
-
-
-Put Data Validation
- [Documentation] REST "Put" request url and expect success.
- [Tags] Put_Data_Validation
- [Template] Execute Put And Expect Success
-
- # URL Path Parm Data
- /xyz/openbmc_project/state/host0/attr/RequestedHostTransition
- ... xyz.openbmc_project.State.Host.Transition.Off
-
-
-Post Response Code
- [Documentation] REST Post request url and expect the
- ... REST response code pre define.
- [Tags] Post_Response_Code
- [Template] Execute Post And Check Response
-
- # Expect status URL Path
- ${HTTP_METHOD_NOT_ALLOWED} /
- ${HTTP_NOT_FOUND} /xyz/
- ${HTTP_METHOD_NOT_ALLOWED} /xyz/i/dont/exist/
- ${HTTP_METHOD_NOT_ALLOWED} /xyz/login
-
-
-Delete Response Code
- [Documentation] REST "Delete" request url and expect the
- ... REST response code pre define.
- [Tags] Delete_Response_Code
- [Template] Execute Delete And Check Response
-
- # Expect status URL Path
- ${HTTP_METHOD_NOT_ALLOWED} /
- ${HTTP_NOT_FOUND} /xyz/
- ${HTTP_METHOD_NOT_ALLOWED} /xyz/nothere/
- ${HTTP_METHOD_NOT_ALLOWED} /xyz/openbmc_project/state/
-
-
-Verify All REST Objects Are Accessible
- [Documentation] Verify all the REST objects are accessible using "GET".
- [Tags] Verify_All_REST_Objects_Are_Accessible
-
- ${uri_list}= Get Sub URI List ${OPENBMC_BASE_URI}
-
- # URI's which won't support GET request.
- Remove Values From List ${uri_list}
- ... /xyz/openbmc_project/certs/client/ldap
- ... /xyz/openbmc_project/certs/server/https
- ... /xyz/openbmc_project/certs/authority/truststore
- ... /xyz/openbmc_project/ipmi
- ... /xyz/openbmc_project/ipmi/internal
- ... /xyz/openbmc_project/ipmi/internal/soft_power_off
-
- ${error_uri_list}= Create List
- FOR ${uri} IN @{uri_list}
- ${resp}= Openbmc Get Request ${uri} quiet=${1}
- Run keyword if '${resp.status_code}' != '${HTTP_OK}'
- ... Append To List ${error_uri_list} ${uri} : ${resp.status_code}
- END
- Should Be Empty ${error_uri_list}
-
-
-Verify REST Put Message JSON Compliant
- [Documentation] Verify REST "PUT" message is JSON format compliant.
- [Tags] Verify_REST_Put_Message_JSON_Compliant
- # Example:
- # Response code:200, Content:{
- # "data": null,
- # "message": "200 OK",
- # "status": "ok"
- # }
-
- ${dict_data}= Create Dictionary data=${HOST_POWEROFF_TRANS}
- ${resp}= Openbmc Put Request
- ... ${HOST_STATE_URI}attr/RequestedHostTransition data=${dict_data}
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
- ${jsondata}= To JSON ${resp.content}
- Should Be Equal ${jsondata["data"]} ${None}
- Should Be Equal As Strings ${jsondata["message"]} 200 OK
- Should Be Equal As Strings ${jsondata["status"]} ok
- # Intention is not to test poweroff but to check the REST operation
- # sink time allowing to kick poweroff.
- Sleep 10s
-
-*** Keywords ***
-
-Get Sub URI List
- [Documentation] Return list of sub URIs inside the URI sent by caller.
- [Arguments] ${uri}
- # Description of argument(s):
- # uri The URI for which all the sub URIs are returned.
- # Example:
- # "/xyz/openbmc_project/"
- ${resp}= Openbmc Get Request ${uri}list quiet=${1}
- ${sub_uris}= Collections.Get From Dictionary ${resp.json()} data
- [Return] ${sub_uris}
-
-Execute Get And Check Response
- [Documentation] Request "Get" url path and expect REST response code.
- [Arguments] ${expected_response_code} ${url_path}
- # Description of arguments:
- # expected_response_code Expected REST status codes.
- # url_path URL path.
- ${resp}= Openbmc Get Request ${url_path}
- Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
-
-Execute Get And Check Data
- [Documentation] Request "Get" url path and expect non empty data.
- [Arguments] ${url_path}
- # Description of arguments:
- # url_path URL path.
- ${resp}= Openbmc Get Request ${url_path}
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
- ${jsondata}= To JSON ${resp.content}
- Should Not Be Empty ${jsondata["data"]}
-
-Execute Get And Verify Data
- [Documentation] Request "Get" url path and verify data.
- [Arguments] ${url_path} ${expected_response_code}
- # Description of arguments:
- # expected_response_code Expected REST status codes.
- # url_path URL path.
- ${resp}= Openbmc Get Request ${url_path}
- ${jsondata}= To JSON ${resp.content}
- Run Keyword If '${resp.status_code}' == '${HTTP_OK}'
- ... Should Contain ${jsondata["data"]} ${expected_response_code}
- ... ELSE
- ... Should Contain ${jsondata["data"]["description"]} ${expected_response_code}
-
-Execute Put And Check Response
- [Documentation] Request "Put" url path and expect REST response code.
- [Arguments] ${expected_response_code} ${url_path}
- # Description of arguments:
- # expected_response_code Expected REST status codes.
- # url_path URL path.
- ${resp}= Openbmc Put Request ${url_path}
- Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
-
-Execute Put And Expect Success
- [Documentation] Request "Put" on url path.
- [Arguments] ${url_path} ${parm}
- # Description of arguments:
- # url_path URL path.
- # parm Value/string to be set.
- # expected_response_code Expected REST status codes.
- ${parmDict}= Create Dictionary data=${parm}
- ${resp}= Openbmc Put Request ${url_path} data=${parmDict}
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
-
-Execute Post And Check Response
- [Documentation] Request Post url path and expect REST response code.
- [Arguments] ${expected_response_code} ${url_path}
- # Description of arguments:
- # expected_response_code Expected REST status codes.
- # url_path URL path.
- ${resp}= Openbmc Post Request ${url_path}
- Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
-
-Execute Post And Check Data
- [Arguments] ${url_path} ${parm}
- [Documentation] Request Post on url path and expected non empty data.
- # Description of arguments:
- # url_path URL path.
- ${data}= Create Dictionary data=@{parm}
- ${resp}= Openbmc Post Request ${url_path} data=${data}
- Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
- ${jsondata}= To JSON ${resp.content}
- Should Not Be Empty ${jsondata["data"]}
-
-Execute Delete And Check Response
- [Documentation] Request "Delete" url path and expected REST response code.
- [Arguments] ${expected_response_code} ${url_path}
- # Description of arguments:
- # expected_response_code Expected REST status codes.
- # url_path URL path.
- ${data}= Create Dictionary data=@{EMPTY}
- ${resp}= Openbmc Delete Request ${url_path} data=${data}
- Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
-
-Verify JSON Response Content
- [Documentation] Verify JSON response data is intact.
- [Arguments] ${url_path} ${data_empty}=${EMPTY}
-
- # Description of argument(s):
- # url_path URL path.
- # data_empty JSON data element.
-
- ${resp}= OpenBMC Get Request ${url_path}
- ${jsondata}= To JSON ${resp.content}
- Run Keyword If '${data_empty}' == '${EMPTY}'
- ... Should Be Empty ${jsondata["data"]}
- ... ELSE
- ... Should Not Be Empty ${jsondata["data"]}
- Should Be Equal As Strings ${jsondata["message"]} 200 OK
- Should Be Equal As Strings ${jsondata["status"]} ok
diff --git a/tests/test_sensors.robot b/tests/test_sensors.robot
deleted file mode 100644
index 3e99250..0000000
--- a/tests/test_sensors.robot
+++ /dev/null
@@ -1,65 +0,0 @@
-*** Settings ***
-Documentation This example demonstrates executing commands on a remote machine
-... and getting their output and the return code.
-...
-... Notice how connections are handled as part of the suite setup and
-... teardown. This saves some time when executing several test cases.
-
-Resource ../lib/rest_client.robot
-Resource ../lib/ipmi_client.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/state_manager.robot
-Library ../data/model.py
-Resource ../lib/boot_utils.robot
-Resource ../lib/utils.robot
-
-Suite Setup Suite Setup Execution
-Test Teardown Test Teardown Execution
-
-*** Variables ***
-
-${stack_mode} skip
-${model}= ${OPENBMC_MODEL}
-
-*** Test Cases ***
-
-io_board Present
- [Documentation] Verify that the IO board is present.
- [Tags] io_board_Present
- ${uri}= Get System component io_board
- Verify The Attribute ${uri} Present ${True}
-
-io_board Fault
- [Documentation] Verify that the IO board signals "fault".
- [Tags] io_board_Fault
- ${uri}= Get System component io_board
- Verify The Attribute ${uri} fault ${False}
-
-*** Keywords ***
-
-Suite Setup Execution
- [Documentation] Initial suite setup.
-
- # Boot Host.
- REST Power On
-
- ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30
- Set Suite Variable ${SYSTEM_INFO} ${resp}
- log Dictionary ${resp}
-
-Get System component
- [Documentation] Get the system component.
- [Arguments] ${type}
- ${list}= Get Dictionary Keys ${SYSTEM_INFO}
- ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}\[0-9]*$
- ${url}= Get From List ${resp} 0
- [Return] ${url}
-
-
-Test Teardown Execution
- [Documentation] Do the post test teardown.
- ... 1. Capture FFDC on test failure.
- ... 2. Close all open SSH connections.
-
- FFDC On Test Case Fail
- Close All Connections
diff --git a/tests/test_soft_boot_sensors.robot b/tests/test_soft_boot_sensors.robot
deleted file mode 100644
index 1c3fee5..0000000
--- a/tests/test_soft_boot_sensors.robot
+++ /dev/null
@@ -1,288 +0,0 @@
-*** Settings ***
-Documentation Suite for testing non sensors.
-
-Library ../lib/state_map.py
-Resource ../lib/utils.robot
-Resource ../lib/boot_utils.robot
-Resource ../lib/state_manager.robot
-Resource ../lib/openbmc_ffdc.robot
-
-Test Teardown Post Test Case Execution
-
-*** Variables ***
-
-${stack_mode} skip
-
-*** Test Cases ***
-
-Verify Boot AttemptsLeft At Standby
- [Documentation] Verify system boot attempts on various boot states.
- [Tags] Verify_Boot_AttemptsLeft_At_Standby
- [Template] Validate Boot AttemptsLeft
-
- # Example: Expected state
- # "data": {
- # "/xyz/openbmc_project/state/host0": {
- # "AttemptsLeft": 3,
- # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified",
- # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Off",
- # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
- # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.Off"
- # }
- # }
-
- # System at standby AttemptsLeft
- Reboot 3
-
-
-Verify Boot AttemptsLeft At Host Booted
- [Documentation] Verify the number of Host boot attempts left.
- [Tags] Verify_Boot_AttemptsLeft_At_Host_Booted
- [Template] Validate Boot AttemptsLeft
-
- # System at standby AttemptsLeft
- Booted 3
-
-
-Verify Boot AttemptsLeft When Host Reboot
- [Documentation] Verify the number of Host reboots left.
- [Tags] Verify_Boot_AttemptsLeft_When_Host_Reboot
- [Template] Validate Boot AttemptsLeft
-
- # System at standby AttemptsLeft
- RebootHost 2
-
-
-Verify Boot AttemptsLeft When Power Off
- [Documentation] Verify the number of boots left while the system is poweref off.
- [Tags] Verify_Boot_AttemptsLeft_When_Power_Off
- [Template] Validate Boot AttemptsLeft
-
- # System at standby AttemptsLeft
- Off 3
-
-
-Verify Boot Sensor States At Ready
- [Documentation] Verify system boot states at "Ready" state.
- [Tags] Verify_Boot_Sensor_States_At_Ready
- [Template] Valid Boot States
-
- # Example: Expected state
- # "data": {
- # "/xyz/openbmc_project/state/bmc0": {
- # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready",
- # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None"
- # },
- # "/xyz/openbmc_project/state/chassis0": {
- # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.Off",
- # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off"
- # },
- # "/xyz/openbmc_project/state/host0": {
- # "AttemptsLeft": 3,
- # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified",
- # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Off",
- # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
- # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.Off"
- # }
- # }
-
- # System at standby.
- Off
-
-
-Verify Boot Sensor States On Reboot Ready
- [Documentation] Verify system boot states at "Ready" state.
- [Tags] Verify_Boot_Sensor_States_On_Reboot_Ready
- [Template] Valid Boot States
-
- # Example: Expected state
- # "data": {
- # "/xyz/openbmc_project/state/bmc0": {
- # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready",
- # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None"
- # },
- # "/xyz/openbmc_project/state/chassis0": {
- # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.Off",
- # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off"
- # },
- # "/xyz/openbmc_project/state/host0": {
- # "AttemptsLeft": 3,
- # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified",
- # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Off",
- # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
- # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.Off"
- # }
- # }
-
- # BMC on reset to standby.
- Reboot
-
-
-Verify Boot Sensor States At Running
- [Documentation] Verify system boot states at "Running" state.
- [Tags] Verify_Boot_Sensor_States_At_Running
- [Template] Valid Boot States
-
- # Example: Expected state
- # "data": {
- # "/xyz/openbmc_project/state/bmc0": {
- # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready",
- # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None"
- # },
- # "/xyz/openbmc_project/state/chassis0": {
- # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.On",
- # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off"
- # },
- # "/xyz/openbmc_project/state/host0": {
- # "AttemptsLeft": 2,
- # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.MotherboardInit",
- # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Running",
- # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
- # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.On"
- # }
- # }
-
- # System at Running state but during initial state.
- Running
-
-
-Verify Boot Sensor States At Host Booted
- [Documentation] Verify system boot states when host is booted.
- [Tags] Verify_Boot_Sensor_States_At_Host_Booted
- [Template] Valid Boot States
-
- # Example: Expected state
- # "data": {
- # "/xyz/openbmc_project/state/bmc0": {
- # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready",
- # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None"
- # },
- # "/xyz/openbmc_project/state/chassis0": {
- # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.On",
- # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off"
- # },
- # "/xyz/openbmc_project/state/host0": {
- # "AttemptsLeft": 3,
- # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.OSStart",
- # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Running",
- # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete",
- # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.On"
- # }
- # }
-
- # System when host is booted.
- Booted
-
-
-Verify Boot Sensor States RR on Host Booted
- [Documentation] Verify system boot states post BMC reset.
- [Tags] Verify_Boot_Sensor_States_RR_on_Host_Booted
- [Template] Valid Boot States
-
- # Example: Expected state
- # "data": {
- # "/xyz/openbmc_project/state/bmc0": {
- # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready",
- # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None"
- # },
- # "/xyz/openbmc_project/state/chassis0": {
- # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.On",
- # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off"
- # },
- # "/xyz/openbmc_project/state/host0": {
- # "AttemptsLeft": 3,
- # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.OSStart",
- # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Running",
- # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete",
- # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.On"
- # }
- # }
-
- # System when host is booted.
- ResetReload
-
-
-*** Keywords ***
-
-Validate Boot AttemptsLeft
- [Documentation] Verify boot attempts for a given system state.
- [Arguments] ${sys_state} ${expected_attempts_left}
-
- # Description of argument(s):
- # sys_state A user-defined boot state (e.g. "Off", "On", etc).
- # See VALID_BOOT_STATES in state_map.py.
- # expected_attempts_left Boot attempts left.
-
- Choose Boot And Run ${sys_state}
- ${atempts_left}= Read Attribute ${HOST_STATE_URI} AttemptsLeft
- Should Be True ${atempts_left} == ${expected_attempts_left}
-
-
-Valid Boot States
- [Documentation] Verify boot states for a given system state.
- [Arguments] ${sys_state}
-
- # Description of argument(s):
- # sys_state A user-defined boot state (e.g. "Off", "On", etc).
- # See VALID_BOOT_STATES in state_map.py.
-
- Choose Boot And Run ${sys_state}
- ${boot_states}= Get Boot State
- ${valid_state}= Valid Boot State ${sys_state} ${boot_states}
- Should Be True ${valid_state}
-
-
-Choose Boot And Run
- [Documentation] Choose system boot type.
- [Arguments] ${option}
-
- # Description of argument(s):
- # option Boot type (e.g. "Off", "On", "Reboot", etc.).
-
- Run Keyword If '${option}' == 'Off'
- ... Initiate Host PowerOff
- ... ELSE IF '${option}' == 'Reboot'
- ... Run Keywords Initiate Host PowerOff AND Initiate BMC Reboot
- ... AND Wait For BMC Ready
- ... ELSE IF '${option}' == 'Running'
- ... Power On Till Chassis Is On
- ... ELSE IF '${option}' == 'Booted'
- ... Initiate Host Boot
- ... ELSE IF '${option}' == 'RebootHost'
- ... Initiate Host Reboot wait=${0}
- ... ELSE IF '${option}' == 'ResetReload'
- ... Reboot Host And Expect Runtime
-
-
-Power On Till Chassis Is On
- [Documentation] Initiate power on and check till chassis state is just
- ... turned "On".
-
- # TODO: Move to smart power off once ready.
- Initiate Host PowerOff
- Initiate Host Boot wait=${0}
- Wait Until Keyword Succeeds 2 min 10 sec Is Chassis On
-
- # TODO: Find better mechanism instead of wait.
- Sleep 20 Sec
-
-
-Reboot Host And Expect Runtime
- [Documentation] Initiate reset reload when host is booted.
-
- Initiate BMC Reboot
- Wait Until Keyword Succeeds 10 min 10 sec Is OS Booted
- Verify BMC RTC And UTC Time Drift
-
-
-Post Test Case Execution
- [Documentation] Do the post test teardown.
- # - Capture FFDC on test failure.
- # - Delete error logs.
- # - Close all open SSH connections.
- # - Clear all REST sessions.
-
- FFDC On Test Case Fail
- Delete All Error Logs
- Close All Connections
-
diff --git a/tests/test_time.robot b/tests/test_time.robot
deleted file mode 100644
index 9fe9ecf..0000000
--- a/tests/test_time.robot
+++ /dev/null
@@ -1,497 +0,0 @@
-*** Settings ***
-Documentation This suite is for testing System time in Open BMC.
-
-Resource ../lib/rest_client.robot
-Resource ../lib/ipmi_client.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/state_manager.robot
-Resource ../lib/resource.robot
-
-Library OperatingSystem
-Library DateTime
-
-Test Setup Open Connection And Log In
-Test Teardown Post Test Case Execution
-
-Force Tags Clock_Time
-
-*** Variables ***
-${SYSTEM_TIME_INVALID} 01/01/1969 00:00:00
-${SYSTEM_TIME_VALID} 02/29/2016 09:10:00
-${ALLOWED_TIME_DIFF} 3
-# Equivalent epoch time for 02/17/2017 04:11:40
-${SYSTEM_TIME_VALID_EPOCH} ${1487304700000000}
-
-*** Test Cases ***
-
-Get System Time
- [Documentation] Get system time using IPMI and verify that it matches
- ... with BMC date time.
- [Tags] Get_System_Time
-
- ${resp}= Run IPMI Standard Command sel time get
- ${ipmidate}= Convert Date ${resp} date_format=%m/%d/%Y %H:%M:%S
- ... exclude_millis=yes
- ${bmcdate}= Get BMC Time Using IPMI
- ${diff}= Subtract Date From Date ${bmcdate} ${ipmidate}
- ${diff}= Convert To Number ${diff}
- Should Be True ${diff} < ${ALLOWED_TIME_DIFF}
- ... Open BMC time does not match with IPMI sel time
-
-
-Set Valid System Time
- [Documentation] Set system time using IPMI and verify that it is
- ... correctly set in BMC.
- [Tags] Set_Valid_System_Time
-
- Set Time Mode ${MANUAL_MODE}
-
- # Added delay for NTP mode to get disabled fully
- Sleep 30s
-
- ${resp}= Run IPMI Standard Command sel time set "${SYSTEM_TIME_VALID}"
- ${setdate}= Convert Date ${SYSTEM_TIME_VALID}
- ... date_format=%m/%d/%Y %H:%M:%S exclude_millis=yes
- ${bmcdate}= Get BMC Time Using IPMI
- ${diff}= Subtract Date From Date ${bmcdate} ${setdate}
- ${diff}= Convert To Number ${diff}
- Should Be True ${diff} < ${ALLOWED_TIME_DIFF}
- ... Open BMC time does not match with set time
-
-
-Set Invalid System Time
- [Documentation] Set system time with invalid time using IPMI and verify
- ... that it should throw error.
- [Tags] Set_Invalid_System_Time
-
- Set Time Mode ${MANUAL_MODE}
-
- ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
- ... sel time set "${SYSTEM_TIME_INVALID}"
- Should Start With ${msg} Specified time could not be parsed
-
-Set System Time with no time
- [Documentation] Set system time with no time using IPMI and verify
- ... that it should throw error.
- [Tags] Set_System_Time_with_no_time
-
- Set Time Mode ${MANUAL_MODE}
-
- ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
- ... sel time set ""
- Should Start With ${msg} Specified time could not be parsed
-
-
-Set BMC Time With BMC And Manual
- [Documentation] Set BMC time when time owner is BMC and time mode is
- ... manual.
- [Tags] Set_BMC_Time_With_BMC_And_Manual
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set BMC Time ${BMC_OWNER} ${MANUAL_MODE} ok Set Change
-
-
-Set BMC Time With Both And Manual
- [Documentation] Set BMC time when time owner is Both and time mode is
- ... manual.
- [Tags] Set_BMC_Time_With_Both_And_Manual
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
- #Operation Owner Mode Status BMC Time Host Time
- Set BMC Time ${BOTH_OWNER} ${MANUAL_MODE} ok Set Change
-
-
-Set BMC Time With Split And Manual
- [Documentation] Set BMC time when time owner is Split and time mode is
- ... manual.
- [Tags] Set_BMC_Time_With_Split_And_Manual
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
- #Operation Owner Mode Status BMC Time Host Time
- Set BMC Time ${SPLIT_OWNER} ${MANUAL_MODE} ok Set No Change
-
-
-Set BMC Time With BMC And NTP
- [Documentation] Set BMC time when time owner is BMC and time mode is
- ... NTP.
- [Tags] Set_BMC_Time_With_BMC_And_NTP
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
- #Operation Owner Mode Status BMC Time Host Time
- Set BMC Time ${BMC_OWNER} ${NTP_MODE} error Not Set No Change
-
-
-Set BMC Time With Host And Manual
- [Documentation] Set BMC time when time owner is Host and time mode is
- ... Manual.
- [Tags] Set_BMC_Time_With_Host_And_Manual
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set BMC Time ${HOST_OWNER} ${MANUAL_MODE} error Not Set No Change
-
-
-Set BMC Time With Both And NTP
- [Documentation] Set BMC time when time owner is Both and time mode is
- ... NTP.
- [Tags] Set_BMC_Time_With_Both_And_NTP
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set BMC Time ${BOTH_OWNER} ${NTP_MODE} error Not Set No Change
-
-
-Set BMC Time With Split And NTP
- [Documentation] Set BMC time when time owner is Split and time mode is
- ... NTP.
- [Tags] Set_BMC_Time_With_Split_And_NTP
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set BMC Time ${SPLIT_OWNER} ${NTP_MODE} error Not Set No Change
-
-
-Set BMC Time With Host And NTP
- [Documentation] Set BMC time when time owner is Host and time mode is
- ... NTP.
- [Tags] Set_BMC_Time_With_Host_And_NTP
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set BMC Time ${HOST_OWNER} ${NTP_MODE} error Not Set No Change
-
-
-Set Host Time With Host And Manual
- [Documentation] Set host time when time owner is host and time mode is
- ... manual.
- [Tags] Set_Host_Time_With_Host_And_Manual
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set Host Time ${HOST_OWNER} ${MANUAL_MODE} ok Change Set
-
-
-Set Host Time With Both And NTP
- [Documentation] Set host time when time owner is both and time mode is
- ... NTP.
- [Tags] Set_Host_Time_With_Both_And_NTP
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set Host Time ${BOTH_OWNER} ${NTP_MODE} error No Change Not Set
-
-
-Set Host Time With Split And Manual
- [Documentation] Set host time when time owner is split and time mode is
- ... manual.
- [Tags] Set_Host_Time_With_Split_And_Manual
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set Host Time ${SPLIT_OWNER} ${MANUAL_MODE} ok No Change Set
-
-
-Set Host Time With Split And NTP
- [Documentation] Set host time when time owner is split and time mode is
- ... NTP.
- [Tags] Set_Host_Time_With_Split_And_NTP
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time HOST Time
- Set Host Time ${SPLIT_OWNER} ${NTP_MODE} ok No Change Set
-
-
-Set Host Time With BMC And Manual
- [Documentation] Set host time when time owner is BMC and time mode is
- ... Manual.
- [Tags] Set_Host_Time_With_BMC_And_Manual
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time HOST Time
- Set Host Time ${BMC_OWNER} ${MANUAL_MODE} error No Change Not Set
-
-
-Set Host Time With BMC Owner NTP
- [Documentation] Set host time when time owner is BMC and time mode is
- ... NTP.
- [Tags] Set_Host_Time_With_BMC_Owner_NTP
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time HOST Time
- Set Host Time ${BMC_OWNER} ${NTP_MODE} error No Change Not Set
-
-
-Set Host Time With Host And NTP
- [Documentation] Set host time when time owner is Host and time mode is
- ... NTP.
- [Tags] Set_Host_Time_With_Host_And_NTP
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set Host Time ${HOST_OWNER} ${NTP_MODE} error Not Change No Set
-
-
-Set Host Time With Both And Manual
- [Documentation] Set host time when time owner is both and time mode is
- ... manual.
- [Tags] Set_Host_Time_With_Both_And_Manual
- [Template] Set Time Using REST
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- #Operation Owner Mode Status BMC Time Host Time
- Set Host Time ${BOTH_OWNER} ${MANUAL_MODE} ok Change Set
-
-
-Set Invalid Time Mode
- [Documentation] Set time mode with invalid value using REST and verify
- ... that it should throw error.
- [Tags] Set_Invalid_Time_Mode
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- ${timemode}=
- ... Set Variable xyz.openbmc_project.Time.Synchronization.Method.abc
- ${valueDict}= Create Dictionary data=${timemode}
-
- ${resp}= OpenBMC Put Request
- ... ${TIME_MANAGER_URI}sync_method/attr/TimeSyncMethod data=${valueDict}
- ${jsondata}= to JSON ${resp.content}
- Should Be Equal ${jsondata['status']} error
-
- ${mode}= Read Attribute ${TIME_MANAGER_URI}sync_method TimeSyncMethod
- Should Not Be Equal ${mode}
- ... xyz.openbmc_project.Time.Synchronization.Method.abc
-
-
-Set Invalid Time Owner
- [Documentation] Set time owner with invalid value using REST and verify
- ... that it should throw error.
- [Tags] Set_Invalid_Time_Owner
- [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution
-
- ${timeowner}= Set Variable xyz.openbmc_project.Time.Owner.Owners.xyz
- ${valueDict}= Create Dictionary data=${timeowner}
-
- ${resp}= OpenBMC Put Request
- ... ${TIME_MANAGER_URI}owner/attr/TimeOwner data=${valueDict}
- ${jsondata}= to JSON ${resp.content}
- Should Be Equal ${jsondata['status']} error
-
- ${owner}= Read Attribute ${TIME_MANAGER_URI}owner TimeOwner
- Should Not Be Equal ${owner} xyz.openbmc_project.Time.Owner.Owners.xyz
-
-
-*** Keywords ***
-
-Get BMC Time Using IPMI
- [Documentation] Returns BMC time of the system via IPMI
-
- ${stdout} ${stderr} ${output}=
- ... Execute Command date "+%m/%d/%Y %H:%M:%S"
- ... return_stdout=True return_stderr= True return_rc=True
- Should Be Equal ${output} ${0} msg=${stderr}
-
- ${resp}= Convert Date ${stdout} date_format=%m/%d/%Y %H:%M:%S
- ... exclude_millis=yes
- Should Not Be Empty ${resp}
- [Return] ${resp}
-
-
-Set Time Owner
- [Arguments] ${args}
- [Documentation] Set time owner of the system via REST
-
- ${timeowner}= Set Variable ${args}
- ${valueDict}= Create Dictionary data=${timeowner}
-
- ${resp}= OpenBMC Put Request
- ... ${TIME_MANAGER_URI}owner/attr/TimeOwner data=${valueDict}
- ${jsondata}= to JSON ${resp.content}
-
- ${host_state}= Get Host State
-
- Run Keyword If '${host_state}' == 'Off'
- ... Log System is in off state so owner change will get applied.
- ... ELSE Run keyword
- ... Initiate Host PowerOff
-
- ${owner}= Read Attribute ${TIME_MANAGER_URI}owner TimeOwner
- Should Be Equal ${owner} ${args}
-
- [Return] ${jsondata['status']}
-
-
-Verify Set Time Via REST
- [Documentation] Verify set time via REST.
- [Arguments] ${target} ${expected_status}
- # Description of argument(s):
- # target The target of the set time operation: "bmc" or "host".
- # expected_status Expected status of set time operation
-
- ${time_owner_url}= Set Variable ${TIME_MANAGER_URI}${target}
-
- ${args}= Create Dictionary data=${SYSTEM_TIME_VALID_EPOCH}
- ${resp}= OpenBMC Put Request
- ... ${time_owner_url}/attr/Elapsed data=${args}
- ${jsondata}= to Json ${resp.content}
- Run Keyword If "${expected_status}" == "ok"
- ... Should Not Be Equal As Strings ${jsondata['message']} 403 Forbidden
- Should Be Equal As Strings ${jsondata['status']} ${expected_status}
-
-
-Set Time Mode
- [Arguments] ${args}
- [Documentation] Set time mode of the system via REST
-
- ${timemode}= Set Variable ${args}
- ${valueDict}= Create Dictionary data=${timemode}
-
- ${resp}= OpenBMC Put Request
- ... ${TIME_MANAGER_URI}sync_method/attr/TimeSyncMethod data=${valueDict}
- ${jsondata}= to JSON ${resp.content}
- Sleep 5s
-
- ${mode}= Read Attribute ${TIME_MANAGER_URI}sync_method TimeSyncMethod
- Should Be Equal ${mode} ${args}
-
-
-Get BMC Time Using REST
- [Documentation] Returns BMC time of the system via REST
- ... Time Format : epoch time in microseconds
- ... e.g 1507809604687329
-
- ${resp}= Read Attribute ${TIME_MANAGER_URI}/bmc Elapsed
- [Return] ${resp}
-
-
-Get HOST Time Using REST
- [Documentation] Returns HOST time of the system via REST
- ... Time Format : epoch time in microseconds
- ... e.g 1507809604687329
-
- ${resp}= Read Attribute ${TIME_MANAGER_URI}/host Elapsed
- [Return] ${resp}
-
-
-Set Time Using REST
- [Arguments] ${operation} ${owner} ${mode} ${status} ${bmc_time}
- ... ${host_time}
- [Documentation] Set BMC or Host time on system via REST.
- ... Description of arguments:
- ... operation : Set BMC/Host time
- ... owner: Time owner
- ... mode: Time mode
- ... status: Expected status of set BMC time URI
- ... bmc_time: Status of BMC time after operation
- ... host_time: Status of HOST time after operation
- ... Set - Given time is set
- ... Not Set - Given time is not set
- ... Change - time is change
- ... No Change - time is not change
-
- Set Time Owner ${owner}
- Set Time Mode ${mode}
-
- ${setdate}= Set Variable ${SYSTEM_TIME_VALID_EPOCH}
-
- ${start_time}= Get Current Date
-
- ${old_bmc_time}= Get BMC Time Using REST
- ${old_host_time}= Get HOST Time Using REST
-
- Run Keyword If '${operation}' == 'Set BMC Time'
- ... Wait Until Keyword Succeeds 1 min 20 sec Verify Set Time Via REST
- ... bmc ${status}
- ... ELSE IF '${operation}' == 'Set Host Time'
- ... Wait Until Keyword Succeeds 1 min 20 sec Verify Set Time Via REST
- ... host ${status}
-
-
- ${new_bmc_time}= Get BMC Time Using REST
- ${new_host_time}= Get HOST Time Using REST
-
- ${end_time}= Get Current Date
- ${time_duration}= Subtract Date From Date ${start_time} ${end_time}
- ${time_duration} Evaluate abs(${time_duration})
-
- # Convert epoch to date format: YYYY-MM-DD hh:mm:ss.mil
- ${setdate}= Convert epoch to date ${setdate}
- ${new_bmc_time}= Convert epoch to date ${new_bmc_time}
- ${old_bmc_time}= Convert epoch to date ${old_bmc_time}
- ${new_host_time}= Convert epoch to date ${new_host_time}
- ${old_host_time}= Convert epoch to date ${old_host_time}
-
-
- ${bmc_diff_set_new}=
- ... Subtract Date From Date ${setdate} ${new_bmc_time}
- ${bmc_diff_set_new}= Evaluate abs(${bmc_diff_set_new})
- ${bmc_diff_old_new}=
- ... Subtract Date From Date ${old_bmc_time} ${new_bmc_time}
- ${bmc_diff_old_new}= Evaluate abs(${bmc_diff_old_new})
-
- ${host_diff_set_new}=
- ... Subtract Date From Date ${setdate} ${new_host_time}
- ${host_diff_set_new}= Evaluate abs(${host_diff_set_new})
- ${host_diff_old_new}=
- ... Subtract Date From Date ${old_host_time} ${new_host_time}
- ${host_diff_old_new}= Evaluate abs(${host_diff_old_new})
-
- Run Keyword If '${bmc_time}' == 'Not Set'
- ... Should Be True ${bmc_diff_set_new} >= ${time_duration}
- ... ELSE IF '${bmc_time}' == 'Set'
- ... Should Be True ${bmc_diff_set_new} <= ${time_duration}
- ... ELSE IF '${bmc_time}' == 'No Change'
- ... Should Be True ${bmc_diff_old_new} <= ${time_duration}
- ... ELSE IF '${bmc_time}' == 'Change'
- ... Should Be True ${bmc_diff_old_new} >= ${time_duration}
-
- Run Keyword If '${host_time}' == 'No Change'
- ... Should Be True ${host_diff_old_new} <= ${time_duration}
- ... ELSE IF '${host_time}' == 'Change'
- ... Should Be True ${host_diff_old_new} >= ${time_duration}
- ... ELSE IF '${host_time}' == 'Not Set'
- ... Should Be True ${host_diff_set_new} >= ${time_duration}
- ... ELSE IF '${host_time}' == 'Set'
- ... Should Be True ${host_diff_set_new} <= ${time_duration}
-
-Convert epoch to date
- [Documentation] Convert epoch time to date format.
- [Arguments] ${epoch_time}
- # Description of argument(s):
- # epoch_time epoch time in milliseconds.
- # (e.g. 1487304700000000)
-
- # Convert epoch_time into floating point number.
- ${epoch_time}= Convert To Number ${epoch_time}
-
- # Convert epoch time from microseconds to seconds
- ${epoch_time_sec}= Evaluate ${epoch_time}/1000000
-
- # Convert epoch time to date format: YYYY-MM-DD hh:mm:ss.mil
- # e.g. 2017-02-16 22:14:11.000
- ${date}= Convert Date ${epoch_time_sec}
-
- [Return] ${date}
-
-
-Post Test Case Execution
- [Documentation] Do the post test teardown.
- ... 1. Capture FFDC on test failure.
- ... 2. Sets defaults for time mode and owner.
- ... 3. Close all open SSH connections.
-
- FFDC On Test Case Fail
- Set Time Mode ${NTP_MODE}
- Close All Connections
diff --git a/tests/test_xit.robot b/tests/test_xit.robot
deleted file mode 100644
index b1056c6..0000000
--- a/tests/test_xit.robot
+++ /dev/null
@@ -1,39 +0,0 @@
-*** Settings ***
-Documentation This suite is for disable field mode if enabled.
-
-Resource ../lib/code_update_utils.robot
-Resource ../lib/openbmc_ffdc.robot
-Resource ../lib/dump_utils.robot
-
-Test Teardown FFDC On Test Case Fail
-
-*** Variables ***
-
-# Error strings to check from journald.
-${ERROR_REGEX} SEGV|core-dump|FAILURE|Failed to start|Found ordering cycle
-
-*** Test Cases ***
-
-Verify Field Mode Is Disable
- [Documentation] Disable software manager field mode.
- [Tags] Verify_Field_Mode_Is_Disable
-
- # Field mode is enabled before running CT.
- # It is to ensure that the setting is not changed during CT
- Field Mode Should Be Enabled
- Disable Field Mode And Verify Unmount
-
-
-Verify No BMC Dump And Application Failures
- [Documentation] Verify no BMC dump exist.
- [Tags] Verify_No_BMC_Dump_And_Application_Failures
-
- ${resp}= OpenBMC Get Request ${DUMP_URI}
- Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}'
- ... Set Test Variable ${DUMP_ENTRY_URI} /xyz/openbmc_project/dump/entry/
-
- ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list
- Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
- ... msg=BMC dump(s) were not deleted as expected.
-
- Check For Regex In Journald ${ERROR_REGEX} error_check=${0} boot=-b