├── .flake8-ignore ├── .gitignore ├── .markdownlint.yaml ├── .shellcheck-ignore ├── CONTRIBUTING.md ├── LICENSE ├── OWNERS ├── README.md ├── bin ├── auto_status_file.py ├── event_notification_util.py ├── gen_list.sh ├── gen_setup.sh ├── generate_inventory ├── generate_testsuite_info.py ├── jenkins_funcs.sh ├── obmc_ser_num ├── plug_ins │ ├── Auto_reboot │ │ ├── cp_cleanup │ │ ├── cp_master │ │ ├── cp_post_reboot │ │ ├── cp_pre_boot │ │ ├── cp_setup │ │ ├── integrated │ │ ├── parm_def │ │ └── supports_obmc │ ├── FFDC │ │ ├── cp_ffdc_check │ │ ├── parm_def │ │ └── supports_obmc │ ├── Mem_tracker │ │ └── memcheck.sh │ ├── Soft_errors │ │ ├── cp_post_boot │ │ └── supports_obmc │ └── Stop │ │ ├── cp_stop_check │ │ ├── parm_def │ │ └── supports_obmc ├── print_ffdc_functions ├── process_plug_in_packages.py ├── prop_call.py ├── python ├── robot ├── run_robot_pgm_jenk.sh ├── select_version ├── sol_utils.tcl ├── ssh_pw ├── validate_plug_ins.py └── websocket_monitor.py ├── data ├── Palmetto.py ├── Romulus.py ├── Witherspoon.py ├── applytime_table.json ├── boot_lists │ ├── All │ ├── Code_update │ ├── Manufacturing │ ├── OBMC_reboot │ ├── OS_reboot │ ├── PDU_reboot │ ├── Power_off │ └── Power_on ├── boot_table.json ├── boot_table_osrunning_redfish.json ├── boot_table_redfish.json ├── boot_table_x86.json ├── dcmi_raw_cmd_table.py ├── inventory.py ├── ipmi_raw_cmd_table.py ├── ipmi_rest_fru_field_map.py ├── ipmi_variable.py ├── model.py ├── oem │ └── nuvoton │ │ └── olympus.json ├── openbmc_redfish_interop_profile.json ├── pel_variables.py ├── platform_variables.py ├── pldm_variables.py ├── resource_lock_table.json ├── sensor_dbus.json ├── task_state.json ├── variables.py └── vpd_variables.py ├── docs ├── boot_test.md ├── certificate_generate.md ├── code_standards_check.md ├── code_update.md ├── gui_setup_reference.md ├── openbmc_test_architecture.md ├── openbmc_test_tools.md ├── redfish_coding_guidelines.md └── redfish_request_via_mTLS.md ├── extended ├── __init__.robot ├── code_update │ ├── bmc_code_update.robot │ ├── code_update_utils.robot │ └── host_code_update.robot ├── factory_reset.robot ├── obmc_boot_test.robot ├── obmc_boot_test_resource.robot ├── run_keyword.py ├── run_keyword.robot ├── standby_bmc.robot ├── test_ac_cycles.robot ├── test_bios_update.robot ├── test_bmc_reset_loop.robot ├── test_bmc_stress_buster.robot └── test_bmc_upload_stability.robot ├── ffdc ├── README.md ├── collect_ffdc.py ├── docs │ ├── plugin.md │ └── yaml_syntax_rules.md ├── ffdc_collector.py ├── ffdc_config.yaml ├── lib │ ├── ssh_utility.py │ └── telnet_utility.py ├── plugins │ ├── date_time_utils.py │ ├── redfish.py │ ├── scp_execution.py │ ├── shell_execution.py │ ├── ssh_execution.py │ └── telnet_execution.py ├── requirements.txt └── templates │ ├── env_vars_template.yaml │ └── log_collector_config_template.yaml ├── gui ├── __init__.robot ├── data │ ├── gui_variables.py │ └── resource_variables.py ├── gui_test │ ├── gui_header │ │ ├── test_gui_header.robot │ │ └── test_profile_settings_sub_menu.robot │ ├── hardware_status_menu │ │ ├── test_inventory_and_leds_sub_menu.robot │ │ └── test_sensors_sub_menu.robot │ ├── logs_and_services_menu │ │ ├── test_event_logs_sub_menu.robot │ │ └── test_progress_logs_sub_menu.robot │ ├── notices_menu │ │ └── test_notices_menu.robot │ ├── operations_menu │ │ ├── test_firmware_sub_menu.robot │ │ ├── test_host_console_sub_menu.robot │ │ ├── test_reboot_bmc_sub_menu.robot │ │ └── test_server_power_operations_sub_menu.robot │ ├── overview_menu │ │ └── test_overview_menu.robot │ ├── security_and_access_menu │ │ ├── test_certificates_sub_menu.robot │ │ ├── test_ldap_sub_menu.robot │ │ ├── test_multiple_interfaces.robot │ │ ├── test_policies_sub_menu.robot │ │ ├── test_sessions_sub_menu.robot │ │ └── test_user_management_sub_menu.robot │ └── settings_menu │ │ ├── test_date_and_time_sub_menu.robot │ │ ├── test_factory_reset_sub_menu.robot │ │ ├── test_network_sub_menu.robot │ │ ├── test_power_restore_policy_sub_menu.robot │ │ └── test_snmp_alerts_sub_menu.robot ├── lib │ ├── gui_resource.robot │ ├── resource.robot │ ├── supporting_libs.py │ └── utils_get_version.py └── test │ ├── access_control │ ├── test_obmc_gui_certificate.robot │ ├── test_obmc_gui_ldap.robot │ └── test_obmc_gui_local_users.robot │ ├── gui_header │ ├── test_obmc_gui_ip_refresh_check.robot │ └── test_obmc_gui_server_health.robot │ ├── server_config │ ├── test_obmc_gui_date_and_time_settings.robot │ ├── test_obmc_gui_firmware_update.robot │ ├── test_obmc_gui_network_settings.robot │ └── test_obmc_gui_snmp_settings.robot │ ├── server_control │ ├── test_obmc_gui_manage_power_usage.robot │ ├── test_obmc_gui_reboot_bmc.robot │ ├── test_obmc_gui_server_led.robot │ ├── test_obmc_gui_server_power_operations.robot │ ├── test_obmc_gui_sol_console.robot │ └── test_obmc_gui_virtual_media.robot │ ├── server_health │ ├── test_obmc_gui_hardware_status.robot │ └── test_obmc_gui_sensors.robot │ └── server_overview │ └── test_obmc_gui_server_overview.robot ├── ipmi ├── dcmi │ ├── test_dcmi_asset_tag.robot │ ├── test_dcmi_get_capabilities.robot │ ├── test_dcmi_get_temperature_reading.robot │ └── test_dcmi_management_controller.robot ├── test_get_bios_post_code.robot ├── test_ipmi_chassis.robot ├── test_ipmi_cipher.robot ├── test_ipmi_cold_reset.robot ├── test_ipmi_device_id.robot ├── test_ipmi_disable.robot ├── test_ipmi_fru.robot ├── test_ipmi_fru_device.robot ├── test_ipmi_general.robot ├── test_ipmi_inband_sdr.robot ├── test_ipmi_kcs.robot ├── test_ipmi_lanplus.robot ├── test_ipmi_mc_id.robot ├── test_ipmi_network_configuration.robot ├── test_ipmi_network_verification.robot ├── test_ipmi_payload.robot ├── test_ipmi_poh_counter.robot ├── test_ipmi_resets.robot ├── test_ipmi_sdr.robot ├── test_ipmi_sel.robot ├── test_ipmi_sel_time.robot ├── test_ipmi_sensor.robot ├── test_ipmi_sol.robot ├── test_ipmi_systeminfo_parameters.robot ├── test_ipmi_user.robot └── test_ipmi_watchdog.robot ├── lib ├── bios_attr_utils.robot ├── bmc_cleanup.robot ├── bmc_date_and_time_utils.robot ├── bmc_dbus.robot ├── bmc_ipv6_utils.robot ├── bmc_ldap_utils.robot ├── bmc_network_security_utils.robot ├── bmc_network_utils.py ├── bmc_network_utils.robot ├── bmc_redfish.py ├── bmc_redfish_resource.robot ├── bmc_redfish_utils.py ├── bmc_redfish_utils.robot ├── bmc_ssh_utils.py ├── boot_data.py ├── boot_utils.robot ├── call_stack.tcl ├── certificate_utils.robot ├── cmd.tcl ├── code_update_utils.py ├── code_update_utils.robot ├── code_update_utils_serial.robot ├── common_utils.robot ├── connection_client.robot ├── data_proc.tcl ├── disable_warning_urllib.py ├── dmtf_redfishtool_utils.robot ├── dmtf_tools_utils.robot ├── dump_utils.py ├── dump_utils.robot ├── dvt │ └── obmc_driver_vars.txt ├── energy_scale_utils.robot ├── escape.tcl ├── esel_utils.robot ├── event_notification.py ├── event_notification_utils.robot ├── external_intf │ ├── management_console_utils.py │ ├── management_console_utils.robot │ └── vmi_utils.robot ├── fan_utils.robot ├── ffdc_cli_robot_script.py ├── firmware_utils.py ├── func_args.py ├── func_timer.py ├── gen_arg.py ├── gen_call_robot.py ├── gen_cmd.py ├── gen_misc.py ├── gen_plug_in.py ├── gen_plug_in_utils.py ├── gen_print.py ├── gen_robot_keyword.py ├── gen_robot_plug_in.py ├── gen_robot_print.py ├── gen_robot_ssh.py ├── gen_robot_utils.py ├── gen_robot_valid.py ├── gen_valid.py ├── host.tcl ├── htx_resource.robot ├── ipmi_client.py ├── ipmi_client.robot ├── ipmi_utils.py ├── ipmi_utils.robot ├── jobs_processing.py ├── list_utils.robot ├── logging_utils.py ├── logging_utils.robot ├── obmc_boot_test.py ├── open_power_utils.robot ├── openbmc_ffdc.py ├── openbmc_ffdc.robot ├── openbmc_ffdc_list.py ├── openbmc_ffdc_methods.robot ├── openbmc_ffdc_utils.robot ├── opt.tcl ├── os_utilities.py ├── os_utilities.robot ├── os_utils_config.robot ├── os_utils_install.robot ├── os_utils_keywords.py ├── pdu │ ├── cyber.robot │ ├── pdu.robot │ ├── schneider.robot │ └── synaccess.robot ├── pel_utils.py ├── pldm_utils.py ├── print.tcl ├── protocol_setting_utils.robot ├── pythonutil.py ├── redfish_code_update_utils.robot ├── redfish_plus.py ├── redfish_request.py ├── redfish_request.robot ├── remote_logging_utils.robot ├── resource.robot ├── rest_client.robot ├── rest_response_code.robot ├── secureboot │ └── secureboot.robot ├── sensor_info_record.py ├── serial_connection │ └── serial_console_client.robot ├── snmp │ ├── redfish_snmp_utils.robot │ ├── resource.robot │ └── snmp_utils.robot ├── source.tcl ├── state.py ├── state_manager.robot ├── state_map.py ├── tally_sheet.py ├── tftp_update_utils.py ├── tools.exp ├── utilities.py ├── utils.py ├── utils.robot ├── utils_files.py ├── valid.tcl ├── var_funcs.py ├── var_stack.py ├── vpd_utils.py ├── wrap_utils.py └── xcat │ ├── resource.robot │ └── xcat_utils.robot ├── network ├── network_diagnostic_report.robot ├── test_bmc_dhcp_conf.robot ├── test_cable_pull_recover.robot ├── test_host_network.robot ├── test_host_network_interfaces.robot ├── test_network_nping.robot └── test_vlan_network.robot ├── oem └── nuvoton │ ├── test_ipmi_flash.robot │ ├── test_jtag_master.robot │ └── test_redfish_mcu_fw_update.robot ├── openpower ├── check_error_logs.robot ├── check_vpd_and_hw_status.robot ├── ext_interfaces │ ├── test_client_identifier.robot │ ├── test_discovery.robot │ ├── test_lock_management.robot │ ├── test_savearea_management.robot │ ├── test_vmi.robot │ ├── test_vmi_multiple_interfaces.robot │ └── test_vmicert_management.robot ├── ipmi │ └── test_ipmi_sdr.robot ├── localuser │ └── test_ipmi_redfish_user.robot ├── mpipl │ └── test_mpipl_basic.robot ├── pel │ └── test_bmc_pel.robot ├── test_bmc_devicetree.robot ├── test_inband_bmc_auth_reset.robot ├── test_nmi_interface.robot ├── test_occ_power.robot ├── test_timed_power_on.robot └── vpd │ └── test_vpd_tool.robot ├── pldm ├── test_firmware_boot_side.robot ├── test_pldm_base.robot ├── test_pldm_bios.robot ├── test_pldm_bios_attributes.robot ├── test_pldm_fru.robot ├── test_pldm_oem.robot ├── test_pldm_platform.robot └── test_redfish_bios_attributes.robot ├── redfish ├── __init__.robot ├── account_service │ ├── test_ipmi_redfish_user.robot │ ├── test_ldap_configuration.robot │ ├── test_redfish_privilege_registry.robot │ └── test_user_account.robot ├── dmtf_tools │ ├── Redfish_Interop_Validator.robot │ ├── Redfish_JsonSchema_ResponseValidator.robot │ ├── Redfish_Protocol_Validator.robot │ ├── Redfish_Reference_Checker.robot │ ├── Redfish_Service_Validator.robot │ ├── Redfish_Usecase_Checkers.robot │ ├── test_redfishtool_certificate.robot │ ├── test_redfishtool_general.robot │ └── test_redfishtool_local_user.robot ├── events │ ├── test_bmc_snmp_config.robot │ └── test_bmc_snmp_trap.robot ├── extended │ ├── redfish_bmc_code_update.robot │ ├── redfish_host_code_update.robot │ ├── test_basic_ci.robot │ ├── test_bmc_dump.robot │ ├── test_bmc_file_mirroring.robot │ ├── test_escale_base.robot │ ├── test_fan_operation.robot │ ├── test_os_reboot.robot │ ├── test_power_capping.robot │ ├── test_power_restore.robot │ ├── test_service_restart_policy.robot │ └── test_websocket.robot ├── managers │ ├── test_bmc_dumps.robot │ ├── test_bmc_ipv6.robot │ ├── test_bmc_network_conf.robot │ ├── test_bmc_network_mac.robot │ ├── test_bmc_network_protocol.robot │ ├── test_bmc_protocol_settings.robot │ ├── test_certificate.robot │ ├── test_lldp_config.robot │ ├── test_managers_bmc.robot │ ├── test_managers_bmc_time.robot │ ├── test_multiple_interfaces.robot │ └── test_multiple_interfaces_dhcp.robot ├── service_root │ ├── test_service_root.robot │ ├── test_service_root_security.robot │ ├── test_sessions_connection.robot │ └── test_sessions_management.robot ├── systems │ ├── LogServices │ │ └── test_post_codes.robot │ ├── eventlog │ │ ├── test_esel.robot │ │ ├── test_event_logging.robot │ │ └── test_event_service.robot │ ├── test_alternate_fan_settings.robot │ ├── test_boot_devices.robot │ ├── test_led_indicator_asserted.robot │ ├── test_power_control_metrics.robot │ ├── test_power_operations.robot │ ├── test_power_voltage_readings.robot │ ├── test_powersubsystem_settings.robot │ ├── test_powersupply_readings.robot │ ├── test_sensor_monitoring.robot │ ├── test_systems_inventory.robot │ └── test_thermal_ambient_temperatures.robot ├── task_service │ └── test_tasks_service.robot ├── telemetry_service │ └── test_telemetry_report.robot ├── test_xit.robot └── update_service │ ├── test_bmc_image_switch.robot │ ├── test_firmware_inventory.robot │ ├── test_firmware_property.robot │ ├── test_firmware_tftp_upload_image.robot │ ├── test_redfish_bmc_code_update.robot │ ├── test_redfish_host_code_update.robot │ ├── test_redfish_image_upload.robot │ └── test_redfish_signed_image_update.robot ├── requirements.txt ├── requirements_optional.txt ├── security ├── test_bmc_connections.robot ├── test_bmc_expire_password.robot ├── test_bmc_network_security.robot ├── test_bmc_ssh_security.robot ├── test_bmcweb_security.robot ├── test_slp.robot └── test_ssl.robot ├── systest ├── collection │ ├── bmc_collect_esels.robot │ ├── bmc_collect_sensors.robot │ └── bmc_collect_vpd_and_hw_status.robot ├── gpu_stress_test.robot ├── htx_hardbootme_test.robot ├── htx_softbootme_test.robot ├── network_stability_test.robot ├── proc_freq_check.robot ├── test_bmc_poll_errors.robot └── test_boot_acceptance.robot ├── templates ├── bash_simple_template ├── pgm_template.py ├── pgm_template.robot ├── pgm_template.tcl ├── python_pgm_template └── test_openbmc_setup.robot ├── test_lists ├── BMC_WEB_CI ├── CT_basic_run ├── HW_CI ├── HW_CI_DEV ├── HW_CI_NETWORK ├── QEMU_CI ├── WEBUI_CI ├── skip_test_palmetto ├── skip_test_witherspoon └── witherspoon │ ├── regression_bucket_master │ ├── skip_inband_ipmi │ └── skip_oob_ipmi ├── tools ├── cleanup_bmc.robot ├── convert_ip_to_dummy ├── ct_metrics │ └── gen_csv_results.py ├── factory_reset_bmc.robot ├── generate_argumentfile.sh ├── generate_test_document ├── github_issues_to_csv ├── myffdc.robot ├── robot_custom_rules.py ├── robot_standards ├── sensors_dbus_list.sh └── update_mac.robot ├── tox.ini └── xcat ├── __init__.robot ├── test_power_operation.robot ├── test_xcat_group.robot └── test_xcat_inventory.robot /.flake8-ignore: -------------------------------------------------------------------------------- 1 | bin/auto_status_file.py 2 | bin/event_notification_util.py 3 | bin/generate_inventory 4 | bin/generate_testsuite_info.py 5 | bin/obmc_ser_num 6 | bin/plug_ins/Auto_reboot/cp_master 7 | bin/plug_ins/FFDC/cp_ffdc_check 8 | bin/plug_ins/Soft_errors/cp_post_boot 9 | bin/plug_ins/Stop/cp_stop_check 10 | bin/print_ffdc_functions 11 | bin/process_plug_in_packages.py 12 | bin/prop_call.py 13 | bin/validate_plug_ins.py 14 | bin/websocket_monitor.py 15 | data/Witherspoon.py 16 | data/ipmi_variable.py 17 | data/platform_variables.py 18 | ffdc/ffdc_collector.py 19 | ffdc/lib/ssh_utility.py 20 | ffdc/plugins/redfish.py 21 | gui/lib/utils_get_version.py 22 | lib/bmc_network_utils.py 23 | lib/bmc_redfish.py 24 | lib/bmc_redfish_utils.py 25 | lib/boot_data.py 26 | lib/disable_warning_urllib.py 27 | lib/external_intf/management_console_utils.py 28 | lib/func_args.py 29 | lib/gen_arg.py 30 | lib/gen_call_robot.py 31 | lib/gen_cmd.py 32 | lib/gen_plug_in.py 33 | lib/gen_plug_in_utils.py 34 | lib/gen_print.py 35 | lib/gen_robot_plug_in.py 36 | lib/gen_robot_ssh.py 37 | lib/gen_valid.py 38 | lib/ipmi_utils.py 39 | lib/obmc_boot_test.py 40 | lib/openbmc_ffdc.py 41 | lib/openbmc_ffdc_list.py 42 | lib/pldm_utils.py 43 | lib/pythonutil.py 44 | lib/redfish_request.py 45 | lib/state.py 46 | lib/tftp_update_utils.py 47 | lib/utilities.py 48 | lib/utils_files.py 49 | lib/var_funcs.py 50 | templates/python_pgm_template 51 | tools/ct_metrics/gen_csv_results.py 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | /log.html 3 | /output.xml 4 | /report.html 5 | /.idea/ 6 | /.tox/ 7 | /tools/argument_file.txt 8 | /logsdir/ 9 | /logs 10 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | MD001: false 3 | MD003: false 4 | MD004: false 5 | MD007: false 6 | MD010: false 7 | MD012: false 8 | MD013: false 9 | MD014: false 10 | MD022: false 11 | MD025: false 12 | MD026: false 13 | MD029: false 14 | MD030: false 15 | MD031: false 16 | MD032: false 17 | MD033: false 18 | MD034: false 19 | MD036: false 20 | MD037: false 21 | MD038: false 22 | MD040: false 23 | MD041: false 24 | -------------------------------------------------------------------------------- /.shellcheck-ignore: -------------------------------------------------------------------------------- 1 | bin/gen_list.sh 2 | bin/gen_setup.sh 3 | bin/jenkins_funcs.sh 4 | bin/plug_ins/Mem_tracker/memcheck.sh 5 | bin/run_robot_pgm_jenk.sh 6 | bin/select_version 7 | templates/bash_simple_template 8 | tools/convert_ip_to_dummy 9 | tools/generate_argumentfile.sh 10 | tools/generate_test_document 11 | tools/ras/probe_cpus.sh 12 | tools/ras/probe_cpus.sh 13 | tools/ras/scom_addr_p9.sh 14 | tools/sensors_dbus_list.sh 15 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | # OWNERS 2 | # ------ 3 | # 4 | # The OWNERS file maintains the list of individuals responsible for various 5 | # parts of this repository, including code review and approval. We use the 6 | # Gerrit 'owners' plugin, which consumes this file, along with some extra 7 | # keywords for our own purposes and tooling. 8 | # 9 | # For details on the configuration used by 'owners' see: 10 | # https://gerrit.googlesource.com/plugins/owners/+/refs/heads/master/owners/src/main/resources/Documentation/config.md 11 | # 12 | # An OWNERS file must be in the root of a repository but may also be present 13 | # in any subdirectory. The contents of the subdirectory OWNERS file are 14 | # combined with parent directories unless 'inherit: false' is set. 15 | # 16 | # The owners file is YAML and has [up to] 4 top-level keywords. 17 | # * owners: A list of individuals who have approval authority on the 18 | # repository. 19 | # 20 | # * reviewers: A list of individuals who have requested review notification 21 | # on the repository. 22 | # 23 | # * matchers: A list of specific file/path matchers for granular 'owners' and 24 | # 'reviewers'. See 'owners' plugin documentation. 25 | # 26 | # * openbmc: A list of openbmc-specific meta-data about owners and reviewers. 27 | # - name: preferred name of the individual. 28 | # - email: preferred email address of the individual. 29 | # - discord: Discord nickname of the individual. 30 | # 31 | # It is expected that these 4 sections will be listed in the order above and 32 | # data within them will be kept sorted. 33 | 34 | owners: 35 | - gkeishin@gmail.com 36 | 37 | reviewers: 38 | - anusha.dathatri@gmail.com 39 | - sridevra@in.ibm.com 40 | 41 | matchers: 42 | 43 | openbmc: 44 | - name: George Keishing 45 | email: gkeishin@gmail.com 46 | discord: gkeishin 47 | - name: Anusha Dathatri 48 | email: anusha.dathatri@gmail.com 49 | discord: adathatr3861 50 | - name: Sridevi Ramesh 51 | email: sridevra@in.ibm.com 52 | discord: srideviramesh 53 | -------------------------------------------------------------------------------- /bin/event_notification_util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | See help text for details. 5 | """ 6 | 7 | import sys 8 | 9 | save_dir_path = sys.path.pop(0) 10 | 11 | modules = ["gen_arg", "gen_print", "gen_valid", "event_notification"] 12 | for module in modules: 13 | exec("from " + module + " import *") 14 | 15 | sys.path.insert(0, save_dir_path) 16 | 17 | parser = argparse.ArgumentParser( 18 | usage="%(prog)s [OPTIONS]", 19 | description="%(prog)s will subscribe and receive event notifications when " 20 | + "properties change for the given dbus path.", 21 | formatter_class=argparse.ArgumentDefaultsHelpFormatter, 22 | prefix_chars="-+", 23 | ) 24 | parser.add_argument( 25 | "--host", 26 | default="", 27 | help="The host name or IP of the system to subscribe to.", 28 | ) 29 | parser.add_argument( 30 | "--username", default="root", help="The username for the host system." 31 | ) 32 | parser.add_argument( 33 | "--password", default="", help="The password for the host system." 34 | ) 35 | parser.add_argument( 36 | "--dbus_path", 37 | default="", 38 | help='The path to be monitored (e.g. "/xyz/openbmc_project/sensors").', 39 | ) 40 | parser.add_argument( 41 | "--enable_trace", 42 | choices=[0, 1], 43 | default=0, 44 | help="Indicates that trace needs to be enabled.", 45 | ) 46 | 47 | 48 | # Populate stock_list with options we want. 49 | stock_list = [("test_mode", 0), ("quiet", 0), ("debug", 0)] 50 | 51 | 52 | def main(): 53 | gen_setup() 54 | my_event = event_notification(host, username, password) 55 | event_notifications = my_event.subscribe(dbus_path, enable_trace) 56 | print_var(event_notifications, fmt=[no_header(), strip_brackets()]) 57 | 58 | 59 | main() 60 | -------------------------------------------------------------------------------- /bin/gen_setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Universal bash program setup functions. 4 | 5 | # Example usage: 6 | 7 | # Source files to get required functions. 8 | # source_files="gen_setup.sh" 9 | # source_file_paths=$(type -p ${source_files}) 10 | # for file_path in ${source_file_paths} ; do source ${file_path} ; done 11 | 12 | # Turn on extended globbing. 13 | shopt -s extglob 14 | 15 | 16 | function get_pgm_path_info() { 17 | local program_path_var="${1:-program_path}" ; shift 18 | local program_name_var="${1:-program_name}" ; shift 19 | local program_dir_path_var="${1:-program_dir_path}" ; shift 20 | local follow_links="${1:-0}" ; shift 21 | 22 | # Determine the program path, name and dir path and assign them to the variables indicated by the caller. 23 | 24 | # Description of argument(s): 25 | # program_path_var The name of the variable to receive the program path. 26 | # program_name_var The name of the variable to receive the program name. 27 | # program_dir_path_var The name of the variable to receive the program dir path. 28 | # follow_links If the program running is actually a link to another file, use that file 29 | # when calculating the above values. 30 | 31 | local _spn_loc_program_path_="${0}" 32 | 33 | # The program name is the program path minus all characters up to and including the first slash. 34 | local _spn_loc_program_name_=${_spn_loc_program_path_##*/} 35 | # The program dir path is the program path minus everything from the last slash to the end of the string. 36 | local _spn_loc_program_dir_path_=${_spn_loc_program_path_%${_spn_loc_program_name_}} 37 | 38 | # If program dir path does not start with a slash then it is relative. Convert it to absolute. 39 | if [ "${_spn_loc_program_dir_path_:0:1}" != "/" ] ; then 40 | _spn_loc_program_dir_path_="$(readlink -f ${_spn_loc_program_dir_path_})/" 41 | # Re-assemble the parts into program path variable. 42 | _spn_loc_program_path_="${_spn_loc_program_dir_path_}${_spn_loc_program_name_}" 43 | fi 44 | 45 | if (( follow_links )) ; then 46 | _spn_loc_program_path_=$(readlink -f ${_spn_loc_program_path_}) 47 | # Re-calculate program_name in case it is different now. 48 | _spn_loc_program_name_=${_spn_loc_program_path_##*/} 49 | fi 50 | 51 | # Set caller's variables. 52 | cmd_buf="${program_path_var}=\"\${_spn_loc_program_path_}\" ; ${program_name_var}=\"\${_spn_loc_program_name_}\" ; ${program_dir_path_var}=\"\${_spn_loc_program_dir_path_}\"" 53 | eval "${cmd_buf}" 54 | 55 | } 56 | -------------------------------------------------------------------------------- /bin/plug_ins/Auto_reboot/cp_cleanup: -------------------------------------------------------------------------------- 1 | cp_master -------------------------------------------------------------------------------- /bin/plug_ins/Auto_reboot/cp_post_reboot: -------------------------------------------------------------------------------- 1 | cp_master -------------------------------------------------------------------------------- /bin/plug_ins/Auto_reboot/cp_pre_boot: -------------------------------------------------------------------------------- 1 | cp_master -------------------------------------------------------------------------------- /bin/plug_ins/Auto_reboot/cp_setup: -------------------------------------------------------------------------------- 1 | cp_master -------------------------------------------------------------------------------- /bin/plug_ins/Auto_reboot/integrated: -------------------------------------------------------------------------------- 1 | # The presence of this file tells our software that this plug-in is 2 | # integrated. In other words, the user can't choose to unselect it. 3 | -------------------------------------------------------------------------------- /bin/plug_ins/Auto_reboot/parm_def: -------------------------------------------------------------------------------- 1 | # Indicates whether auto_boot should be disabled. 2 | disable=boolean 3 | -------------------------------------------------------------------------------- /bin/plug_ins/Auto_reboot/supports_obmc: -------------------------------------------------------------------------------- 1 | # The presence of this file tells programs like validate_plug_ins.py that 2 | # this plug-in supports OBMC. 3 | -------------------------------------------------------------------------------- /bin/plug_ins/FFDC/parm_def: -------------------------------------------------------------------------------- 1 | # A command to be run to determine whether ffdc should be collected. If the command returns non-zero, FFDC 2 | # should be collected. 3 | command=string 4 | -------------------------------------------------------------------------------- /bin/plug_ins/FFDC/supports_obmc: -------------------------------------------------------------------------------- 1 | # The presence of this file tells autogui that this plug-in supports Open BMC. 2 | -------------------------------------------------------------------------------- /bin/plug_ins/Soft_errors/supports_obmc: -------------------------------------------------------------------------------- 1 | # The presence of this file tells autogui that this plug-in supports Open BMC. 2 | -------------------------------------------------------------------------------- /bin/plug_ins/Stop/parm_def: -------------------------------------------------------------------------------- 1 | # "command" may contain a bash command string to be run to determine whether the test program should be stopped. If the command returns non-zero, the test program should be stopped. 2 | command=string 3 | # "rest_fail" indicates that the Stop plug-in should fail if REST commands to the BMC are failing. 4 | rest_fail=boolean 5 | # "esel_stop_file_path" may contain the path to a file with specifications for which eSELs warrant stopping the test run. See esel_stop_check help text for details. 6 | esel_stop_file_path=string 7 | # "pel_stop_file_path" may contain the path to a file with specifications for which PELs warrant stopping the test run. 8 | pel_stop_file_path=string 9 | # Indicates that the test should be stopped when the Verify_hardware plug-in fails its analysis. 10 | verify_hardware_fail=boolean 11 | -------------------------------------------------------------------------------- /bin/plug_ins/Stop/supports_obmc: -------------------------------------------------------------------------------- 1 | # The presence of this file tells obmc_boot_test that this plug-in supports Open BMC. 2 | -------------------------------------------------------------------------------- /bin/print_ffdc_functions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | See help text for details. 5 | """ 6 | 7 | import sys 8 | 9 | save_path_0 = sys.path[0] 10 | del sys.path[0] 11 | 12 | from gen_arg import * # NOQA 13 | from gen_print import * # NOQA 14 | from gen_valid import * # NOQA 15 | from openbmc_ffdc_list import * # NOQA 16 | 17 | # Restore sys.path[0]. 18 | sys.path.insert(0, save_path_0) 19 | 20 | # Set exit_on_error for gen_valid functions. 21 | set_exit_on_error(True) 22 | 23 | parser = argparse.ArgumentParser( 24 | usage="%(prog)s [OPTIONS]", 25 | description=( 26 | "%(prog)s will print a colon-delimited list of all valid OBMC FFDC" 27 | " functions.\n\nExample:" 28 | ) 29 | + "\n\n\nDump Log:FFDC Generic Report:Get Request FFDC:SEL Log:BMC" 30 | " Specific Files:Sys Inventory Files:Core Files:OS FFDC:Dump Files", 31 | formatter_class=argparse.RawDescriptionHelpFormatter, 32 | prefix_chars="-+", 33 | ) 34 | 35 | # Populate stock_list with options we want. 36 | stock_list = [("test_mode", 0), ("quiet", 1), ("debug", 0)] 37 | 38 | 39 | def exit_function(signal_number=0, frame=None): 40 | r""" 41 | Execute whenever the program ends normally or with the signals that we catch (i.e. TERM, INT). 42 | """ 43 | 44 | dprint_executing() 45 | dprint_var(signal_number) 46 | 47 | qprint_pgm_footer() 48 | 49 | 50 | def signal_handler(signal_number, frame): 51 | r""" 52 | Handle signals. Without a function to catch a SIGTERM or SIGINT, our program would terminate immediately 53 | with return code 143 and without calling our exit_function. 54 | """ 55 | 56 | # Our convention is to set up exit_function with atexit.register() so there is no need to explicitly 57 | # call exit_function from here. 58 | 59 | dprint_executing() 60 | 61 | # Calling exit prevents us from returning to the code that was running when we received the signal. 62 | exit(0) 63 | 64 | 65 | def validate_parms(): 66 | r""" 67 | Validate program parameters, etc. 68 | """ 69 | 70 | gen_post_validation(exit_function, signal_handler) 71 | 72 | 73 | def main(): 74 | gen_get_options(parser, stock_list) 75 | 76 | validate_parms() 77 | 78 | qprint_pgm_header() 79 | 80 | my_openbmc_ffdc_list = openbmc_ffdc_list() 81 | ffdc_function_list = my_openbmc_ffdc_list.get_ffdc_method_desc("BMC LOGS") 82 | # Convert from list to colon-delimited string. 83 | ffdc_function_list = ":".join(ffdc_function_list) 84 | print(ffdc_function_list) 85 | 86 | 87 | main() 88 | -------------------------------------------------------------------------------- /bin/python: -------------------------------------------------------------------------------- 1 | select_version -------------------------------------------------------------------------------- /bin/robot: -------------------------------------------------------------------------------- 1 | select_version -------------------------------------------------------------------------------- /bin/run_robot_pgm_jenk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run an obmc test robot program in a docker environment. 4 | 5 | # This program is to be run from a Jenkins job such as 'Run-Robot-Program'. 6 | # This program expects the Jenkins job to provide several parameter values 7 | # as environment variables. This includes but is not limited to the 8 | # following: 9 | # WORKSPACE 10 | # robot_file_path 11 | # git_dir_path 12 | # post_clone_command 13 | # openbmc_host 14 | # openbmc_username 15 | # openbmc_password 16 | # additional_parms 17 | 18 | # Source other bash files containing required functions. 19 | source_files="jenkins_funcs.sh" 20 | pathlist=$(/usr/bin/which $source_files) || exit 1 21 | for filepath in $pathlist ; do source $filepath || exit 1 ; done 22 | 23 | # Fail if an unset variable is accessed. 24 | set -u 25 | 26 | # Assign default values. 27 | WORKSPACE="${WORKSPACE:-${HOME}}" 28 | git_dir_path="${git_dir_path:-${WORKSPACE}}" 29 | 30 | # Follow the convention of ensuring that dir paths end with slash. 31 | WORKSPACE="${WORKSPACE%/}/" 32 | git_dir_path="${git_dir_path%/}/" 33 | 34 | 35 | function mainf() { 36 | 37 | # Delete leftover output from prior runs. 38 | rm -f ${WORKSPACE}*.html ${WORKSPACE}*.xml || return 1 39 | process_git "${git_dir_path}" "${post_clone_command-}" || return 1 40 | process_docker "${git_dir_path}" || return 1 41 | 42 | if [ -z "${robot_file_path-}" ] ; then 43 | echo "robot_file_path is blank so no there is no need to continue." 44 | return 45 | fi 46 | 47 | run_docker_robot "${robot_file_path}" || return 1 48 | 49 | } 50 | 51 | 52 | # Main 53 | 54 | mainf "${@}" 55 | rc="${?}" 56 | exit "${rc}" 57 | -------------------------------------------------------------------------------- /data/applytime_table.json: -------------------------------------------------------------------------------- 1 | { 2 | "BMC image": { 3 | "OnReset": "Redfish OBMC Reboot (off)", 4 | "Immediate": "Wait For Reboot start_boot_seconds=${state['epoch_seconds']}" 5 | }, 6 | "BMC update": { 7 | "OnReset": "Redfish OBMC Reboot (off)", 8 | "Immediate": "Wait For Reboot start_boot_seconds=${state['epoch_seconds']}" 9 | }, 10 | "Host image": { 11 | "OnReset": "RF SYS GracefulRestart", 12 | "Immediate": "Wait State os_running_match_state 10 mins" 13 | }, 14 | "Host update": { 15 | "OnReset": "RF SYS GracefulRestart", 16 | "Immediate": "Wait State os_running_match_state 10 mins" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /data/boot_lists/All: -------------------------------------------------------------------------------- 1 | REST Power On 2 | REST Power On (mfg) 3 | Redfish Power On 4 | Redfish Power On (mfg) 5 | IPMI Power On 6 | IPMI Power On (mfg) 7 | Istep Power On 8 | Istep Power On (mfg) 9 | REST Power Off 10 | REST Power Off (mfg) 11 | Redfish Power Off 12 | Redfish Power Off (mfg) 13 | REST Hard Power Off 14 | REST Hard Power Off (mfg) 15 | Redfish Hard Power Off 16 | Redfish Hard Power Off (mfg) 17 | IPMI Power Off 18 | IPMI Power Off (mfg) 19 | IPMI Power Soft 20 | IPMI Power Soft (mfg) 21 | Host Power Off 22 | Host Power Off (mfg) 23 | APOR 24 | APOR (mfg) 25 | OBMC Reboot (run) 26 | OBMC Reboot (run) (mfg) 27 | REST OBMC Reboot (run) 28 | REST OBMC Reboot (run) (mfg) 29 | Redfish OBMC Reboot (run) 30 | Redfish OBMC Reboot (run) (mfg) 31 | OBMC Reboot (off) 32 | OBMC Reboot (off) (mfg) 33 | REST OBMC Reboot (off) 34 | REST OBMC Reboot (off) (mfg) 35 | Redfish OBMC Reboot (off) 36 | Redfish OBMC Reboot (off) (mfg) 37 | PDU AC Cycle (run) 38 | PDU AC Cycle (run) (mfg) 39 | PDU AC Cycle (off) 40 | PDU AC Cycle (off) (mfg) 41 | IPMI MC Reset Warm (run) 42 | IPMI MC Reset Warm (run) (mfg) 43 | IPMI MC Reset Warm (off) 44 | IPMI MC Reset Warm (off) (mfg) 45 | IPMI MC Reset Cold (off) 46 | IPMI MC Reset Cold (off) (mfg) 47 | IPMI MC Reset Cold (run) 48 | IPMI MC Reset Cold (run) (mfg) 49 | IPMI Std MC Reset Warm (off) 50 | IPMI Std MC Reset Warm (off) (mfg) 51 | IPMI Std MC Reset Warm (run) 52 | IPMI Std MC Reset Warm (run) (mfg) 53 | IPMI Std MC Reset Cold (off) 54 | IPMI Std MC Reset Cold (off) (mfg) 55 | IPMI Std MC Reset Cold (run) 56 | IPMI Std MC Reset Cold (run) (mfg) 57 | IPMI Power Cycle 58 | IPMI Power Cycle (mfg) 59 | IPMI Power Reset 60 | IPMI Power Reset (mfg) 61 | Auto Reboot 62 | Auto Reboot (mfg) 63 | Host initd Reset 64 | Host initd Reset (mfg) 65 | Host Reboot 66 | Host Reboot (mfg) 67 | RF SYS GracefulRestart 68 | RF SYS GracefulRestart (mfg) 69 | RF SYS ForceRestart 70 | Tool Initd MP Reboot 71 | Tool Initd MP Reboot (mfg) 72 | pflash 73 | Out of Band Code Update 74 | OS Code Update 75 | OPAL TI 76 | -------------------------------------------------------------------------------- /data/boot_lists/Code_update: -------------------------------------------------------------------------------- 1 | pflash 2 | Out of Band Code Update 3 | OS Code Update 4 | -------------------------------------------------------------------------------- /data/boot_lists/Manufacturing: -------------------------------------------------------------------------------- 1 | REST Power On (mfg) 2 | Redfish Power On (mfg) 3 | IPMI Power On (mfg) 4 | Istep Power On (mfg) 5 | REST Power Off (mfg) 6 | Redfish Power Off (mfg) 7 | REST Hard Power Off (mfg) 8 | Redfish Hard Power Off (mfg) 9 | IPMI Power Off (mfg) 10 | IPMI Power Soft (mfg) 11 | Host Power Off (mfg) 12 | APOR (mfg) 13 | OBMC Reboot (run) (mfg) 14 | REST OBMC Reboot (run) (mfg) 15 | Redfish OBMC Reboot (run) (mfg) 16 | OBMC Reboot (off) (mfg) 17 | REST OBMC Reboot (off) (mfg) 18 | Redfish OBMC Reboot (off) (mfg) 19 | PDU AC Cycle (run) (mfg) 20 | PDU AC Cycle (off) (mfg) 21 | IPMI MC Reset Warm (run) (mfg) 22 | IPMI MC Reset Warm (off) (mfg) 23 | IPMI MC Reset Cold (off) (mfg) 24 | IPMI MC Reset Cold (run) (mfg) 25 | IPMI Std MC Reset Warm (off) (mfg) 26 | IPMI Std MC Reset Warm (run) (mfg) 27 | IPMI Std MC Reset Cold (off) (mfg) 28 | IPMI Std MC Reset Cold (run) (mfg) 29 | IPMI Power Cycle (mfg) 30 | IPMI Power Reset (mfg) 31 | Auto Reboot (mfg) 32 | Host initd Reset (mfg) 33 | Host Reboot (mfg) 34 | RF SYS GracefulRestart (mfg) 35 | RF SYS ForceRestart (mfg) 36 | Tool Initd MP Reboot (mfg) 37 | -------------------------------------------------------------------------------- /data/boot_lists/OBMC_reboot: -------------------------------------------------------------------------------- 1 | APOR 2 | APOR (mfg) 3 | OBMC Reboot (run) 4 | OBMC Reboot (run) (mfg) 5 | REST OBMC Reboot (run) 6 | REST OBMC Reboot (run) (mfg) 7 | Redfish OBMC Reboot (run) 8 | Redfish OBMC Reboot (run) (mfg) 9 | OBMC Reboot (off) 10 | OBMC Reboot (off) (mfg) 11 | REST OBMC Reboot (off) 12 | REST OBMC Reboot (off) (mfg) 13 | Redfish OBMC Reboot (off) 14 | Redfish OBMC Reboot (off) (mfg) 15 | PDU AC Cycle (run) 16 | PDU AC Cycle (run) (mfg) 17 | PDU AC Cycle (off) 18 | PDU AC Cycle (off) (mfg) 19 | IPMI MC Reset Warm (run) 20 | IPMI MC Reset Warm (run) (mfg) 21 | IPMI MC Reset Warm (off) 22 | IPMI MC Reset Warm (off) (mfg) 23 | IPMI MC Reset Cold (off) 24 | IPMI MC Reset Cold (off) (mfg) 25 | IPMI MC Reset Cold (run) 26 | IPMI MC Reset Cold (run) (mfg) 27 | IPMI Std MC Reset Warm (off) 28 | IPMI Std MC Reset Warm (off) (mfg) 29 | IPMI Std MC Reset Warm (run) 30 | IPMI Std MC Reset Warm (run) (mfg) 31 | IPMI Std MC Reset Cold (off) 32 | IPMI Std MC Reset Cold (off) (mfg) 33 | IPMI Std MC Reset Cold (run) 34 | IPMI Std MC Reset Cold (run) (mfg) 35 | Host initd Reset 36 | Host initd Reset (mfg) 37 | -------------------------------------------------------------------------------- /data/boot_lists/OS_reboot: -------------------------------------------------------------------------------- 1 | IPMI MC Reset Warm 2 | IPMI MC Reset Warm (mfg) 3 | IPMI Power Cycle 4 | IPMI Power Cycle (mfg) 5 | IPMI Power Reset 6 | IPMI Power Reset (mfg) 7 | Auto Reboot 8 | Auto Reboot (mfg) 9 | Host Reboot 10 | Host Reboot (mfg) 11 | RF SYS GracefulRestart 12 | RF SYS GracefulRestart (mfg) 13 | RF SYS ForceRestart 14 | OPAL TI 15 | -------------------------------------------------------------------------------- /data/boot_lists/PDU_reboot: -------------------------------------------------------------------------------- 1 | APOR 2 | APOR (mfg) 3 | PDU AC Cycle (run) 4 | PDU AC Cycle (run) (mfg) 5 | PDU AC Cycle (off) 6 | PDU AC Cycle (off) (mfg) 7 | -------------------------------------------------------------------------------- /data/boot_lists/Power_off: -------------------------------------------------------------------------------- 1 | REST Power Off 2 | REST Power Off (mfg) 3 | Redfish Power Off 4 | Redfish Power Off (mfg) 5 | REST Hard Power Off 6 | REST Hard Power Off (mfg) 7 | Redfish Hard Power Off 8 | Redfish Hard Power Off (mfg) 9 | IPMI Power Off 10 | IPMI Power Off (mfg) 11 | IPMI Power Soft 12 | IPMI Power Soft (mfg) 13 | Host Power Off 14 | Host Power Off (mfg) 15 | -------------------------------------------------------------------------------- /data/boot_lists/Power_on: -------------------------------------------------------------------------------- 1 | REST Power On 2 | REST Power On (mfg) 3 | Redfish Power On 4 | Redfish Power On (mfg) 5 | IPMI Power On 6 | IPMI Power On (mfg) 7 | Istep Power On 8 | Istep Power On (mfg) 9 | -------------------------------------------------------------------------------- /data/dcmi_raw_cmd_table.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | DCMI raw commands table: 5 | 6 | - Define DCMI interface index, commands and expected output. 7 | 8 | """ 9 | 10 | DCMI_RAW_CMD = { 11 | # Interface name 12 | "DCMI": { 13 | "MANAGEMENT_CONTROLLER_IDENTIFIER_STRING": { 14 | "GET": "0x2c 0x09 0xdc 0x00 0x10", 15 | "SET": "0x2c 0x0a 0xdc 0x00", 16 | }, 17 | "GET_TEMPERATURE_READING": [ 18 | # raw command, inlet temp entity ID, CPU temp entity ID, Baseboard temp entity ID 19 | "0x2c 0x10 0xdc 0x01", 20 | "0x40", 21 | "0x41", 22 | "0x42", 23 | ], 24 | "Asset_Tag": [ 25 | # raw command for get asset tag 26 | "0x2c 0x06 0xdc 0x00", 27 | # raw command for set asset tag 28 | "0x2c 0x08 0xdc 0x00", 29 | ], 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /data/inventory.py: -------------------------------------------------------------------------------- 1 | inventory_dict = { 2 | "core": ["PrettyName", "Present", "Functional"], 3 | "fan": ["PrettyName", "Present", "MeetsMinimumShipLevel", "Functional"], 4 | "fan_wc": ["PrettyName", "Present", "MeetsMinimumShipLevel"], 5 | "fru": [ 6 | "PrettyName", 7 | "Present", 8 | "PartNumber", 9 | "SerialNumber", 10 | "Manufacturer", 11 | "BuildDate", 12 | "Model", 13 | "Version", 14 | "FieldReplaceable", 15 | "Cached", 16 | "Functional", 17 | ], 18 | "gpu": ["PrettyName", "Present", "FieldReplaceable", "Functional"], 19 | } 20 | -------------------------------------------------------------------------------- /data/ipmi_rest_fru_field_map.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | IPMI REST FRU field mapping: 5 | - Define IPMI-REST FRU data fields mapping for different components. 6 | e.g. board_mfg field in IPMI is mapped to Manufacturer field in REST. 7 | """ 8 | 9 | # TODO: Disabling board_mfg FRU field as logic needs to be added to test it. 10 | ipmi_rest_fru_field_map = { 11 | "cpu": { 12 | # "board_mfg_date": "BuildDate", 13 | "board_mfg": "Manufacturer", 14 | "board_product": "PrettyName", 15 | "board_serial": "SerialNumber", 16 | "board_part_number": "PartNumber", 17 | }, 18 | "system": { 19 | "chassis_part_number": "Model", 20 | "chassis_serial": "SerialNumber", 21 | }, 22 | "motherboard": { 23 | "board_mfg": "Manufacturer", 24 | "board_product": "PrettyName", 25 | "board_serial": "SerialNumber", 26 | "board_part_number": "PartNumber", 27 | }, 28 | "dimm": { 29 | "product_manufacturer": "Manufacturer", 30 | "product_name": "PrettyName", 31 | "product_part_number": "Model", 32 | "product_version": "Version", 33 | "product_serial": "SerialNumber", 34 | }, 35 | "fan": {"product_name": "PrettyName"}, 36 | "bmc": { 37 | # "board_mfg_date": "BuildDate", 38 | "board_mfg": "Manufacturer", 39 | "board_product": "PrettyName", 40 | "board_serial": "SerialNumber", 41 | "board_part_number": "PartNumber", 42 | }, 43 | "powersupply": { 44 | # "board_mfg_date": "BuildDate", 45 | "board_product": "PrettyName", 46 | "board_serial": "SerialNumber", 47 | "board_part_number": "PartNumber", 48 | }, 49 | "gv100card": { 50 | # "board_mfg_date": "BuildDate", 51 | }, 52 | } 53 | -------------------------------------------------------------------------------- /data/ipmi_variable.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | Contains channel-related constants. 5 | """ 6 | 7 | medium_type_ipmi_conf_map = { 8 | "reserved": "reserved", 9 | "IPMB (I2C)": "ipmb", 10 | "ICMB v1.0": "icmb-v1.0", 11 | "ICMB v0.9": "icmb-v0.9", 12 | "802.3 LAN": "lan-802.3", 13 | "Serial/Modem": "serial", 14 | "Other LAN": "other-lan", 15 | "PCI SMBus": "pci-smbus", 16 | "SMBus v1.0/v1.1": "smbus-v1.0", 17 | "SMBus v2.0": "smbus-v2.0", 18 | "USB 1.x": "usb-1x", 19 | "USB 2.x": "usb-2x", 20 | "System Interface": "system-interface", 21 | } 22 | 23 | 24 | protocol_type_ipmi_conf_map = { 25 | "reserved": "na", 26 | "IPMB-1.0": "ipmb-1.0", 27 | "ICMB-1.0": "icmb-2.0", 28 | "reserved": "reserved", 29 | "IPMI-SMBus": "ipmi-smbus", 30 | "KCS": "kcs", 31 | "SMIC": "smic", 32 | "BT-10": "bt-10", 33 | "BT-15": "bt-15", 34 | "TMode": "tmode", 35 | "OEM 1": "oem", 36 | } 37 | 38 | 39 | disabled_ipmi_conf_map = { 40 | "disabled": "True", 41 | "enabled": "False", 42 | } 43 | 44 | 45 | access_mode_ipmi_conf_map = { 46 | "disabled": "disabled", 47 | "pre-boot only": "pre-boot", 48 | "always available": "always_available", 49 | "shared": "shared", 50 | } 51 | -------------------------------------------------------------------------------- /data/model.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 -u 2 | import importlib.util 3 | import string as string 4 | 5 | from robot.libraries.BuiltIn import BuiltIn 6 | 7 | 8 | def load_source(name, module_path): 9 | spec = importlib.util.spec_from_file_location(name, module_path) 10 | module = importlib.util.module_from_spec(spec) 11 | spec.loader.exec_module(module) 12 | return module 13 | 14 | 15 | def get_sensor(module_name, value): 16 | m = load_source("module.name", module_name) 17 | 18 | for i in m.ID_LOOKUP["SENSOR"]: 19 | if m.ID_LOOKUP["SENSOR"][i] == value: 20 | return i 21 | 22 | return 0xFF 23 | 24 | 25 | def get_inventory_sensor(module_name, value): 26 | m = load_source("module.name", module_name) 27 | 28 | value = string.replace(value, m.INVENTORY_ROOT, "") 29 | 30 | for i in m.ID_LOOKUP["SENSOR"]: 31 | if m.ID_LOOKUP["SENSOR"][i] == value: 32 | return i 33 | 34 | return 0xFF 35 | 36 | 37 | def get_inventory_list(module_name): 38 | inventory_list = [] 39 | m = load_source("module.name", module_name) 40 | 41 | for i in m.ID_LOOKUP["FRU"]: 42 | s = m.ID_LOOKUP["FRU"][i] 43 | s = s.replace("", m.INVENTORY_ROOT) 44 | inventory_list.append(s) 45 | 46 | return inventory_list 47 | 48 | 49 | def get_inventory_fru_type_list(module_name, fru_type): 50 | inventory_list = [] 51 | m = load_source("module.name", module_name) 52 | 53 | for i in m.FRU_INSTANCES.keys(): 54 | if m.FRU_INSTANCES[i]["fru_type"] == fru_type: 55 | s = i.replace("", m.INVENTORY_ROOT) 56 | inventory_list.append(s) 57 | 58 | return inventory_list 59 | 60 | 61 | def call_keyword(keyword): 62 | return BuiltIn().run_keyword(keyword) 63 | 64 | 65 | def get_FRU_component_name_list(module_name): 66 | name_list = [] 67 | m = load_source("module.name", module_name) 68 | 69 | for name in m.FRU_COMPONENT_NAME: 70 | name_list.append(name) 71 | print(name) 72 | 73 | return name_list 74 | 75 | 76 | def get_ipmi_rest_fru_field_map(module_name): 77 | m = load_source("module.name", module_name) 78 | 79 | ipmi_rest_fru_field_map = dict.copy(m.ipmi_rest_fru_field_map) 80 | 81 | return ipmi_rest_fru_field_map 82 | -------------------------------------------------------------------------------- /data/oem/nuvoton/olympus.json: -------------------------------------------------------------------------------- 1 | { 2 | "npcm7xx": { 3 | "cpld": { 4 | "fw1": "2A01.svf", 5 | "fw1ver": "00 00 2a 01", 6 | "fw2": "2A02.svf", 7 | "fw2ver": "00 00 2a 02", 8 | "readid": "readid.svf", 9 | "readusercode": "read_usercode.svf" 10 | }, 11 | "jtag_dev": "/dev/jtag0", 12 | "power_cycle_cmd": "/usr/sbin/i2cset -f -y 8 0x11 0xd9" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/openbmc_redfish_interop_profile.json: -------------------------------------------------------------------------------- 1 | { 2 | "SchemaDefinition": "RedfishInteroperabilityProfile.v1_0_0", 3 | "ProfileName": "OpenBMC_Redfish_interop_profile", 4 | "ProfileVersion": "0.0.1", 5 | "Purpose": "A minimally viable profile describes the requirements for openBMC.", 6 | "OwningEntity": "OpenBMC", 7 | "ContactInfo": "openbmc@lists.ozlabs.org", 8 | "Resources": { 9 | "ChassisCollection": { 10 | "Purpose": "Every implementation must have at least 1 chassis.", 11 | "PropertyRequirements": { 12 | "Members": { 13 | "MinCount": 1 14 | } 15 | } 16 | }, 17 | "ComputerSystemCollection": { 18 | "Purpose": "Every implementation must have at least 1 computer system.", 19 | "PropertyRequirements": { 20 | "Members": { 21 | "MinCount": 1 22 | } 23 | } 24 | }, 25 | "ComputerSystem": { 26 | "MinVersion": "1.1.0", 27 | "Purpose": "Computer system with basic properties.", 28 | "PropertyRequirements": { 29 | "Memory": {}, 30 | "Processors": {} 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /data/pel_variables.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | Contains PEL related constants. 5 | """ 6 | 7 | PEL_DETAILS = { 8 | "CreatorID": "BMC", 9 | "CompID": "0x1000", 10 | "Subsystem": "Platform Firmware", 11 | "Message": "This is a test error", 12 | "SRC": "BD8D1002", 13 | "Sev": "Unrecoverable Error", 14 | } 15 | 16 | ERROR_LOG_CREATE_BASE_CMD = ( 17 | "busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging " 18 | " xyz.openbmc_project.Logging.Create Create ssa{ss} " 19 | ) 20 | 21 | CMD_INTERNAL_FAILURE = ( 22 | ERROR_LOG_CREATE_BASE_CMD 23 | + "xyz.openbmc_project.Common.Error.InternalFailure " 24 | " xyz.openbmc_project.Logging.Entry.Level.Error 0" 25 | ) 26 | 27 | CMD_FRU_CALLOUT = ( 28 | ERROR_LOG_CREATE_BASE_CMD 29 | + "xyz.openbmc_project.Sensor.Device.Error.ReadFailure " 30 | ' xyz.openbmc_project.Logging.Entry.Level.Error 2 "TIMEOUT_IN_MSEC" "5"' 31 | ' "CALLOUT_INVENTORY_PATH" ' 32 | ' "/xyz/openbmc_project/inventory/system/chassis/motherboard"' 33 | ) 34 | 35 | CMD_PROCEDURAL_SYMBOLIC_FRU_CALLOUT = ( 36 | ERROR_LOG_CREATE_BASE_CMD + "org.open_power.Logging.Error.TestError1 " 37 | " xyz.openbmc_project.Logging.Entry.Level.Error 0" 38 | ) 39 | 40 | CMD_INFORMATIONAL_ERROR = ( 41 | ERROR_LOG_CREATE_BASE_CMD 42 | + "xyz.openbmc_project.Common.Error.TestError2 " 43 | " xyz.openbmc_project.Logging.Entry.Level.Informational 0" 44 | ) 45 | 46 | CMD_INVENTORY_PREFIX = ( 47 | "busctl get-property xyz.openbmc_project.Inventory.Manager " 48 | " /xyz/openbmc_project/inventory/system/chassis/motherboard" 49 | ) 50 | 51 | CMD_UNRECOVERABLE_ERROR = ( 52 | ERROR_LOG_CREATE_BASE_CMD + "org.open_power.Logging.Error.TestError1 " 53 | " xyz.openbmc_project.Logging.Entry.Level.Error 0" 54 | ) 55 | 56 | CMD_PREDICTIVE_ERROR = ( 57 | ERROR_LOG_CREATE_BASE_CMD 58 | + "xyz.openbmc_project.Sensor.Threshold.Error.TemperatureWarningLow " 59 | " xyz.openbmc_project.Logging.Entry.Level.Warning 0" 60 | ) 61 | 62 | CMD_UNRECOVERABLE_HOST_ERROR = ( 63 | ERROR_LOG_CREATE_BASE_CMD + "xyz.openbmc_project.Host.Error.Event " 64 | " xyz.openbmc_project.Logging.Entry.Level.Error 1 RAWPEL" 65 | " /tmp/FILE_NBMC_UNRECOVERABLE" 66 | ) 67 | 68 | CMD_INFORMATIONAL_HOST_ERROR = ( 69 | ERROR_LOG_CREATE_BASE_CMD + "xyz.openbmc_project.Host.Error.Event " 70 | " xyz.openbmc_project.Logging.Entry.Level.Error 1 RAWPEL" 71 | " /tmp/FILE_HOST_INFORMATIONAL" 72 | ) 73 | -------------------------------------------------------------------------------- /data/platform_variables.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 -u 2 | 3 | r""" 4 | Define methods to import platform specific files. 5 | """ 6 | 7 | import importlib 8 | import string 9 | import sys 10 | 11 | from robot.libraries.BuiltIn import BuiltIn 12 | 13 | 14 | def get_service_restart_policy_services(module_name): 15 | r""" 16 | Gets the service list that gives in the respective platform specific file. 17 | """ 18 | m = importlib.import_module(module_name) 19 | service_restart_policy_services = dict.copy(m.SERVICES) 20 | 21 | return service_restart_policy_services 22 | -------------------------------------------------------------------------------- /data/sensor_dbus.json: -------------------------------------------------------------------------------- 1 | { 2 | "model_1": [ 3 | "/xyz/openbmc_project/sensors/humidity/Relative_Humidity", 4 | "/xyz/openbmc_project/sensors/pressure/Station_Pressure", 5 | "/xyz/openbmc_project/sensors/temperature/Ambient_0_Temp", 6 | "/xyz/openbmc_project/sensors/temperature/Ambient_1_Temp", 7 | "/xyz/openbmc_project/sensors/temperature/Ambient_2_Temp", 8 | "/xyz/openbmc_project/sensors/voltage/Battery_Voltage", 9 | "/xyz/openbmc_project/sensors/altitude/Altitude", 10 | "/xyz/openbmc_project/sensors/temperature/Ambient_Virtual_Temp" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /data/task_state.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": "This is a generic possible redfish standard task states.", 3 | "TaskStarting": { 4 | "TaskState": "Starting", 5 | "TaskStatus": "OK" 6 | }, 7 | "TaskRunning": { 8 | "TaskState": "Running", 9 | "TaskStatus": "OK" 10 | }, 11 | "TaskCompleted": { 12 | "TaskState": "Completed", 13 | "TaskStatus": "OK" 14 | }, 15 | "TaskException": { 16 | "TaskState": "Exception", 17 | "TaskStatus": "Warning" 18 | }, 19 | "TaskService": { 20 | "CompletedTaskOverWritePolicy": { 21 | "AllowedValues": ["Manual", "Oldest"] 22 | }, 23 | "Status": { 24 | "Health": "OK", 25 | "HealthRollup": "OK", 26 | "State": "Enabled" 27 | } 28 | }, 29 | "Task": { 30 | "TaskState": { 31 | "AllowedValues": [ 32 | "New", 33 | "Starting", 34 | "Running", 35 | "Suspended", 36 | "Interrupted", 37 | "Pending", 38 | "Stopping", 39 | "Completed", 40 | "Killed", 41 | "Exception", 42 | "Service", 43 | "Cancelling", 44 | "Cancelled" 45 | ], 46 | "AllowedCompletionTaskState": [ 47 | "Cancelled", 48 | "Completed", 49 | "Exception" 50 | ] 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /data/vpd_variables.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | Contains VPD related constants. 5 | """ 6 | 7 | VPD_DETAILS = { 8 | "/system/chassis/motherboard": { 9 | "type": "xyz.openbmc_project.Inventory.Item.Board.Motherboard" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/code_standards_check.md: -------------------------------------------------------------------------------- 1 | ### To check common code misspellings, syntax and standard checks. 2 | 3 | **Requirement Python 3.x and above** 4 | 5 | It is recommended to run these tools against the code before pushing to gerrit. 6 | It helps catches those silly mistake earlier before the review. 7 | 8 | ### 1. codespell 9 | 10 | Project [codespell](https://github.com/codespell-project/codespell) designed 11 | primarily for checking misspelled words in source code 12 | 13 | ``` 14 | $ pip install codespell 15 | ``` 16 | 17 | Example: 18 | 19 | ``` 20 | $ codespell templates/test_openbmc_setup.robot 21 | templates/test_openbmc_setup.robot:13: setings ==> settings 22 | ``` 23 | 24 | ### 2. robotframework-lint 25 | 26 | Project [robotframework-lint](https://pypi.org/project/robotframework-lint/) for 27 | static analysis for robot framework plain text files. 28 | 29 | ``` 30 | $ pip install –upgrade robotframework-lint 31 | ``` 32 | 33 | Example: 34 | 35 | ``` 36 | $ rflint redfish/service_root/test_service_root_security.robot 37 | + redfish/service_root/test_service_root_security.robot 38 | W: 19, 100: Line is too long (exceeds 100 characters) (LineTooLong) 39 | ``` 40 | 41 | You can refer a script with example as well 42 | [custom rules](https://github.com/openbmc/openbmc-test-automation/blob/master/robot_custom_rules.py) 43 | 44 | ### 3. robot tags check 45 | 46 | Project [check_robot_tags](https://github.com/generatz/check_robot_tags) Checks 47 | that Tags are equivalent to test case names or task names. 48 | 49 | Example: 50 | 51 | ``` 52 | $ git clone https://github.com/generatz/check_robot_tags 53 | $ cd check_robot_tags/ 54 | 55 | $ awk -f check_robot_tags.awk ~/openbmc-test-automation/redfish/test_xit.robot 56 | --- /home/openbmc-test-automation/redfish/test_xit.robot: 57 | Verify No BMC Dump And Application Failures In BMC 58 | Iam_different_here 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/gui_setup_reference.md: -------------------------------------------------------------------------------- 1 | ## OpenBMC GUI Test Setup Guide 2 | 3 | The base needed packages for Linux distro. 4 | 5 | - Python 3.x or latter 6 | - Robot Framework ( base framework package ) 7 | 8 | Browser specific packages: 9 | 10 | - Mozilla Firefox 11 | - Robot Framework Selenium Library 12 | - geckodriver 13 | - Robotframework xvfb 14 | - xvfbwrapper 15 | - Robot Framework AngularJS Library 16 | 17 | ## Tested On Linux 18 | 19 | - RHEL 20 | - Ubuntu 21 | 22 | Last tested packages versions: 23 | 24 | ``` 25 | Python 3.12 26 | Selenium 4.8.2 27 | Mozilla Firefox 112.0.2 28 | Robot Framework 7.2.2 29 | robotframework-seleniumlibrary 6.0.0 30 | geckodriver 0.32.2 31 | robotframework-xvfb 1.2.2 32 | xvfbwrapper 0.2.9 33 | webdriver-manager 4.0.2 34 | ``` 35 | 36 | ## Installation Setup Guide 37 | 38 | - Python Installation: Please follow the documented procedure available. 39 | 40 | - Firefox Installation: Please follow the documented procedure available. 41 | 42 | - geckodriver installation: Please follow the documented procedure available. 43 | [Firefox Geckodriver](https://github.com/mozilla/geckodriver/releases) 44 | 45 | The recommended installation method is using pip: 46 | 47 | ``` 48 | pip install --upgrade robotframework 49 | pip install --upgrade robotframework-seleniumlibrary 50 | pip install --upgrade xvfbwrapper 51 | pip install --upgrade robotframework-xvfb 52 | pip install --upgrade robotframework-angularjs 53 | ``` 54 | 55 | ## Geckodriver Supported Platforms 56 | 57 | Mapping between geckodriver releases, and required versions of Selenium and 58 | Firefox: 59 | [Geckodriver Supported platforms](https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html#supported-platforms) 60 | -------------------------------------------------------------------------------- /docs/openbmc_test_architecture.md: -------------------------------------------------------------------------------- 1 | ### OpenBMC Test Architecture Model 2 | 3 | ### OpenBMC Supported Interfaces 4 | 5 | ``` 6 | 7 | --------- 8 | | OpenBMC | 9 | --------- 10 | | 11 | ----------------------------------------------- 12 | | | | 13 | --------- ------------- ------ 14 | | Redfish | | Legacy REST | | IPMI | 15 | --------- ------------- ------ 16 | | | 17 | ----------------------- 18 | | 19 | ------------- 20 | | BMC Web GUI | 21 | ------------- 22 | 23 | ``` 24 | 25 | NOTE: Legacy REST will be deprecated at some point and therefore no longer 26 | supported. 27 | 28 | ### OpenBMC Test Method Supports 29 | 30 | ``` 31 | ---------- 32 | | Test BMC | 33 | ---------- 34 | | 35 | ----------------------------------------------------------- 36 | | | | 37 | ----------- ----------------- ----------- 38 | | Boot Test | | Functional Test | | Host Test | 39 | ----------- ----------------- ------------ 40 | | | | 41 | ****************** ***************************** ******************** 42 | | Interfaces: | | Interfaces: | | Interfaces: | 43 | | - REST/IPMI | | - REST/IPMI | | - REST/Tools | 44 | | - Redfish | | - GUI/Redfish | | - Redfish | 45 | | Power on | | Minimal Boot Test | | HTX boot runs | 46 | | Power off | | Interfaces Functions | | Host IO/OS test | 47 | | BMC/Host reset | | System Functionality | | System RAS | 48 | ****************** ***************************** ******************** 49 | 50 | ``` 51 | 52 | NOTE: Legacy REST will be deprecated at some point and therefore no longer 53 | supported. 54 | -------------------------------------------------------------------------------- /extended/__init__.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Set metadata for test suite. 3 | 4 | Library SSHLibrary 5 | Resource ../lib/connection_client.robot 6 | Resource ../lib/rest_client.robot 7 | Resource ../lib/utils.robot 8 | Resource ../lib/code_update_utils.robot 9 | 10 | Suite Setup System Driver Data 11 | 12 | *** Keywords *** 13 | 14 | System Driver Data 15 | [Documentation] System driver information. 16 | Open Connection And Log In 17 | Log BMC Driver Details 18 | ${software}= Get Host Software Objects Details 19 | Log ${software} 20 | ${bmc_model}= Get BMC System Model 21 | Log BMC Model=${bmc_model} 22 | 23 | Log BMC Driver Details 24 | [Documentation] Get BMC driver details and log. 25 | 26 | ${output} ${stderr}= Execute Command grep ^VERSION_ID= /etc/os-release 27 | ... return_stderr=True 28 | Should Be Empty ${stderr} 29 | Log ${output} 30 | 31 | -------------------------------------------------------------------------------- /extended/factory_reset.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This program performs Factory data reset. 3 | 4 | Resource ../lib/ipmi_client.robot 5 | Resource ../lib/utils.robot 6 | Resource ../lib/connection_client.robot 7 | Resource ../lib/serial_connection/serial_console_client.robot 8 | Library OperatingSystem 9 | 10 | Suite Setup Validate Setup 11 | Suite Teardown Close All Connections 12 | 13 | Test Tags Factory_Reset 14 | 15 | *** Test Cases *** 16 | 17 | Verify Factory Reset 18 | [Documentation] Factory reset the system and verify if BMC is online. 19 | [Tags] Verify_Factory_Reset 20 | 21 | # Factory reset erases user config settings which includes IP, netmask 22 | # gateway and route. Before running this test we are checking all these 23 | # settings and checking whether ping works with BMC host. 24 | # If factory reset is successful, ping to BMC host should fail as 25 | # IP address is erased and comes up with zero_conf. 26 | 27 | Erase All Settings 28 | ${status}= Run Keyword And Return Status Ping Host ${OPENBMC_HOST} 29 | Should Be Equal ${status} False msg=Factory reset failed. 30 | 31 | Revert to Initial Setup And Verify 32 | [Documentation] Revert to old setup. 33 | [Tags] Revert_to_Initial_Setup_And_Verify 34 | 35 | # This test case restores old settings Viz IP address, netmask, gateway 36 | # and route. Restoring is done through serial port console. 37 | # If reverting to initial setup is successful, ping to BMC 38 | # host should pass. 39 | 40 | Configure Initial Settings 41 | Ping Host ${OPENBMC_HOST} 42 | 43 | *** Keywords *** 44 | 45 | Validate Setup 46 | [Documentation] Validate setup. 47 | 48 | Open Connection And Log In 49 | 50 | # Check whether gateway IP is reachable. 51 | Ping Host ${GW_IP} 52 | Should Not Be Empty ${NET_MASK} msg=Netmask not provided. 53 | 54 | # Check whether serial console IP is reachable and responding 55 | # to telnet command. 56 | Open Telnet Connection to BMC Serial Console 57 | 58 | Erase All Settings 59 | [Documentation] Factory reset the system. 60 | 61 | Run Dbus IPMI Raw Command 0x32 0xBA 00 00 62 | Run Dbus IPMI Raw Command 0x32 0x66 63 | -------------------------------------------------------------------------------- /extended/obmc_boot_test.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Do random repeated boots based on the state of the BMC machine. 3 | 4 | Resource obmc_boot_test_resource.robot 5 | 6 | 7 | *** Test Cases *** 8 | 9 | General Boot Testing 10 | [Documentation] Performs repeated boot tests. 11 | [Tags] General_Boot_Testing 12 | [Teardown] Test Teardown 13 | 14 | OBMC Boot Test 15 | -------------------------------------------------------------------------------- /extended/run_keyword.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Run the caller's keyword string. 3 | 4 | # Description of parameters: 5 | # keyword_string The keyword string to be run by this program. If this 6 | # keyword string contains " ; " anywhere, it will be taken to 7 | # be multiple keyword strings (see example below). Each 8 | # keywrod may also include a variable assignment. Example: 9 | # ${my_var}= My Keyword 10 | # lib_file_path The path to a library or resource needed to run the keywords. 11 | # This may contain a colon-delimited list of library/resource 12 | # paths. 13 | # test_mode This means that this program should go through all the 14 | # motions but not actually do anything substantial. 15 | # debug If this parameter is set to "1", this program will print 16 | # additional debug information. 17 | # quiet If this parameter is set to "1", this program will print 18 | # only essential information, i.e. it will not echo parameters, 19 | # echo commands, print the total run time, etc. 20 | 21 | # Example calls: 22 | # cd $HOME/git/openbmc-test-automation 23 | # export PYTHONPATH=${HOME}/git/openbmc-test-automation/lib/ 24 | 25 | # robot --outputdir=/tmp -v OPENBMC_HOST:barp01 -v 'keyword_string:Log To Console Hi.' 26 | # extended/run_keyword.robot 27 | 28 | # robot --outputdir=/tmp -v OPENBMC_HOST:barp01 29 | # -v 'keyword_string:${state}= Get State quiet=${1} ; Rpvar state' 30 | # -v lib_file_path:state.py extended/run_keyword.robot 31 | 32 | # NOTE: Robot searches PYTHONPATH for libraries. 33 | Library run_keyword.py 34 | 35 | Test Tags Run_Keyword_Pgm 36 | 37 | *** Variables *** 38 | # Initialize program parameters variables. 39 | # Create parm_list containing all of our program parameters. parm_list is 40 | # used by "rqprint_pgm_header". 41 | @{parm_list} keyword_string lib_file_path test_mode quiet 42 | ... debug 43 | 44 | # Initialize each program parameter. 45 | ${keyword_string} ${EMPTY} 46 | ${lib_file_path} ${EMPTY} 47 | ${test_mode} 0 48 | ${quiet} 0 49 | ${debug} 0 50 | 51 | 52 | *** Test Cases *** 53 | Run Keyword Pgm 54 | [Documentation] Run the keyword program. 55 | Main 56 | 57 | *** Keywords *** 58 | Main 59 | [Documentation] Do main program processing. 60 | [Teardown] Program Teardown 61 | 62 | Main Py 63 | -------------------------------------------------------------------------------- /extended/test_ac_cycles.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test file corruption on hard power cycle. 4 | 5 | Resource ../lib/pdu/pdu.robot 6 | Resource ../lib/utils.robot 7 | Resource ../lib/connection_client.robot 8 | Resource ../lib/openbmc_ffdc.robot 9 | 10 | Suite Setup Open Connection And Log In 11 | Suite Teardown Close All Connections 12 | Test Teardown FFDC On Test Case Fail 13 | 14 | Test Tags AC_Cycles 15 | 16 | *** Test Cases *** 17 | 18 | Test OpenBMC Buster 19 | [Documentation] Test the OpenBMC buster. 20 | [Tags] Test_OpenBMC_Buster 21 | 22 | Validate PDU Parameters 23 | ${output}= Execute Command 24 | ... find /var/lib -type f |xargs -n 1 touch 25 | PDU Power Cycle 26 | Wait For Host To Ping ${OPENBMC_HOST} 27 | Sleep 1min 28 | 29 | # Need to re connect the session 30 | Open Connection And Log In 31 | ${stdout} ${stderr} ${rc}= Execute Command echo "hello world" 32 | ... return_stderr=True return_rc=True 33 | Should Be Equal As Integers ${rc} ${0} 34 | 35 | *** Keywords *** 36 | 37 | Validate PDU Parameters 38 | [Documentation] Validate the PDU parameters. 39 | 40 | Should Not Be Empty ${PDU_IP} 41 | Should Not Be Empty ${PDU_TYPE} 42 | Should Not Be Empty ${PDU_SLOT_NO} 43 | Should Not Be Empty ${PDU_USERNAME} 44 | Should Not Be Empty ${PDU_PASSWORD} 45 | -------------------------------------------------------------------------------- /extended/test_bmc_upload_stability.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Module to stress-test REST upload stability. 4 | ... Upload a test file to the BMC. The 5 | ... test file is approximately the size of 6 | ... a BMC flash image file. 7 | 8 | # Test Parameters: 9 | # OPENBMC_HOST The BMC host name or IP address. 10 | # LOOPS The number of times to loop the test. 11 | # Default value for LOOPS is 1. 12 | 13 | 14 | Library OperatingSystem 15 | Resource ../lib/utils.robot 16 | Resource ../lib/openbmc_ffdc.robot 17 | 18 | 19 | Test Teardown FFDC On Test Case Fail 20 | 21 | 22 | *** Variables **** 23 | 24 | ${LOOPS} ${1} 25 | ${iteration} ${0} 26 | 27 | 28 | *** Test Cases *** 29 | 30 | 31 | REST Upload Stability Test 32 | [Documentation] Execute upload stress testing. 33 | [Tags] REST_Upload_Stability_Test 34 | 35 | Repeat Keyword ${LOOPS} times Upload Test Image File To BMC 36 | 37 | 38 | *** Keywords *** 39 | 40 | 41 | Upload Test Image File To BMC 42 | [Documentation] Upload a file to BMC via REST. The uploaded file 43 | ... is 32MB, approximately the same size as a downloadable 44 | ... BMC image. 45 | [Timeout] 2m 46 | 47 | Set Test Variable ${iteration} ${iteration + 1} 48 | ${loop_count}= Catenate Starting iteration: ${iteration} 49 | Printn 50 | Rpvars loop_count 51 | 52 | # Generate data file. 53 | Run dd if=/dev/zero of=dummyfile bs=1 count=0 seek=32MB 54 | 55 | ${image_data}= OperatingSystem.Get Binary File dummyfile 56 | 57 | # Set up 'redfish' object used in POST request below. 58 | Initialize OpenBMC 59 | 60 | # Create the REST payload headers and data. 61 | ${data}= Create Dictionary data=${image_data} 62 | ${headers}= Create Dictionary Content-Type=application/octet-stream 63 | ... X-Auth-Token=${XAUTH_TOKEN} Accept=application/octet-stream 64 | Set To Dictionary ${data} headers ${headers} 65 | 66 | # Upload to BMC and check for HTTP_BAD_REQUEST. 67 | ${resp}= POST On Session redfish /upload/image &{data} 68 | Should Be Equal As Strings ${resp.status_code} ${HTTP_BAD_REQUEST} 69 | 70 | ${loop_count}= Catenate Ending iteration: ${iteration} 71 | Rpvars loop_count 72 | -------------------------------------------------------------------------------- /ffdc/README.md: -------------------------------------------------------------------------------- 1 | # CLI options for log collector 2 | 3 | ``` 4 | $ python3 collect_ffdc.py -h 5 | Usage: collect_ffdc.py [OPTIONS] 6 | 7 | Stand alone CLI to generate and collect FFDC from the selected target. 8 | 9 | Options: 10 | -r, --remote TEXT Hostname/IP of the remote host 11 | -u, --username TEXT Username of the remote host. 12 | -p, --password TEXT Password of the remote host. 13 | -port_ssh INTEGER SSH port value. [default: 22] 14 | -port_https INTEGER HTTPS port value. [default: 443] 15 | -port_ipmi INTEGER IPMI port value. [default: 623] 16 | -c, --config TEXT YAML Configuration file for log collection. [default: 17 | /openbmc-test-automation/ffdc/ffdc_config.yaml] 18 | -l, --location TEXT Location to save logs [default: /tmp] 19 | -t, --type TEXT OS type of the remote (targeting) host. OPENBMC, RHEL, 20 | UBUNTU, SLES, AIX 21 | -rp, --protocol TEXT Select protocol to communicate with remote host. 22 | [default: ALL] 23 | -e, --env_vars TEXT Environment variables e.g: {'var':value} 24 | -ec, --econfig TEXT Predefine environment variables, refer 25 | en_vars_template.yaml 26 | --log_level TEXT Log level (CRITICAL, ERROR, WARNING, INFO, DEBUG) 27 | [default: INFO] 28 | -h, --help Show this message and exit. 29 | ``` 30 | 31 | # Tools and packages dependencies 32 | 33 | ``` 34 | Python 3.6.12 or latter 35 | PyYAML 5.4.1 36 | click 8.0.1 37 | paramiko 2.7.2 38 | redfishtool 1.1.1 39 | ipmitool 1.8.18 40 | ``` 41 | -------------------------------------------------------------------------------- /ffdc/plugins/date_time_utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | This module contains functions having to do with date time filter. 5 | """ 6 | 7 | from datetime import datetime 8 | 9 | 10 | def convert_string_dateime(date_str, date_format, desired_format): 11 | r""" 12 | Convert a date time string to the desired format. 13 | 14 | This function converts a date time string to the desired format. 15 | The function takes the date_str argument, which can be a single date time 16 | string or a list of date time strings. 17 | 18 | The function also accepts date_format and desired_format arguments, which 19 | specify the input date time pattern and the desired output format, 20 | respectively. 21 | 22 | The function returns a list of date time strings in the desired format. 23 | 24 | Parameters: 25 | date_str (str or list): A date time string or a list of date time 26 | strings. 27 | date_format (str): The date time pattern of the input string(s). 28 | desired_format (str): The desired output format for the date time 29 | strings. 30 | 31 | Returns: 32 | list: A list of date time strings in the desired format. 33 | """ 34 | if isinstance(date_str, list): 35 | tmp_date = [] 36 | for date in date_str: 37 | tmp_date.append( 38 | datetime.strptime(date, date_format).strftime(desired_format) 39 | ) 40 | return tmp_date 41 | else: 42 | return datetime.strptime(date_str, date_format).strftime( 43 | desired_format 44 | ) 45 | -------------------------------------------------------------------------------- /ffdc/plugins/scp_execution.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | 4 | import os 5 | import sys 6 | 7 | # ---------Set sys.path for pluqin execution---------------------------------- 8 | # Absolute path to this plugin 9 | abs_path = os.path.abspath(os.path.dirname(sys.argv[0])) 10 | # full_path to plugins parent directory 11 | full_path = abs_path.split("plugins")[0] 12 | sys.path.append(full_path) 13 | # Walk path and append to sys.path 14 | for root, dirs, files in os.walk(full_path): 15 | for found_dir in dirs: 16 | sys.path.append(os.path.join(root, found_dir)) 17 | 18 | # ssh_utility is in ../lib 19 | from ssh_utility import SSHRemoteclient # NOQA 20 | 21 | 22 | def scp_remote_file( 23 | hostname, username, password, port_ssh, filename, local_dir_path 24 | ): 25 | r""" 26 | Copy a file from a remote host to the local host using SCP. 27 | 28 | This function copies a file from a remote host to the local host using the 29 | SCP protocol. The function takes the remote host details (hostname, 30 | username, password), the filename with its full path on the remote host, 31 | and the local directory path as arguments. 32 | 33 | The function uses wildcards to support copying multiple files if needed. 34 | 35 | Parameters: 36 | hostname (str): Name or IP address of the remote host. 37 | username (str): User on the remote host with access to files. 38 | password (str): Password for the user on the remote host. 39 | port_ssh (int): SSH/SCP port value. By default, 22. 40 | filename (str): Filename with full path on the remote host. 41 | Can contain wildcards for multiple files. 42 | local_dir_path (str): Location to store the file on the local host. 43 | 44 | Returns: 45 | None 46 | """ 47 | ssh_remoteclient = SSHRemoteclient(hostname, username, password, port_ssh) 48 | 49 | if ssh_remoteclient.ssh_remoteclient_login(): 50 | # Obtain scp connection. 51 | ssh_remoteclient.scp_connection() 52 | if ssh_remoteclient.scpclient: 53 | if isinstance(filename, list): 54 | for each_file in filename: 55 | ssh_remoteclient.scp_file_from_remote( 56 | each_file, local_dir_path 57 | ) 58 | else: 59 | ssh_remoteclient.scp_file_from_remote(filename, local_dir_path) 60 | 61 | # Close ssh/scp session 62 | if ssh_remoteclient: 63 | ssh_remoteclient.ssh_remoteclient_disconnect() 64 | -------------------------------------------------------------------------------- /ffdc/plugins/shell_execution.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess 4 | 5 | 6 | def execute_cmd(parms_string, quiet=False): 7 | r""" 8 | Execute a CLI standard tool or script with the provided command string. 9 | 10 | This function executes a provided command string using the current SHELL. 11 | The function takes the parms_string as an argument, which is expected 12 | to be a valid command to execute. 13 | 14 | The function also accepts an optional quiet parameter, which, if set to 15 | True, suppresses the output of the command. 16 | 17 | The function returns the output of the executed command as a string. 18 | 19 | Parameters: 20 | parms_string (str): The command to execute from the current SHELL. 21 | quiet (bool, optional): If True, suppresses the output of the command. 22 | Defaults to False. 23 | 24 | Returns: 25 | str: The output of the executed command as a string. 26 | """ 27 | result = subprocess.run( 28 | [parms_string], 29 | stdout=subprocess.PIPE, 30 | stderr=subprocess.PIPE, 31 | shell=True, 32 | universal_newlines=True, 33 | ) 34 | 35 | if result.stderr and not quiet: 36 | print("\n\t\tERROR with %s " % parms_string) 37 | print("\t\t" + result.stderr) 38 | 39 | return result.stdout 40 | -------------------------------------------------------------------------------- /ffdc/plugins/telnet_execution.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | 4 | import os 5 | import sys 6 | 7 | # ---------Set sys.path for pluqin execution---------------------------------- 8 | # Absolute path to this plugin 9 | abs_path = os.path.abspath(os.path.dirname(sys.argv[0])) 10 | # full_path to plugins parent directory 11 | full_path = abs_path.split("plugins")[0] 12 | sys.path.append(full_path) 13 | # Walk path and append to sys.path 14 | for root, dirs, files in os.walk(full_path): 15 | for found_dir in dirs: 16 | sys.path.append(os.path.join(root, found_dir)) 17 | 18 | from telnet_utility import TelnetRemoteclient # NOQA 19 | 20 | 21 | def telnet_execute_cmd(hostname, username, password, command, timeout=60): 22 | r""" 23 | Execute a command on the remote host using Telnet and return the output. 24 | 25 | This function executes a provided command on the remote host using Telnet. 26 | The function takes the remote host details (hostname, username, password) 27 | and the command to be executed as arguments. 28 | 29 | The function also accepts an optional timeout parameter, which specifies 30 | the time in seconds to wait for the command to complete. 31 | 32 | The function returns the output of the executed command as a string. 33 | 34 | Parameters: 35 | hostname (str): Name or IP address of the remote host. 36 | username (str): User on the remote host with access to files. 37 | password (str): Password for the user on the remote host. 38 | command (str): The command to be executed on the remote host. 39 | timeout (int, optional): The time in seconds to wait for the command 40 | to complete. Defaults to 60 seconds. 41 | 42 | Returns: 43 | str: The output of the executed command as a string. 44 | """ 45 | telnet_remoteclient = TelnetRemoteclient(hostname, username, password) 46 | result = "" 47 | if telnet_remoteclient.tn_remoteclient_login(): 48 | # result: stdout from remote host 49 | result = telnet_remoteclient.execute_command(command, timeout) 50 | 51 | # Close telnet session 52 | if telnet_remoteclient: 53 | telnet_remoteclient.tn_remoteclient_disconnect() 54 | 55 | return result 56 | -------------------------------------------------------------------------------- /ffdc/requirements.txt: -------------------------------------------------------------------------------- 1 | click 2 | logger 3 | PyYAML 4 | paramiko 5 | 6 | -------------------------------------------------------------------------------- /ffdc/templates/env_vars_template.yaml: -------------------------------------------------------------------------------- 1 | # This is config file for user who wants to load pre-define variables 2 | # to be loaded at runtime 3 | # Key value pairs, used in the main config ffdc_config.yaml file. 4 | # NOTE: 5 | # env_params is a reserved key name, don't rename. 6 | # var1, var2, var3 and so on you can add and populate as needed. 7 | env_params: 8 | var1: 1 9 | var2: 2 10 | var3: 3 11 | manager_id: "bmc" 12 | -------------------------------------------------------------------------------- /ffdc/templates/log_collector_config_template.yaml: -------------------------------------------------------------------------------- 1 | # Template example on how you can create you own customize YAML to drive the 2 | # log collection for your system 3 | # Except for COMMAND, FILES and PROTOCOL, rest depends on how you want to 4 | # name the block, sub block, commands construct and file name. 5 | 6 | MY_BLOCK: 7 | MY_LOGS: 8 | COMMANDS: 9 | - "dmesg >/tmp/dmesg.txt" 10 | FILES: 11 | - "/tmp/dmesg.txt" 12 | PROTOCOL: 13 | - "SSH" 14 | 15 | REDFISH_LOGS: 16 | COMMANDS: 17 | - redfishtool -u ${username} -p ${password} -r 18 | ${hostname}:${port_https} -S Always raw GET 19 | /redfish/v1/AccountService/Accounts 20 | FILES: 21 | - "REDFISH_bmc_user_accounts.json" 22 | PROTOCOL: 23 | - "REDFISH" 24 | 25 | IPMI_LOGS: 26 | COMMANDS: 27 | - ipmitool -I lanplus -C 17 -U ${username} -P ${password} -H -p 28 | ${port_ipmi} ${hostname} lan print 29 | FILES: 30 | - "IPMI_LAN_print.txt" 31 | PROTOCOL: 32 | - "IPMI" 33 | 34 | SHELL_LOGS: 35 | COMMANDS: 36 | - plugin: 37 | - plugin_name: plugins.ssh_execution 38 | - plugin_function: ssh_execute_cmd 39 | - plugin_args: 40 | - ${hostname} 41 | - ${username} 42 | - ${password} 43 | - cat /etc/os-release 44 | - 3 45 | - plugin_error: exit_on_error 46 | FILES: 47 | - plugin_release.txt 48 | PROTOCOL: 49 | - "SHELL" 50 | 51 | DUMP_LOGS: 52 | COMMANDS: 53 | - "ls -AX /var/lib/systemd/coredump/core.*" 54 | PROTOCOL: 55 | - "SCP" 56 | -------------------------------------------------------------------------------- /gui/__init__.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Main initialization file for the test cases contained in this 3 | ... directory and setting up the test environment variables. 4 | 5 | Resource lib/resource.robot 6 | Library lib/utils_get_version.py 7 | Suite Setup Initializing Setup 8 | Suite Teardown Init Teardown Steps 9 | 10 | *** Keywords *** 11 | Initializing Setup 12 | [Documentation] Initialize test environment. 13 | 14 | ${software_versions}= Software Versions 15 | Rprint Vars software_versions 16 | Get OpenBMC System Info 17 | Launch OpenBMC GUI Browser 18 | Login OpenBMC GUI 19 | Initial Message 20 | LogOut OpenBMC GUI 21 | 22 | Initial Message 23 | [Documentation] Display initial info about the test cases. 24 | 25 | Rpvars EXECDIR 26 | Log To Console OBMC_GUI Testing ==> [IN PROGRESS] 27 | 28 | Get OpenBMC System Info 29 | [Documentation] Display open BMC system info like system name and IP. 30 | 31 | ${OPENBMC_HOST_NAME}= Get Hostname From IP Address ${OPENBMC_HOST} 32 | Rpvars OPENBMC_HOST OPENBMC_HOST_NAME 33 | ${build_info} ${stderr} ${rc}= BMC Execute Command cat /etc/os-release 34 | ... print_output=1 35 | 36 | Init Teardown Steps 37 | [Documentation] End the test execution by closing browser. 38 | 39 | Log To Console OBMC_GUI Testing ==> [Finished] 40 | Close Browser 41 | -------------------------------------------------------------------------------- /gui/gui_test/gui_header/test_gui_header.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI header. 4 | 5 | Resource ../../lib/gui_resource.robot 6 | 7 | Test Setup Launch Browser And Login GUI 8 | Suite Teardown Close Browser 9 | 10 | Test Tags GUI_Header 11 | 12 | *** Variables *** 13 | 14 | ${xpath_header_text} //*[contains(@class, "navbar-text")] 15 | 16 | *** Test Cases *** 17 | 18 | Verify GUI Header Text 19 | [Documentation] Verify text in GUI header. 20 | [Tags] Verify_GUI_Header_Text 21 | 22 | ${gui_header_text}= Get Text ${xpath_header_text} 23 | Should Contain ${gui_header_text} BMC System Management 24 | 25 | 26 | Verify Server Health Button 27 | [Documentation] Verify event log page on clicking health button. 28 | [Tags] Verify_Server_Health_Button 29 | 30 | Wait Until Element Is Visible ${xpath_server_health_header} 31 | Click Element ${xpath_server_health_header} 32 | Wait Until Page Contains Element ${xpath_event_logs_heading} timeout=15s 33 | 34 | 35 | Verify Server Power Button 36 | [Documentation] Verify server power operations page on clicking power button. 37 | [Tags] Verify_Server_Power_Button 38 | 39 | Wait Until Element Is Visible ${xpath_server_power_header} 40 | Click Element ${xpath_server_power_header} 41 | Wait Until Page Contains Server power operations 42 | 43 | 44 | Verify GUI Logout 45 | [Documentation] Verify OpenBMC GUI logout. 46 | [Tags] Verify_GUI_Logout 47 | 48 | Click Element ${xpath_root_button_menu} 49 | Click Element ${xpath_logout_button} 50 | Wait Until Page Contains Element ${xpath_login_button} timeout=15s 51 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 52 | 53 | 54 | Verify System Serial And Model Number In GUI Header Page 55 | [Documentation] Verify system serial and model number in GUI header page. 56 | [Tags] Verify_System_Serial_And_Model_Number_In_GUI_Header_Page 57 | [Setup] Run Keywords Launch Browser And Login GUI AND Redfish Login 58 | [Teardown] Run Keywords Close Browser AND Redfish.Logout 59 | 60 | # Model. 61 | ${redfish_model_number}= Redfish.Get Attribute ${SYSTEM_BASE_URI} Model 62 | Element Should Be Visible //*[@data-test-id='appHeader-container-overview'] 63 | ... /following-sibling::*/*[text()='${redfish_model_number}'] 64 | 65 | # Serial Number. 66 | ${redfish_serial_number}= Redfish.Get Attribute ${SYSTEM_BASE_URI} SerialNumber 67 | Element Should Be Visible //*[@data-test-id='appHeader-container-overview'] 68 | ... /following-sibling::*/*[text()='${redfish_serial_number}'] 69 | -------------------------------------------------------------------------------- /gui/gui_test/hardware_status_menu/test_inventory_and_leds_sub_menu.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Inventory and LEDs" sub-menu of "Hardware status" menu. 4 | 5 | Resource ../../lib/gui_resource.robot 6 | 7 | Suite Setup Suite Setup Execution 8 | Suite Teardown Close Browser 9 | 10 | Test Tags Inventory_And_Leds_Sub_Menu 11 | 12 | *** Variables *** 13 | 14 | ${xpath_inventory_and_leds_heading} //h1[text()="Inventory and LEDs"] 15 | ${xpath_page_loading_progress_bar} //*[@aria-label='Page loading progress bar'] 16 | 17 | *** Test Cases *** 18 | 19 | Verify Navigation To Inventory And LEDs Page 20 | [Documentation] Verify navigation to inventory page. 21 | [Tags] Verify_Navigation_To_Inventory_And_LEDs_Page 22 | 23 | Page Should Contain Element ${xpath_inventory_and_leds_heading} 24 | 25 | 26 | Verify Components On Inventory And LEDs Page 27 | [Documentation] Verify whether required components are displayed under inventory and LEDs page. 28 | [Tags] Verify_Components_On_Inventory_And_LEDs_Page 29 | [Template] Page Should Contain 30 | 31 | # Check all the hardware component are available. 32 | 33 | System indicators 34 | Chassis 35 | System 36 | BMC manager 37 | DIMM slot 38 | Fans 39 | Power supplies 40 | Processors 41 | Assemblies 42 | PCIe slots 43 | Fabric Adapters 44 | 45 | 46 | *** Keywords *** 47 | 48 | Suite Setup Execution 49 | [Documentation] Do test suite setup tasks. 50 | 51 | Launch Browser And Login GUI 52 | Click Element ${xpath_hardware_status_menu} 53 | Click Element ${xpath_inventory_and_leds_sub_menu} 54 | Wait Until Keyword Succeeds 30 sec 5 sec Location Should Contain inventory 55 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 56 | -------------------------------------------------------------------------------- /gui/gui_test/logs_and_services_menu/test_progress_logs_sub_menu.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Progress logs" sub-menu. 4 | 5 | Resource ../../lib/gui_resource.robot 6 | Resource ../../../lib/logging_utils.robot 7 | 8 | Suite Setup Suite Setup Execution 9 | Suite Teardown Close Browser 10 | 11 | Test Tags Progress_Logs_Sub_Menu 12 | 13 | *** Variables *** 14 | 15 | ${xpath_progress_logs_heading} //h1[text()="Progress logs"] 16 | ${xpath_search_logs_input} //*[contains(@id,"searchInput")] 17 | ${xpath_from_date_input} //*[@id="input-from-date"] 18 | ${xpath_to_date_input} //*[@id="input-to-date"] 19 | 20 | 21 | *** Test Cases *** 22 | 23 | Verify Navigation To Progress Logs Page 24 | [Documentation] Verify navigation to progress logs page. 25 | [Tags] Verify_Navigation_To_Progress_Logs_Page 26 | 27 | Page Should Contain Element ${xpath_progress_logs_heading} 28 | 29 | 30 | Verify Existence Of All Input Boxes In Progress Logs Page 31 | [Documentation] Verify existence of all input boxes in progress logs page. 32 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_Progress_Logs_Page 33 | 34 | # Search logs. 35 | Page Should Contain Element ${xpath_search_logs_input} 36 | 37 | # Date filter. 38 | Page Should Contain Element ${xpath_from_date_input} limit=1 39 | Page Should Contain Element ${xpath_to_date_input} limit=1 40 | 41 | 42 | Verify Existence Of All Sections In Progress Logs Page 43 | [Documentation] Verify existence of all sections in Progress Logs page. 44 | [Tags] Verify_Existence_Of_All_Sections_In_Progress_Logs_Page 45 | 46 | Page Should Contain Progress logs 47 | 48 | 49 | Verify Existence Of All Fields In Progress Logs Page 50 | [Documentation] Verify existence of all fields in progress Logs page. 51 | [Tags] Verify_Existence_Of_All_Fields_In_Progress_Logs_Page 52 | [Template] Page Should Contain 53 | 54 | # Expected parameters 55 | Created 56 | Time stamp offset 57 | Boot count 58 | Code 59 | 60 | 61 | *** Keywords *** 62 | 63 | Suite Setup Execution 64 | [Documentation] Do suite setup tasks. 65 | 66 | Launch Browser And Login GUI 67 | Click Element ${xpath_logs_menu} 68 | Click Element ${xpath_progress_logs_sub_menu} 69 | Wait Until Keyword Succeeds 30 sec 5 sec Location Should Contain post-code-logs 70 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 71 | -------------------------------------------------------------------------------- /gui/gui_test/notices_menu/test_notices_menu.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test suite for Open BMC GUI "Notices" menu. 4 | 5 | Resource ../../lib/gui_resource.robot 6 | 7 | Suite Setup Suite Setup Execution 8 | Suite Teardown Close Browser 9 | 10 | Test Tags Notices_Menu 11 | 12 | *** Variables *** 13 | 14 | ${xpath_notice_menu} //*[@data-test-id='nav-item-notices'] 15 | ${xpath_notices_header} //h1[contains(text(), "Notices")] 16 | 17 | *** Test Cases *** 18 | 19 | Verify Navigate To Notices Page 20 | [Documentation] Login to GUI and perform page navigation to 21 | ... Notices page and verify it loads successfully. 22 | [Tags] Verify_Navigate_To_Notices_Page 23 | 24 | Page Should Contain Element ${xpath_notices_header} 25 | 26 | 27 | Verify Existence Of All Licenses In Notices Page 28 | [Documentation] Verify all required licenses are available on Notices page. 29 | [Tags] Verify_Existence_Of_All_Licenses_In_Notices_Page 30 | 31 | Page Should Contain Apache License 32 | Page Should Contain Artistic License 33 | Page Should Contain BSD license 34 | Page Should Contain Boost Software License 35 | Page Should Contain Bzip license 36 | Page Should Contain GNU GENERAL PUBLIC LICENSE 37 | Page Should Contain GCC RUNTIME LIBRARY EXCEPTION 38 | Page Should Contain ISC License 39 | Page Should Contain GNU LIBRARY GENERAL PUBLIC LICENSE 40 | Page Should Contain GNU LESSER GENERAL PUBLIC LICENSE 41 | Page Should Contain MIT License 42 | Page Should Contain Mozilla Public License Version 43 | Page Should Contain OpenLDAP Public License 44 | Page Should Contain OpenSSL License 45 | Page Should Contain PYTHON SOFTWARE FOUNDATION LICENSE 46 | Page Should Contain zlib License 47 | 48 | 49 | *** Keywords *** 50 | 51 | Suite Setup Execution 52 | [Documentation] Do suite setup tasks. 53 | 54 | Launch Browser And Login GUI 55 | Click Element ${xpath_notice_menu} 56 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain notices 57 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 58 | -------------------------------------------------------------------------------- /gui/gui_test/operations_menu/test_host_console_sub_menu.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Host console" sub-menu of "Operations". 4 | 5 | Resource ../../lib/gui_resource.robot 6 | 7 | Suite Setup Launch Browser And Login GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | Test Tags Host_Console_Sub_Menu 12 | 13 | *** Variables *** 14 | 15 | ${xpath_open_in_new_tab_button} //button[contains(text(),'Open in new tab')] 16 | 17 | 18 | *** Test Cases *** 19 | 20 | Verify Navigation To Host Console Page 21 | [Documentation] Verify navigation to Host console page. 22 | [Tags] Verify_Navigation_To_Host_Console_Page 23 | 24 | Page Should Contain Element ${xpath_host_console_heading} 25 | 26 | 27 | Verify Existence Of All Buttons In Host Console Page 28 | [Documentation] Verify existence of all buttons in Host console page. 29 | [Tags] Verify_Existence_Of_All_Buttons_In_Host_Console_Page 30 | 31 | Page Should Contain Element ${xpath_open_in_new_tab_button} 32 | 33 | 34 | *** Keywords *** 35 | 36 | Test Setup Execution 37 | [Documentation] Do test case setup tasks. 38 | 39 | Click Element ${xpath_operations_menu} 40 | Click Element ${xpath_host_console_sub_menu} 41 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain host-console 42 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 43 | -------------------------------------------------------------------------------- /gui/gui_test/security_and_access_menu/test_sessions_sub_menu.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Sessions" sub-menu of "Security and access" menu. 4 | 5 | Resource ../../lib/gui_resource.robot 6 | 7 | Suite Setup Launch Browser And Login GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | Test Tags Sessions_Sub_Menu 12 | 13 | *** Variables *** 14 | 15 | ${xpath_sessions_heading} //h1[contains(text(),'sessions')] 16 | 17 | 18 | *** Test Cases *** 19 | 20 | Verify Navigation To Sessions Page 21 | [Documentation] Verify navigation to sessions page. 22 | [Tags] Verify_Navigation_To_Sessions_Page 23 | 24 | Page Should Contain Element ${xpath_sessions_heading} 25 | 26 | 27 | *** Keywords *** 28 | 29 | Test Setup Execution 30 | [Documentation] Do test case setup tasks. 31 | 32 | Click Element ${xpath_secuity_and_accesss_menu} 33 | Click Element ${xpath_sessions_sub_menu} 34 | Wait Until Keyword Succeeds 30 sec 5 sec Location Should Contain sessions 35 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 36 | -------------------------------------------------------------------------------- /gui/gui_test/settings_menu/test_factory_reset_sub_menu.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test suite for OpenBMC GUI "Factory reset" sub-menu of "Settings" menu. 4 | 5 | Resource ../../lib/gui_resource.robot 6 | 7 | Suite Setup Suite Setup Execution 8 | Suite Teardown Close Browser 9 | 10 | Test Tags Factory_Reset_Sub_Menu 11 | 12 | *** Variables *** 13 | 14 | ${xpath_factory_reset_heading} //h1[text()="Factory reset"] 15 | ${xpath_reset_button} //button[contains(text(),'Reset')] 16 | ${xpath_reset_server_radio_button} //*[@data-test-id='factoryReset-radio-resetBios'] 17 | ${xpath_reset_bmc_server_radio_button} //*[@data-test-id='factoryReset-radio-resetToDefaults'] 18 | 19 | 20 | *** Test Cases *** 21 | 22 | Verify Navigation To Factory Reset Page 23 | [Documentation] Verify navigation to factory reset page. 24 | [Tags] Verify_Navigation_To_Factory_Reset_Page 25 | 26 | Page Should Contain Element ${xpath_factory_reset_heading} 27 | 28 | 29 | Verify Existence Of All Sections In Factory Reset Page 30 | [Documentation] Verify existence of all sections in factory reset page. 31 | [Tags] Verify_Existence_Of_All_Sections_In_Factory_Reset_Page 32 | 33 | Page Should Contain Reset options 34 | 35 | 36 | Verify Existence Of All Buttons In Factory Reset Page 37 | [Documentation] Verify existence of all buttons in factory reset page. 38 | [Tags] Verify_Existence_Of_All_Buttons_In_Factory_Reset_Page 39 | 40 | Page Should Contain Element ${xpath_reset_button} 41 | 42 | 43 | Verify Existence Of All Radio Buttons In Factory Reset Page 44 | [Documentation] Verify existence of all radio buttons in factory reset page. 45 | [Tags] Verify_Existence_Of_All_Radio_Buttons_In_Factory_Reset_Page 46 | 47 | Page Should Contain Element ${xpath_reset_server_radio_button} 48 | Page Should Contain Element ${xpath_reset_bmc_server_radio_button} 49 | 50 | 51 | *** Keywords *** 52 | 53 | Suite Setup Execution 54 | [Documentation] Do test suite setup tasks. 55 | 56 | Launch Browser And Login GUI 57 | Click Element ${xpath_settings_menu} 58 | Click Element ${xpath_factory_reset_sub_menu} 59 | Wait Until Keyword Succeeds 30 sec 5 sec Location Should Contain factory-reset 60 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 61 | -------------------------------------------------------------------------------- /gui/gui_test/settings_menu/test_power_restore_policy_sub_menu.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Power restore policy" sub-menu of "Settings" menu. 4 | 5 | Resource ../../lib/gui_resource.robot 6 | 7 | Suite Setup Launch Browser And Login GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | Test Tags Power_Restore_Policy_Sub_Menu 12 | 13 | *** Variables *** 14 | 15 | ${xpath_power_restore_policy_heading} //h1[text()="Power restore policy"] 16 | ${xpath_AlwaysOn_radio} //input[@value='AlwaysOn'] 17 | ${xpath_AlwaysOff_radio} //input[@value='AlwaysOff'] 18 | ${xpath_LastState_radio} //input[@value='LastState'] 19 | ${xpath_save_settings_button} //button[contains(text(),'Save')] 20 | 21 | *** Test Cases *** 22 | 23 | Verify Navigation To Power Restore Policy Page 24 | [Documentation] Verify navigation to Power Restore Policy page. 25 | [Tags] Verify_Navigation_To_Power_Restore_Policy_Page 26 | 27 | Page Should Contain Element ${xpath_power_restore_policy_heading} 28 | 29 | 30 | Verify Existence Of All Sections In Power Restore Policy Page 31 | [Documentation] Verify existence of all sections in Power Restore Policy page. 32 | [Tags] Verify_Existence_Of_All_Sections_In_Power_Restore_Policy_Page 33 | 34 | Page Should Contain Power restore policies 35 | 36 | 37 | Verify Existence Of All Buttons In Power Restore Policy Page 38 | [Documentation] Verify existence of All Buttons. 39 | [Tags] Verify_Existence_Of_All_Buttons_In_Power_Restore_Policy_Page 40 | 41 | Page Should Contain Element ${xpath_AlwaysOn_radio} 42 | Page Should Contain Element ${xpath_AlwaysOff_radio} 43 | Page Should Contain Element ${xpath_LastState_radio} 44 | Page Should Contain Element ${xpath_save_settings_button} 45 | 46 | 47 | *** Keywords *** 48 | 49 | Test Setup Execution 50 | [Documentation] Do test case setup tasks. 51 | 52 | Click Element ${xpath_settings_menu} 53 | Click Element ${xpath_power_restore_policy_sub_menu} 54 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain power-restore-policy 55 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 56 | -------------------------------------------------------------------------------- /gui/lib/supporting_libs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | This is an extended user library to support Robot Selenium code. 5 | The class contains functions which the robot framework will use 6 | and import as a user-defined keyword. 7 | """ 8 | 9 | import socket 10 | 11 | 12 | class supporting_libs: 13 | def get_hostname_from_ip_address(self, ip): 14 | return socket.gethostbyaddr(ip)[0] 15 | -------------------------------------------------------------------------------- /gui/test/access_control/test_obmc_gui_certificate.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Certificate management" sub-menu of 4 | ... "Server configuration". 5 | 6 | Resource ../../lib/resource.robot 7 | 8 | Suite Setup Launch Browser And Login OpenBMC GUI 9 | Suite Teardown Close Browser 10 | Test Setup Test Setup Execution 11 | 12 | 13 | *** Variables *** 14 | 15 | ${xpath_select_certificate_management} //a[@href='#/access-control/ssl-certificates'] 16 | ${xpath_select_access_control} //*[@id="nav__top-level"]/li[5]/button 17 | ${xpath_add_certificate_button} //*[contains(text(), "Add new certificate")] 18 | 19 | *** Test Cases *** 20 | 21 | Verify Existence Of All Sections In Certificate Page 22 | [Documentation] Verify existence of all sections in certificate page. 23 | [Tags] Verify_Existence_Of_All_Sections_In_Certificate_Page 24 | 25 | Page should contain Certificate 26 | Page should contain Valid from 27 | Page should contain Valid until 28 | 29 | 30 | Verify Existence Of Add Certificate Button 31 | [Documentation] Verify existence of add certificate button. 32 | [Tags] Verify_Existence_Of_Add_Certificate_Button 33 | 34 | Page Should Contain Element ${xpath_add_certificate_button} 35 | 36 | 37 | *** Keywords *** 38 | 39 | Test Setup Execution 40 | [Documentation] Do test case setup tasks. 41 | 42 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 43 | Click Element ${xpath_select_access_control} 44 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 45 | Click Element ${xpath_select_certificate_management} 46 | Wait Until Page Contains SSL certificates 47 | -------------------------------------------------------------------------------- /gui/test/access_control/test_obmc_gui_ldap.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "LDAP" sub-menu of "Access control". 4 | 5 | Resource ../../lib/resource.robot 6 | 7 | Suite Setup Launch Browser And Login OpenBMC GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | 12 | *** Variables *** 13 | 14 | ${xpath_enable_ldap_checkbox} //*[@id='ldap-auth-label'] 15 | ${xpath_secure_ldap_checkbox} //*[@id='use-ssl'] 16 | ${xpath_openl_ldap_radio_button} //input[@id='open-ldap'] 17 | ${xpath_active_directory_radio_button} //input[@id='active-directory'] 18 | ${xpath_save_button} //button[contains(text(),'Save')] 19 | ${xpath_reset_button} //button[contains(text(),'Reset')] 20 | ${xpath_add_role_group_button} //button[@type='button']//*[contains(text(),'Add role group')] 21 | ${xpath_remove_role_groups_button} //button[@type='button']//*[contains(text(),'Remove role groups')] 22 | 23 | *** Test Cases *** 24 | 25 | Verify Existence Of All Sections In LDAP Page 26 | [Documentation] Verify existence of all sections in LDAP page. 27 | [Tags] Verify_Existence_Of_All_Sections_In_LDAP_Page 28 | 29 | Page Should Contain Settings 30 | Page Should Contain Role groups 31 | 32 | 33 | Verify Existence Of All Buttons In LDAP Page 34 | [Documentation] Verify existence of all buttons in LDAP page. 35 | [Tags] Verify_Existence_Of_All_Buttons_In_LDAP_Page 36 | 37 | # Buttons under settings section 38 | Page Should Contain Element ${xpath_openl_ldap_radio_button} 39 | Page Should Contain Element ${xpath_active_directory_radio_button} 40 | Page Should Contain Element ${xpath_save_button} 41 | Page Should Contain Element ${xpath_reset_button} 42 | 43 | # Buttons under role groups section 44 | Page Should Contain Element ${xpath_add_role_group_button} 45 | Page Should Contain Element ${xpath_remove_role_groups_button} 46 | 47 | 48 | Verify Existence Of All Checkboxes In LDAP Page 49 | [Documentation] Verify existence of all checkboxes in LDAP page. 50 | [Tags] Verify_Existence_Of_All_Checkboxes_In_LDAP_Page 51 | 52 | # Checkboxes under settings section 53 | Page Should Contain Element ${xpath_enable_ldap_checkbox} 54 | Page Should Contain Element ${xpath_secure_ldap_checkbox} 55 | 56 | 57 | *** Keywords *** 58 | 59 | Test Setup Execution 60 | [Documentation] Do test case setup tasks. 61 | 62 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 63 | Click Element ${xpath_select_access_control} 64 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 65 | Click Element ${xpath_select_ldap} 66 | Wait Until Page Contains Configure LDAP settings and manage role groups 67 | -------------------------------------------------------------------------------- /gui/test/server_config/test_obmc_gui_date_and_time_settings.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Date and time settings" sub-menu of 4 | ... "Server configuration". 5 | 6 | Resource ../../lib/resource.robot 7 | 8 | Suite Setup Launch Browser And Login OpenBMC GUI 9 | Suite Teardown Close Browser 10 | Test Setup Test Setup Execution 11 | 12 | 13 | *** Variables *** 14 | 15 | ${xpath_set_time_from_ntp} //*[@for="ntp-time"] 16 | ${xpath_add_new_ntp_server} //button[contains(text(), "Add new NTP server")] 17 | ${xpath_set_time_manually} //*[@for="manual-time"] 18 | ${xpath_set_date} //input[@type="date"] 19 | ${xpath_set_time} //input[@type="time"] 20 | ${xpath_set_time_owner} //select[@id="date-time-owner"] 21 | 22 | 23 | *** Test Cases *** 24 | 25 | Verify Existence Of All Sections In Date And Time Settings Page 26 | [Documentation] Verify existence of all sections in date and time settings 27 | ... page. 28 | [Tags] Verify_Existence_Of_All_Sections_In_Date_And_Time_Settings_Page 29 | 30 | Page Should Contain Set date and time manually or configure a Network Time 31 | ... Protocol (NTP) Server 32 | 33 | 34 | Verify Existence Of All Buttons In Date And Time Settings Page 35 | [Documentation] Verify existence of all buttons in date and time settings 36 | ... page. 37 | [Tags] Verify_Existence_Of_All_Buttons_In_Date_And_Time_Settings_Page 38 | 39 | Page Should Contain Element ${xpath_set_time_from_ntp} 40 | Page Should Contain Element ${xpath_add_new_ntp_server} 41 | Page Should Contain Element ${xpath_set_time_manually} 42 | Page Should Contain Element ${xpath_set_date} 43 | Page Should Contain Element ${xpath_set_time} 44 | Page Should Contain Element ${xpath_set_time_owner} 45 | Page Should Contain Element ${xpath_cancel_button} 46 | Page Should Contain Element ${xpath_save_setting_button} 47 | 48 | 49 | *** Keywords *** 50 | 51 | Test Setup Execution 52 | [Documentation] Do test case setup tasks. 53 | 54 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 55 | Click Element ${xpath_select_server_configuration} 56 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 57 | Click Element ${xpath_select_date_time_settings} 58 | Wait Until Page Contains Date and time settings 59 | -------------------------------------------------------------------------------- /gui/test/server_config/test_obmc_gui_snmp_settings.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "SNMP settings" sub-menu of "Server configuration". 4 | 5 | Resource ../../lib/resource.robot 6 | 7 | Suite Setup Launch Browser And Login OpenBMC GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | 12 | *** Variables *** 13 | 14 | ${xpath_add_manager_button} //button[text()[contains(.,"Add manager")]] 15 | 16 | 17 | *** Test Cases *** 18 | 19 | Verify Existence Of All Sections In SNMP Page 20 | [Documentation] Verify existence of all sections in SNMP page. 21 | [Tags] Verify_Existence_Of_All_Sections_In_SNMP_Page 22 | 23 | Page Should Contain Managers 24 | 25 | 26 | Verify Existence Of All Buttons In SNMP Page 27 | [Documentation] Verify existence of all buttons in SNMP page. 28 | [Tags] Verify_Existence_Of_All_Buttons_In_SNMP_Page 29 | 30 | Page Should Contain Element ${xpath_add_manager_button} 31 | Page Should Contain Element ${xpath_save_setting_button} 32 | Page Should Contain Element ${xpath_cancel_button} 33 | 34 | 35 | *** Keywords *** 36 | 37 | Test Setup Execution 38 | [Documentation] Do test case setup tasks. 39 | 40 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 41 | Click Element ${xpath_select_server_configuration} 42 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 43 | Click Element ${xpath_select_snmp_settings} 44 | Wait Until Page Contains SNMP settings 45 | -------------------------------------------------------------------------------- /gui/test/server_control/test_obmc_gui_manage_power_usage.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Manage power usage" sub-menu of "Server control". 4 | 5 | Resource ../../lib/resource.robot 6 | 7 | Suite Setup Launch Browser And Login OpenBMC GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | 12 | *** Variables *** 13 | 14 | ${xpath_power_cap_toggle_button} //*[@class="toggle-container"] 15 | 16 | 17 | *** Test Cases *** 18 | 19 | Verify Existence Of All Sections In Manage Power Usage Page 20 | [Documentation] Verify existence of all sections in manage power usage page. 21 | [Tags] Verify_Existence_Of_All_Sections_In_Manage_Power_Usage_Page 22 | 23 | Page Should Contain Power information 24 | Page Should Contain Server power cap setting 25 | 26 | 27 | Verify Existence Of All Buttons In Manage Power Usage Page 28 | [Documentation] Verify existence of all buttons in manage power usage page. 29 | [Tags] Verify_Existence_Of_All_Buttons_In_Manage_Power_Usage_Page 30 | 31 | Page Should Contain Element ${xpath_power_cap_toggle_button} 32 | Page Should Contain Element ${xpath_save_setting_button} 33 | Page Should Contain Element ${xpath_cancel_button} 34 | 35 | 36 | *** Keywords *** 37 | 38 | Test Setup Execution 39 | [Documentation] Do test case setup tasks. 40 | 41 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 42 | Click Element ${xpath_select_server_control} 43 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 44 | Click Element ${xpath_select_manage_power_usage} 45 | Wait Until Page Contains Manage Power Usage 46 | -------------------------------------------------------------------------------- /gui/test/server_control/test_obmc_gui_reboot_bmc.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Reboot BMC" sub-menu of "Server control". 4 | 5 | Resource ../../lib/resource.robot 6 | 7 | Suite Setup Launch Browser And Login OpenBMC GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | 12 | *** Variables *** 13 | 14 | ${xpath_reboot_bmc_button} //button[text()[contains(.,"Reboot BMC")]] 15 | 16 | 17 | *** Test Cases *** 18 | 19 | Verify Existence Of All Sections In Reboot BMC Page 20 | [Documentation] Verify existence of all sections in reboot BMC page. 21 | [Tags] Verify_Existence_Of_All_Sections_In_Reboot_BMC_Page 22 | 23 | Page Should Contain Current BMC boot status 24 | 25 | 26 | Verify Existence Of All Buttons In Reboot BMC Page 27 | [Documentation] Verify existence of all buttons in reboot BMC page. 28 | [Tags] Verify_Existence_Of_All_Buttons_In_Reboot_BMC_Page 29 | 30 | Page Should Contain Element ${xpath_reboot_bmc_button} 31 | 32 | 33 | *** Keywords *** 34 | 35 | Test Setup Execution 36 | [Documentation] Do test case setup tasks. 37 | 38 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 39 | Click Element ${xpath_select_server_control} 40 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 41 | Click Element ${xpath_select_reboot_bmc} 42 | Wait Until Page Contains Reboot BMC 43 | -------------------------------------------------------------------------------- /gui/test/server_control/test_obmc_gui_server_led.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Server LED" sub-menu of "Server control". 4 | 5 | Resource ../../lib/resource.robot 6 | 7 | Suite Setup Launch Browser And Login OpenBMC GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | 12 | *** Variables *** 13 | 14 | ${xpath_led_light_control} //*[@for="toggle__switch-round"] 15 | 16 | 17 | *** Test Cases *** 18 | 19 | Verify Existence Of All Sections In Server LED Page 20 | [Documentation] Verify existence of all sections in Server LED page. 21 | [Tags] Verify_Existence_Of_All_Sections_In_Server_LED_Page 22 | 23 | Page Should Contain LED light control 24 | Page Should Contain Server LED light 25 | 26 | 27 | Verify Existence Of All Buttons In Server LED Page 28 | [Documentation] Verify existence of all buttons in Server LED page. 29 | [Tags] Verify_Existence_Of_All_Buttons_In_Server_LED_Page 30 | 31 | Page Should Contain Element ${xpath_led_light_control} 32 | 33 | 34 | *** Keywords *** 35 | 36 | Test Setup Execution 37 | [Documentation] Do test case setup tasks. 38 | 39 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 40 | Click Element ${xpath_select_server_control} 41 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 42 | Click Element ${xpath_select_server_led} 43 | Wait Until Page Contains Server LED 44 | -------------------------------------------------------------------------------- /gui/test/server_control/test_obmc_gui_sol_console.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "SOL console" sub-menu of "Server control". 4 | 5 | Resource ../../lib/resource.robot 6 | 7 | Suite Setup Launch Browser And Login OpenBMC GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | 12 | *** Variables *** 13 | 14 | ${xpath_open_in_new_tab_button} //button[text()[contains(.,"Open in new tab")]] 15 | 16 | 17 | *** Test Cases *** 18 | 19 | Verify Existence Of All Sections In SOL Console Page 20 | [Documentation] Verify existence of all sections in SOL console page. 21 | [Tags] Verify_Existence_Of_All_Sections_In_SOL_Console_Page 22 | 23 | Page Should Contain Access the Serial over LAN console 24 | 25 | 26 | Verify Existence Of All Buttons In SOL Console Page 27 | [Documentation] Verify existence of all buttons in SOL console page. 28 | [Tags] Verify_Existence_Of_All_Buttons_In_SOL_Console_Page 29 | 30 | Page Should Contain Element ${xpath_open_in_new_tab_button} 31 | 32 | 33 | *** Keywords *** 34 | 35 | Test Setup Execution 36 | [Documentation] Do test case setup tasks. 37 | 38 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 39 | Click Element ${xpath_select_server_control} 40 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 41 | Click Element ${xpath_select_sol_console} 42 | Wait Until Page Contains Serial over LAN console 43 | -------------------------------------------------------------------------------- /gui/test/server_control/test_obmc_gui_virtual_media.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Virtual Media" sub-menu of "Server control". 4 | 5 | Resource ../../lib/resource.robot 6 | 7 | Suite Setup Launch Browser And Login OpenBMC GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | 12 | *** Variables *** 13 | 14 | ${xpath_start_button} //*[@class='vm__upload-start'] 15 | ${xpath_choose_file_button} //*[@class='vm__upload-choose-label'] 16 | 17 | 18 | *** Test Cases *** 19 | 20 | Verify Existence Of All Sections In Virtual Media Page 21 | [Documentation] Verify existence of all sections in virtual media page. 22 | [Tags] Verify_Existence_Of_All_Sections_In_Virtual_Media_Page 23 | 24 | Page Should Contain Virtual media device 25 | 26 | 27 | Verify Existence Of All Buttons In Virtual Media Page 28 | [Documentation] Verify existence of all buttons in virtual media page. 29 | [Tags] Verify_Existence_Of_All_Buttons_In_Virtual_Media_Page 30 | 31 | Page Should Contain Element ${xpath_start_button} 32 | Page Should Contain Element ${xpath_choose_file_button} 33 | 34 | 35 | *** Keywords *** 36 | 37 | Test Setup Execution 38 | [Documentation] Do test case setup tasks. 39 | 40 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 41 | Click Element ${xpath_select_server_control} 42 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 43 | Click Element ${xpath_select_virtual_media} 44 | Wait Until Page Contains Virtual media 45 | -------------------------------------------------------------------------------- /gui/test/server_health/test_obmc_gui_sensors.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test OpenBMC GUI "Sensors" sub-menu of "Server health". 4 | 5 | Resource ../../lib/resource.robot 6 | 7 | Suite Setup Launch Browser And Login OpenBMC GUI 8 | Suite Teardown Close Browser 9 | Test Setup Test Setup Execution 10 | 11 | *** Variables *** 12 | ${xpath_select_server_health} //*[@id="nav__top-level"]/li[2]/button 13 | ${xpath_select_sensors} //a[@href='#/server-health/sensors-overview'] 14 | ${xpath_sensors_export} //a[contains(text(), "Export")] 15 | ${xpath_sensors_search} //*[@id="content__search-input"] 16 | ${xpath_sensors_search_button} //*[@id="content__search-submit"] 17 | 18 | *** Test Cases *** 19 | Verify Select Sensors From Server Health 20 | [Documentation] Verify ability to select "Sensors" sub-menu option of 21 | ... "Server health". 22 | [Tags] Verify_Select_Sensors_From_Server_Health 23 | 24 | Wait Until Page Contains Sensors 25 | Page should contain All sensors present in the system 26 | 27 | 28 | Verify Sensors Export From Server Health Clickable 29 | [Documentation] Verify ability to export sensors from "Sensors" 30 | ... sub-menu of "Server health". 31 | [Tags] Verify_Sensors_Export_From_Server_Health_Clickable 32 | 33 | Page Should Contain Element ${xpath_sensors_export} 34 | Click Element ${xpath_sensors_export} 35 | 36 | 37 | Verify Search Text Enterable 38 | [Documentation] Verify search text input allowed from "Sensors" 39 | ... sub-menu of "Server health". 40 | [Tags] Verify_Search_Text_Enterable 41 | 42 | Page Should Contain Element ${xpath_sensors_search} 43 | Input Text ${xpath_sensors_search} Temperature 44 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 45 | Page Should Contain Element ${xpath_sensors_search_button} 46 | Set Focus To Element ${xpath_sensors_search_button} 47 | Click Element ${xpath_sensors_search_button} 48 | 49 | *** Keywords *** 50 | 51 | Test Setup Execution 52 | [Documentation] Do test case setup tasks. 53 | 54 | Click Element ${xpath_select_server_health} 55 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} 56 | Click Element ${xpath_select_sensors} 57 | 58 | -------------------------------------------------------------------------------- /ipmi/dcmi/test_dcmi_get_capabilities.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Module to test dcmi get capabilities functionality. 4 | Resource ../../lib/ipmi_client.robot 5 | 6 | Test Tags DCMI_Get_Capabilities 7 | 8 | *** Variables *** 9 | 10 | @{slave_address_list} Slave address of device: 0h (8bits)(Satellite/External controller) 11 | ... Slave address of device: 20h (BMC) 12 | 13 | *** Test Cases *** 14 | 15 | Verify Get DCMI Capabilities 16 | [Documentation] Verify get DCMI capabilities command output. 17 | [Tags] Verify_Get_DCMI_Capabilities 18 | ${cmd_output}= Run IPMI Standard Command dcmi discover 19 | 20 | @{supported_capabilities}= Create List 21 | # Supported DCMI capabilities: 22 | ... Mandatory platform capabilities 23 | ... Optional platform capabilities 24 | ... Power management available 25 | ... Managebility access capabilities 26 | ... In-band KCS channel available 27 | # Mandatory platform attributes: 28 | ... 200 SEL entries 29 | ... SEL automatic rollover is enabled 30 | # Optional Platform Attributes: 31 | ... Channel number is 0h (Primary BMC) 32 | ... Device revision is 0 33 | # Manageability Access Attributes: 34 | ... Primary LAN channel number: ${CHANNEL_NUMBER} is available 35 | ... Secondary LAN channel is not available for OOB 36 | ... No serial channel is available 37 | 38 | FOR ${capability} IN @{supported_capabilities} 39 | Run Keyword And Continue On Failure Should Contain ${cmd_output} ${capability} ignore_case=True 40 | ... msg=Supported DCMI capabilities not present. 41 | END 42 | 43 | FOR ${slave_address} IN @{slave_address_list} 44 | ${slave_address_status}= Run Keyword And Return Status 45 | ... Should Contain ${cmd_output} ${slave_address} ignore_case=True 46 | IF ${slave_address_status} == True BREAK 47 | END 48 | 49 | IF ${slave_address_status} == False 50 | Fail msg=Slave address is showing wrongly. 51 | END 52 | 53 | ${output}= Get Lines Containing String ${cmd_output} Slave address of device: 54 | ${slave_address_status_1}= Run Keyword And Return Status 55 | ... Should Be Equal ${output.strip()} ${slave_address_list[1]} ignore_case=True 56 | ${output_1}= Get Lines Containing String ${cmd_output} Channel number is 57 | IF ${slave_address_status_1} == True 58 | Should Be Equal ${output_1.strip()} ${supported_capabilities[7]} 59 | ELSE 60 | Should Match Regexp ${output.strip()} [1-9]+h 61 | END 62 | -------------------------------------------------------------------------------- /ipmi/test_ipmi_kcs.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation To Verify KCS interface. 4 | 5 | Resource ../lib/ipmi_client.robot 6 | Resource ../lib/ipmi_utils.robot 7 | Variables ../data/ipmi_raw_cmd_table.py 8 | Library ../lib/ipmi_utils.py 9 | 10 | Suite Setup Suite Setup Execution 11 | 12 | Test Tags IPMI_KCS 13 | 14 | *** Variables *** 15 | 16 | ${LOOP_COUNT} ${1} 17 | 18 | 19 | *** Test Cases *** 20 | 21 | Verify KCS interface 22 | [Documentation] Verify KCS interface. 23 | [Tags] Verify_KCS_interface 24 | 25 | Verify KCS Interface Commands 26 | 27 | 28 | Verify KCS Raw IPMI Multiple Times 29 | [Documentation] Verify KCS interface raw IPMI command for multiple times. 30 | [Tags] Verify_KCS_Raw_IPMI_Multiple_Times 31 | 32 | Repeat Keyword ${LOOP_COUNT} times Verify KCS Interface Commands 33 | 34 | 35 | *** Keywords *** 36 | 37 | Suite Setup Execution 38 | [Documentation] Do suite setup tasks. 39 | 40 | Should Not Be Empty ${OS_HOST} msg=Please provide required parameter OS_HOST 41 | Should Not Be Empty ${OS_USERNAME} msg=Please provide required parameter OS_USERNAME 42 | Should Not Be Empty ${OS_PASSWORD} msg=Please provide required parameter OS_PASSWORD 43 | -------------------------------------------------------------------------------- /ipmi/test_ipmi_lanplus.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation To Verify Lanplus interface 4 | 5 | Resource ../lib/ipmi_client.robot 6 | Resource ../lib/ipmi_utils.robot 7 | Variables ../data/ipmi_raw_cmd_table.py 8 | Library ../lib/ipmi_utils.py 9 | 10 | Test Tags IPMI_LANplus 11 | 12 | *** Variables *** 13 | 14 | ${LOOP_COUNT} ${1} 15 | 16 | 17 | *** Test Cases *** 18 | 19 | Verify Lanplus Raw IPMI Commands Multiple Times 20 | [Documentation] Verify Lanplus interface With raw IPMI command for multiple times. 21 | [Tags] Verify_Lanplus_Raw_IPMI_Commands_Multiple_Times 22 | 23 | Repeat Keyword ${LOOP_COUNT} times Verify Lanplus Interface Commands 24 | 25 | 26 | Verify Lanplus Interface 27 | [Documentation] Verify Lanplus interface. 28 | [Tags] Verify_Lanplus_Interface 29 | 30 | Verify Lanplus Interface Commands 31 | 32 | -------------------------------------------------------------------------------- /ipmi/test_ipmi_resets.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Module to test IPMI cold and warm reset functionalities. 3 | 4 | Resource ../lib/ipmi_client.robot 5 | Resource ../lib/openbmc_ffdc.robot 6 | 7 | Suite Setup Redfish.Login 8 | Suite Teardown Redfish.Logout 9 | 10 | Test Teardown FFDC On Test Case Fail 11 | 12 | Test Tags IPMI_Resets 13 | 14 | *** Variables *** 15 | 16 | # User may pass LOOP_COUNT. 17 | ${LOOP_COUNT} ${1} 18 | 19 | *** Test Cases *** 20 | 21 | Test IPMI Warm Reset 22 | [Documentation] Check IPMI warm reset and wait for BMC to become online. 23 | [Tags] Test_IPMI_Warm_Reset 24 | Repeat Keyword ${LOOP_COUNT} times IPMI MC Reset Warm (off) 25 | 26 | 27 | Test IPMI Cold Reset 28 | [Documentation] Check IPMI cold reset and wait for BMC to become online. 29 | [Tags] Test_IPMI_Cold_Reset 30 | 31 | Repeat Keyword ${LOOP_COUNT} times IPMI MC Reset Cold (run) 32 | 33 | 34 | Verify BMC Power Cycle via IPMI 35 | [Documentation] Verify IPMI power cycle command works fine. 36 | [Tags] Verify_BMC_Power_Cycle_via_IPMI 37 | 38 | Repeat Keyword ${LOOP_COUNT} times IPMI Power Cycle 39 | 40 | 41 | Verify Power Reset via IPMI 42 | [Documentation] Verify IPMI power reset command works fine. 43 | [Tags] Verify_Power_Reset_via_IPMI 44 | 45 | Repeat Keyword ${LOOP_COUNT} times IPMI Power Reset 46 | -------------------------------------------------------------------------------- /lib/bmc_cleanup.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource ../lib/utils.robot 3 | Resource ../lib/connection_client.robot 4 | Resource ../lib/boot_utils.robot 5 | 6 | *** Variables *** 7 | # User defined path to do the cleanup. 8 | ${CLEANUP_DIR_PATH} ${EMPTY} 9 | # List that holds space separated filepaths to skip from cleanup. 10 | ${SKIP_LIST} ${EMPTY} 11 | 12 | *** Keywords *** 13 | 14 | 15 | Cleanup Dir 16 | [Documentation] Remove leftover files in cleanup directory path. 17 | [Arguments] ${cleanup_dir_path}=${CLEANUP_DIR_PATH} 18 | ... ${skip_list}=${SKIP_LIST} 19 | 20 | # Description of argument(s): 21 | # cleanup_dir_path Directory path to do the cleanup. 22 | # skip_list List of files to skip from cleanup. 23 | 24 | Should Not Be Empty ${cleanup_dir_path} 25 | Should Not Be Empty ${SKIP_LIST} 26 | 27 | ${skip_list_string}= Set Variable cd ${cleanup_dir_path} 28 | FOR ${file} IN @{skip_list} 29 | ${skip_list_string}= Set Variable ${skip_list_string} && rm ${file} 30 | END 31 | 32 | ${file_count1} ${stderr} ${rc}= BMC Execute Command 33 | ... find ${cleanup_dir_path} | wc -l 34 | BMC Execute Command ${skip_list_string} 35 | 36 | ${file_count2} ${stderrt} ${rc}= BMC Execute Command 37 | ... find ${cleanup_dir_path} | wc -l 38 | Should Be True ${file_count2} < ${file_count1} 39 | # Delete the directory if it is empty. 40 | IF ${file_count2} <= 1 41 | BMC Execute Command rm -r ${cleanup_dir_path} 42 | END 43 | -------------------------------------------------------------------------------- /lib/bmc_network_security_utils.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Network security utility file. 3 | 4 | Resource ../lib/resource.robot 5 | Resource ../lib/bmc_redfish_resource.robot 6 | 7 | *** Keywords *** 8 | 9 | Send Network Packets And Get Packet Loss 10 | [Documentation] Send TCP, UDP or ICMP packets to any network device and return packet loss. 11 | [Arguments] ${host} ${num}=${count} ${packet_type}=${ICMP_PACKETS} 12 | ... ${port}=80 ${icmp_type}=${ICMP_ECHO_REQUEST} 13 | 14 | # Description of argument(s): 15 | # host The host name or IP address of the target system. 16 | # packet_type The type of packets to be sent ("tcp, "udp", "icmp"). 17 | # port Network port. 18 | # icmp_type Type of ICMP packets (e.g. 8, 13, 17, etc.). 19 | # num Number of packets to be sent. 20 | 21 | # This keyword expects host, port, type and number of packets to be sent 22 | # and rate at which packets to be sent, should be given in command line. 23 | # By default it sends 4 ICMP echo request packets at 1 packets/second. 24 | 25 | ${cmd_suffix}= Set Variable If '${packet_type}' == 'icmp' 26 | ... --icmp-type ${icmp_type} 27 | ... -p ${port} 28 | ${cmd_buf}= Set Variable --delay ${delay} ${host} -c ${num} --${packet_type} ${cmd_suffix} 29 | 30 | ${nping_result}= Nping ${cmd_buf} 31 | RETURN ${nping_result['percent_lost']} 32 | 33 | 34 | Send Network Packets With Flags And Verify Stability 35 | [Documentation] Send TCP with flags to the target. 36 | [Arguments] ${host} ${num}=${count} ${port}=${REDFISH_INTERFACE} 37 | ... ${flags}=${SYN_PACKETS} 38 | [Teardown] Verify Interface Stability ${port} 39 | 40 | # Description of argument(s): 41 | # host The host name or IP address of the target system. 42 | # packet_type The type of packets to be sent ("tcp, "udp", "icmp"). 43 | # port Network port. 44 | # flags Type of flag to be set (e.g. SYN, ACK, RST, FIN, ALL). 45 | # num Number of packets to be sent. 46 | 47 | # This keyword expects host, port, type and number of packets to be sent 48 | # and rate at which packets to be sent, should be given in command line. 49 | # By default it sends 4 ICMP echo request packets at 1 packets/second. 50 | 51 | ${cmd_suffix}= Catenate -p ${port} --flags ${flags} 52 | ${cmd_buf}= Set Variable --delay ${delay} ${host} -c ${num} --${packet_type} ${cmd_suffix} 53 | 54 | ${nping_result}= Nping ${cmd_buf} 55 | Log To Console Packets lost: ${nping_result['percent_lost']} 56 | -------------------------------------------------------------------------------- /lib/bmc_redfish_resource.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation BMC redfish resource keyword. 3 | 4 | Resource resource.robot 5 | Resource rest_response_code.robot 6 | Library bmc_redfish.py https://${OPENBMC_HOST}:${HTTPS_PORT} ${OPENBMC_USERNAME} 7 | ... ${OPENBMC_PASSWORD} AS Redfish 8 | Library bmc_redfish_utils.py AS redfish_utils 9 | Library disable_warning_urllib.py 10 | 11 | 12 | *** Keywords *** 13 | -------------------------------------------------------------------------------- /lib/code_update_utils_serial.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation BMC OEM serial update utilities keywords. 3 | 4 | Resource code_update_utils.robot 5 | Resource serial_connection/serial_console_client.robot 6 | 7 | *** Keywords *** 8 | 9 | Reset Network Interface During Code Update 10 | [Documentation] Disable and re-enable the network while doing code update. 11 | [Arguments] ${image_file_path} ${reboot} 12 | 13 | # Resetting the network will be done via the serial console. 14 | # 15 | # Description of argument(s): 16 | # image_file_path Path to the image file to update to. 17 | # reboot If set to true, will reboot the BMC after the code 18 | # update is finished. 19 | 20 | ${version_id}= Upload And Activate Image ${image_file_path} wait=${0} 21 | Reset Network Interface 22 | 23 | # Verify code update was successful and 'Activation' state is 'Active'. 24 | Wait For Activation State Change ${version_id} ${ACTIVATING} 25 | ${software_state}= Read Properties ${SOFTWARE_VERSION_URI}${version_id} 26 | Should Be Equal As Strings ${software_state}[Activation] ${ACTIVE} 27 | 28 | Run Keyword If '${reboot}' OBMC Reboot (off) stack_mode=normal 29 | 30 | 31 | Reset Network Interface 32 | [Documentation] Turn the ethernet network interface off and then on again 33 | ... through the serial console. 34 | 35 | Import Resource ${CURDIR}/serial_connection/serial_console_client.robot 36 | Set Library Search Order SSHLibrary Telnet 37 | Execute Command On Serial Console ifconfig eth0 down 38 | Sleep 30s 39 | Execute Command On Serial Console ifconfig eth0 up 40 | -------------------------------------------------------------------------------- /lib/disable_warning_urllib.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import logging 3 | import warnings 4 | 5 | try: 6 | import httplib 7 | except ImportError: 8 | import http.client 9 | 10 | warnings.filterwarnings("ignore") 11 | 12 | # Hijack the HTTP lib logger message and Log only once 13 | requests_log = logging.getLogger("requests.packages.urllib3") 14 | requests_log.setLevel(logging.CRITICAL) 15 | requests_log.propagate = False 16 | 17 | 18 | class disable_warning_urllib: 19 | def do_nothing(): 20 | return 21 | -------------------------------------------------------------------------------- /lib/dmtf_tools_utils.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation DMTF tools utility keywords. 3 | 4 | Resource resource.robot 5 | Library gen_cmd.py 6 | 7 | *** Variables *** 8 | 9 | # ignore_err controls Shell Cmd behavior. 10 | ${ignore_err} ${0} 11 | 12 | *** Keywords *** 13 | 14 | Download DMTF Tool 15 | [Documentation] Git clone tool. 16 | [Arguments] ${rsv_dir_path} ${rsv_github_url} ${branch_name} 17 | 18 | # Description of arguments: 19 | # rsv_dir_path Directory path for rsv tool (e.g. "Redfish-Service-Validator"). 20 | # rsv_github_url Github URL link(e.g "https://github.com/DMTF/Redfish-Service-Validator"). 21 | 22 | ${cmd_buf} Catenate rm -rf ${rsv_dir_path} ; 23 | ... git clone --branch ${branch_name} ${rsv_github_url} ${rsv_dir_path} 24 | ${rc} ${output}= Shell Cmd ${cmd_buf} 25 | 26 | 27 | Run DMTF Tool 28 | [Documentation] Execution of the command. 29 | [Arguments] ${rsv_dir_path} ${command_string} ${check_error}=0 30 | 31 | # Description of arguments: 32 | # rsv_dir_path Directory path for rsv tool (e.g. "Redfish-Service-Validator"). 33 | # command_string The complete rsv command string to be run. 34 | # check_error It decides if error information is to be checked. 35 | 36 | ${rc} ${output}= Shell Cmd ${command_string} ignore_err=${check_error} 37 | Log ${output} 38 | RETURN ${rc} ${output} 39 | 40 | 41 | Redfish Service Validator Result 42 | [Documentation] Check tool output for errors. 43 | [Arguments] ${tool_output} 44 | 45 | # Example: 46 | # Validation has failed: 9 problems found 47 | # Service could not be started: RetriesExhaustedError() 48 | Should Not Contain Any ${tool_output} Validation has failed 49 | ... Service could not be started: RetriesExhaustedError() 50 | 51 | 52 | Redfish JsonSchema ResponseValidator Result 53 | [Documentation] Check tool output for errors. 54 | [Arguments] ${tool_output} 55 | 56 | # Example: 57 | # 0 errors 58 | Should Contain ${tool_output} 0 errors 59 | 60 | -------------------------------------------------------------------------------- /lib/dvt/obmc_driver_vars.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This file includes all the variables used by obmc_boot_test.robot 3 | 4 | *** Variables *** 5 | # Alias of the master connection to the BMC 6 | ${master_alias} master 7 | 8 | # The count of the boot we're currently doing - used in the FOR loop. 9 | ${BOOT_COUNT} ${0} 10 | 11 | # The status of the last boots that finished 12 | ${BOOT_STATUS} ${EMPTY} 13 | 14 | # A list of the last 10 boots that have been performed (see Log Last Ten) 15 | @{LAST_TEN} 16 | 17 | # A list of keywords of valid boots that can be performed 18 | @{VALID_POWER_ON} BMC Power On 19 | @{VALID_POWER_OFF} BMC Power Off 20 | #@{VALID_ACCYCLE} 21 | #@{VALID_REBOOT} 22 | 23 | # The master list of all boots possible, for reference. (Currently not in use). 24 | @{MASTER_BOOT_LIST} BMC Power On BMC Power Off 25 | 26 | # The list of available boots - Modifying this will limit what boots can be done. 27 | # This list is also used by: Setup Run Table, Log Run Table 28 | @{AVAIL_BOOTS} BMC Power On BMC Power Off 29 | -------------------------------------------------------------------------------- /lib/event_notification_utils.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Resource file for event notification subscription. 4 | 5 | *** Keywords *** 6 | 7 | Delete All Event Subscriptions 8 | [Documentation] Delete all event subscriptions. 9 | 10 | ${subscriptions}= Redfish.Get Attribute /redfish/v1/EventService/Subscriptions Members 11 | Return From Keyword If ${subscriptions} is None 12 | FOR ${subscription} IN @{subscriptions} 13 | Redfish.Delete ${subscription['@odata.id']} 14 | END 15 | 16 | Get Event Subscription IDs 17 | [Documentation] Get event subscription IDs. 18 | 19 | ${subscription_ids}= Create List 20 | ${subscriptions}= Redfish.Get Attribute /redfish/v1/EventService/Subscriptions Members 21 | Log ${subscriptions} 22 | FOR ${subscription} IN @{subscriptions} 23 | Append To List ${subscription_ids} 24 | ... ${subscription['@odata.id'].split("/redfish/v1/EventService/Subscriptions/")[-1]} 25 | END 26 | RETURN ${subscription_ids} 27 | 28 | Get Destination IPs Of Event Subscriptions 29 | [Documentation] Get all subscribed server IPs as a list from event subscriptions. 30 | 31 | ${subscription_ids}= Get Event Subscription IDs 32 | 33 | ${server_ips}= Create List 34 | FOR ${id} IN @{subscription_ids} 35 | ${destination}= Redfish.Get Attribute /redfish/v1/EventService/Subscriptions/${id} Destination 36 | # E.g. https://xx.xx.xx.xx:xxxx/redfish/events 37 | ${dest_ip}= Get Regexp Matches ${destination} .*://(.*):.* 1 38 | ${server_ips}= Combine Lists ${server_ips} ${dest_ip} 39 | END 40 | RETURN ${server_ips} 41 | 42 | Delete Event Subscription Of Unpingable Destination IPs 43 | [Documentation] Delete event subscription with non-pinging destination IPs. 44 | 45 | ${subscription_ids}= Get Event Subscription IDs 46 | 47 | FOR ${id} IN @{subscription_ids} 48 | ${destination}= Redfish.Get Attribute /redfish/v1/EventService/Subscriptions/${id} Destination 49 | ${dest_ip}= Get Regexp Matches ${destination} .*://(.*):.* 1 50 | ${status}= Run Keyword And Return Status Ping Host ${dest_ip}[0] 51 | 52 | IF ${status} == False 53 | Redfish.Delete /redfish/v1/EventService/Subscriptions/${id} 54 | END 55 | END 56 | -------------------------------------------------------------------------------- /lib/htx_resource.robot: -------------------------------------------------------------------------------- 1 | 2 | *** Variables *** 3 | 4 | # Default duration and interval of HTX exerciser to run. 5 | ${HTX_DURATION} 2 hours 6 | ${HTX_INTERVAL} 15 min 7 | 8 | # Default hardbootme loop times HTX exerciser to run. 9 | ${HTX_LOOP} 4 10 | 11 | # User-defined halt on error. 12 | ${HTX_KEEP_RUNNING} ${0} 13 | 14 | # Default MDT profile. 15 | ${HTX_MDT_PROFILE} mdt.bu 16 | 17 | # HTX bootme_period: 18 | # 1 - every 20 minutes 19 | # 2 - every 30 minutes 20 | # 3 - every hour 21 | # 4 - every midnight 22 | ${BOOTME_PERIOD} 1 23 | 24 | -------------------------------------------------------------------------------- /lib/os_utilities.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | This file contains utilities associated with the host OS. 5 | """ 6 | 7 | import os 8 | import sys 9 | 10 | sys.path.append(os.path.join(os.path.dirname(__file__), "../lib")) 11 | 12 | import bmc_ssh_utils # NOQA 13 | import var_funcs # NOQA 14 | 15 | 16 | def get_os_release_info(default_cmd="cat /etc/os-release"): 17 | r""" 18 | 19 | Get os-release info and return it as a dictionary. 20 | 21 | An example of the contents of /etc/os-release: 22 | 23 | NAME="Red Hat Enterprise Linux Server" 24 | VERSION="7.5 (Maipo)" 25 | ID="rhel" 26 | ID_LIKE="fedora" 27 | VARIANT="Server" 28 | VARIANT_ID="server" 29 | VERSION_ID="7.5" 30 | PRETTY_NAME="Red Hat Enterprise Linux Server 7.5 Beta (Maipo)" 31 | ANSI_COLOR="0;31" 32 | CPE_NAME="cpe:/o:redhat:enterprise_linux:7.5:beta:server" 33 | HOME_URL="https://www.redhat.com/" 34 | BUG_REPORT_URL="https://bugzilla.redhat.com/" 35 | 36 | REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" 37 | REDHAT_BUGZILLA_PRODUCT_VERSION=7.5 38 | REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" 39 | REDHAT_SUPPORT_PRODUCT_VERSION="7.5 Beta" 40 | 41 | For the data shown above, this function will return the following 42 | dictionary: 43 | 44 | result: 45 | [name]: Red Hat Enterprise Linux Server 46 | [version]: 7.5 (Maipo) 47 | [id]: rhel 48 | [id_like]: fedora 49 | [variant]: Server 50 | [variant_id]: server 51 | [version_id]: 7.5 52 | [pretty_name]: Red Hat Enterprise Linux Server 7.5 Beta (Maipo) 53 | [ansi_color]: 0;31 54 | [cpe_name]: cpe:/o:redhat:enterprise_linux:7.5:beta:server 55 | [home_url]: https://www.redhat.com/ 56 | [bug_report_url]: https://bugzilla.redhat.com/ 57 | [redhat_bugzilla_product]: Red Hat Enterprise Linux 7 58 | [redhat_bugzilla_product_version]: 7.5 59 | [redhat_support_product]: Red Hat Enterprise Linux 60 | [redhat_support_product_version]: 7.5 Beta 61 | 62 | 63 | . Description of argument(s): 64 | default_cmd A string command to be executed (e.g cat /etc/os-release). 65 | 66 | """ 67 | 68 | stdout, stderr, rc = bmc_ssh_utils.os_execute_command(default_cmd) 69 | 70 | return var_funcs.key_value_outbuf_to_dict(stdout, delim="=", strip='"') 71 | -------------------------------------------------------------------------------- /lib/pdu/pdu.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Generic Protocol Distribution Unit (PDU) library 3 | 4 | Resource ../../lib/resource.robot 5 | 6 | *** Keywords *** 7 | Validate Prereq 8 | [Documentation] Validate prerequisites for PDU. 9 | ${PDU_VAR_LIST}= Create List PDU_TYPE PDU_IP PDU_USERNAME PDU_PASSWORD PDU_SLOT_NO 10 | FOR ${PDU_VAR} IN @{PDU_VAR_LIST} 11 | Should Not Be Empty ${${PDU_VAR}} msg=Unable to find variable ${PDU_VAR} 12 | END 13 | 14 | PDU Power Cycle 15 | [Documentation] Perform PDU power cycle. 16 | Validate Prereq 17 | Import Resource ${CURDIR}/../../lib/pdu/${PDU_TYPE}.robot 18 | Power Cycle 19 | -------------------------------------------------------------------------------- /lib/pdu/synaccess.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Synaccess Protocol Distribution Unit (PDU) library 3 | 4 | Resource ../../lib/pdu/pdu.robot 5 | Library RequestsLibrary 6 | 7 | *** Keywords *** 8 | Connect and Login 9 | [Documentation] Open PDU connection and login. 10 | Validate Prereq 11 | SSHLibrary.Open Connection ${PDU_IP} 12 | ${auth}= Create List ${PDU_USERNAME} ${PDU_PASSWORD} 13 | Create Session pdu http://${PDU_IP} auth=${auth} 14 | 15 | Power Cycle 16 | [Documentation] Perform PDU power cycle. 17 | Connect and Login 18 | ${resp}= GET On Session pdu /cmd.cgi?$A4 ${PDU_SLOT_NO} 19 | 20 | ${error_message}= Catenate Power cycle of slot ${PDU_SLOT_NO} failed. 21 | ... PDU returned RC=${resp}. 22 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} msg=${error_message} 23 | -------------------------------------------------------------------------------- /lib/pythonutil.py: -------------------------------------------------------------------------------- 1 | from socket import inet_ntoa 2 | from struct import pack 3 | 4 | 5 | def calcDottedNetmask(mask): 6 | bits = 0 7 | for i in xrange(32 - mask, 32): 8 | bits |= 1 << i 9 | packed_value = pack("!I", bits) 10 | addr = inet_ntoa(packed_value) 11 | return addr 12 | -------------------------------------------------------------------------------- /lib/redfish_request.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Redfish request library which provide keywords for creating session, 4 | ... sending POST, PUT, DELETE, PATCH, GET etc. request using redfish_request.py 5 | ... library file. It also contain other keywords which uses redfish_request.py 6 | ... library infrastructure. 7 | 8 | Resource openbmc_ffdc.robot 9 | Resource bmc_redfish_resource.robot 10 | Resource rest_response_code.robot 11 | Library redfish_request.py 12 | 13 | *** Keywords *** 14 | 15 | Redfish Generic Login Request 16 | [Documentation] Do Redfish login request. 17 | [Arguments] ${user_name} ${password} 18 | 19 | # Description of argument(s): 20 | # user_name User name of BMC. 21 | # password Password of BMC. 22 | 23 | ${client_id}= Create Dictionary ClientID=None 24 | ${oem_data}= Create Dictionary OpenBMC=${client_id} 25 | ${data}= Create Dictionary UserName=${user_name} Password=${password} Oem=${oem_data} 26 | 27 | Set Test Variable ${uri} /redfish/v1/SessionService/Sessions 28 | ${resp}= Request_Login headers=None url=${uri} credential=${data} 29 | Should Be Equal As Strings ${resp.status_code} ${HTTP_CREATED} 30 | 31 | RETURN ${resp} 32 | 33 | 34 | Redfish Generic Session Request 35 | [Documentation] Do Redfish login request and store the session details. 36 | [Arguments] ${user_name} ${password} 37 | 38 | # Description of argument(s): 39 | # user_name User name of BMC. 40 | # password Password of BMC. 41 | 42 | ${session_dict}= Create Dictionary 43 | ${session_resp}= Redfish Generic Login Request ${user_name} ${password} 44 | 45 | ${auth_token}= Create Dictionary X-Auth-Token ${session_resp.headers['X-Auth-Token']} 46 | 47 | Set To Dictionary ${session_dict} headers ${auth_token} 48 | Set To Dictionary ${session_dict} Location ${session_resp.headers['Location']} 49 | 50 | 51 | Set To Dictionary ${session_dict} Content ${session_resp.content} 52 | 53 | Set Global Variable ${active_session_info} ${session_dict} 54 | Append To List ${session_dict_list} ${session_dict} 55 | 56 | RETURN ${session_dict} 57 | -------------------------------------------------------------------------------- /lib/rest_response_code.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | # Response codes 3 | ${HTTP_CONTINUE} 100 4 | ${HTTP_SWITCHING_PROTOCOLS} 101 5 | ${HTTP_PROCESSING} 102 6 | ${HTTP_OK} 200 7 | ${HTTP_CREATED} 201 8 | ${HTTP_ACCEPTED} 202 9 | ${HTTP_NON_AUTHORITATIVE_INFORMATION} 203 10 | ${HTTP_NO_CONTENT} 204 11 | ${HTTP_RESET_CONTENT} 205 12 | ${HTTP_PARTIAL_CONTENT} 206 13 | ${HTTP_MULTI_STATUS} 207 14 | ${HTTP_IM_USED} 226 15 | ${HTTP_MULTIPLE_CHOICES} 300 16 | ${HTTP_MOVED_PERMANENTLY} 301 17 | ${HTTP_FOUND} 302 18 | ${HTTP_SEE_OTHER} 303 19 | ${HTTP_NOT_MODIFIED} 304 20 | ${HTTP_USE_PROXY} 305 21 | ${HTTP_TEMPORARY_REDIRECT} 307 22 | ${HTTP_BAD_REQUEST} 400 23 | ${HTTP_UNAUTHORIZED} 401 24 | ${HTTP_PAYMENT_REQUIRED} 402 25 | ${HTTP_FORBIDDEN} 403 26 | ${HTTP_NOT_FOUND} 404 27 | ${HTTP_METHOD_NOT_ALLOWED} 405 28 | ${HTTP_NOT_ACCEPTABLE} 406 29 | ${HTTP_PROXY_AUTHENTICATION_REQUIRED} 407 30 | ${HTTP_REQUEST_TIMEOUT} 408 31 | ${HTTP_CONFLICT} 409 32 | ${HTTP_GONE} 410 33 | ${HTTP_LENGTH_REQUIRED} 411 34 | ${HTTP_PRECONDITION_FAILED} 412 35 | ${HTTP_REQUEST_ENTITY_TOO_LARGE} 413 36 | ${HTTP_REQUEST_URI_TOO_LONG} 414 37 | ${HTTP_UNSUPPORTED_MEDIA_TYPE} 415 38 | ${HTTP_REQUESTED_RANGE_NOT_SATISFIABLE} 416 39 | ${HTTP_EXPECTATION_FAILED} 417 40 | ${HTTP_UNPROCESSABLE_ENTITY} 422 41 | ${HTTP_LOCKED} 423 42 | ${HTTP_FAILED_DEPENDENCY} 424 43 | ${HTTP_UPGRADE_REQUIRED} 426 44 | ${HTTP_INTERNAL_SERVER_ERROR} 500 45 | ${HTTP_NOT_IMPLEMENTED} 501 46 | ${HTTP_BAD_GATEWAY} 502 47 | ${HTTP_SERVICE_UNAVAILABLE} 503 48 | ${HTTP_GATEWAY_TIMEOUT} 504 49 | ${HTTP_HTTP_VERSION_NOT_SUPPORTED} 505 50 | ${HTTP_INSUFFICIENT_STORAGE} 507 51 | ${HTTP_NOT_EXTENDED} 510 52 | -------------------------------------------------------------------------------- /lib/secureboot/secureboot.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Utility for getting/reading Secure Boot related settings. 3 | Resource ../../lib/open_power_utils.robot 4 | Resource ../../lib/utils.robot 5 | Resource ../../lib/state_manager.robot 6 | Resource ../../lib/boot_utils.robot 7 | Library ../../lib/bmc_ssh_utils.py 8 | 9 | *** Keywords *** 10 | 11 | Set TPMEnable Policy 12 | [Documentation] Enable or disable TPM Policy. 13 | [Arguments] ${tpm_policy} 14 | 15 | # Description of argument(s): 16 | # tpm_policy Enable-1 or Disable-0. 17 | 18 | ${value_dict}= Create Dictionary data=${tpm_policy} 19 | Write Attribute ${CONTROL_HOST_URI}/TPMEnable TPMEnable 20 | ... data=${value_dict} 21 | 22 | 23 | Set And Verify TPM Policy 24 | [Documentation] Enable or disable and verify TPM Policy. 25 | [Arguments] ${tpm_policy} 26 | 27 | # Description of argument(s): 28 | # tpm_policy Enable-1 or Disable-0. 29 | 30 | Set TPMEnable Policy ${tpm_policy} 31 | Verify The Attribute ${CONTROL_URI}/host0/TPMEnable TPMEnable ${tpm_policy} 32 | -------------------------------------------------------------------------------- /lib/serial_connection/serial_console_client.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Module for capturing BMC serial output 3 | 4 | Library Telnet newline=LF 5 | Library OperatingSystem 6 | Library Collections 7 | Library String 8 | 9 | 10 | *** Keywords *** 11 | 12 | Open Telnet Connection To BMC Serial Console 13 | [Documentation] Open telnet connection session to BMC serial console 14 | ... The login prompt expected, for example, for Witherspoon 15 | ... is "Witherspoon login:". 16 | [Arguments] ${i_host}=${OPENBMC_SERIAL_HOST} 17 | ... ${i_port}=${OPENBMC_SERIAL_PORT} 18 | ... ${i_model}=${OPENBMC_MODEL} 19 | 20 | # Description of argument(s): 21 | # i_host The host name or IP of the serial console. 22 | # i_port The port of the serial console. 23 | # i_model The path to the system data, i.e. "./data/Witherspoon.py". 24 | 25 | ${prompt_string}= Convert To Lowercase ${i_model} login: 26 | Telnet.Open Connection 27 | ... ${i_host} port=${i_port} prompt=# 28 | Telnet.Set Timeout 30 seconds 29 | Telnet.Set Newline \n 30 | Telnet.Set Newline CRLF 31 | Telnet.Write \n 32 | Telnet.Write exit 33 | Telnet.Write \n 34 | Telnet.Read Until Regexp (Password:|logout) 35 | Telnet.Write \n 36 | Telnet.Read Until ${prompt_string} 37 | Telnet.Write ${OPENBMC_USERNAME} 38 | Telnet.Write \n 39 | Telnet.Read Until Password: 40 | Telnet.Write ${OPENBMC_PASSWORD} 41 | Telnet.Write \n 42 | Telnet.Read Until Prompt 43 | Telnet.Set Timeout 30 minute 30 seconds 44 | 45 | 46 | Read And Log BMC Serial Console Output 47 | [Documentation] Reads everything that is currently available 48 | ... in the output. 49 | 50 | ${bmc_serial_log}= Telnet.Read 51 | Log ${bmc_serial_log} 52 | 53 | 54 | Execute Command On Serial Console 55 | [Documentation] Execute a command on the BMC serial console. 56 | [Arguments] ${command_string} 57 | 58 | # Description of argument(s): 59 | # command The command to execute on the BMC. 60 | 61 | Open Telnet Connection To BMC Serial Console 62 | Telnet.Write \n 63 | Telnet.Write \n 64 | Telnet.Execute Command ${command_string} 65 | Read And Log BMC Serial Console Output 66 | Close Serial Console Connection 67 | 68 | 69 | Close Serial Console Connection 70 | [Documentation] Log out of the BMC and close telnet. 71 | 72 | Telnet.Write \n 73 | Telnet.Write exit 74 | Telnet.Close Connection 75 | -------------------------------------------------------------------------------- /lib/snmp/resource.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | 3 | # SNMP related parameters. 4 | 5 | # 10.x.x.x series is a private IP address range and does not exist in 6 | # our network, so this is chosen to avoid any adversary effect. 7 | # It can be overridden by command line arguments. 8 | ${SNMP_MGR1_IP} 10.6.6.6 9 | ${SNMP_MGR2_IP} 10.6.6.7 10 | ${SNMP_MGR3_IP} 10.6.6.8 11 | ${out_of_range_ip} 10.6.6.256 12 | ${alpha_ip} xx.xx.xx.xx 13 | ${less_octet_ip} 10. 14 | ${negative_ip} -10.6.6.6 15 | ${empty_ip} ${EMPTY} 16 | 17 | # Valid and invalid IP and ports. Valid port range is 0-65535. 18 | # Default port is 162. 19 | ${SNMP_DEFAULT_PORT} ${162} 20 | ${NON_DEFAULT_PORT1} ${186} 21 | ${NON_DEFAULT_PORT2} ${196} 22 | ${out_of_range_port} ${65536} 23 | # non numeric value 24 | ${alpha_port} ab 25 | ${negative_port} ${-12} 26 | ${empty_port} ${EMPTY} 27 | ${alphanumeric_port} abc123 28 | 29 | # User Name Password 30 | ${SNMP_MGR1_USERNAME} ${EMPTY} 31 | ${SNMP_MGR1_PASSWORD} ${EMPTY} 32 | 33 | # SNMP Command 34 | ${SNMP_TRAPD_CMD} snmptrapd -f -c 35 | ... /usr/local/etc/snmp/snmptrapd.conf -Lo 36 | ${SNMP_TRAP_BMC_ERROR} example.xyz.openbmc_project.Example.Elog.AutoTestSimple 37 | -------------------------------------------------------------------------------- /lib/tftp_update_utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | This module contains functions for tftp update. 5 | """ 6 | 7 | import gen_print as gp # NOQA 8 | import state as st 9 | 10 | 11 | def get_pre_reboot_state(): 12 | r""" 13 | Get and return a custom state which is comprised of the 14 | st.default_req_states plus epoch_seconds. 15 | """ 16 | 17 | global state 18 | 19 | req_states = ["epoch_seconds"] + st.default_req_states 20 | 21 | gp.qprint_timen("Get system state.") 22 | state = st.get_state(req_states=req_states, quiet=0) 23 | gp.qprint_var(state) 24 | return state 25 | 26 | 27 | def wait_for_reboot(start_boot_seconds, wait_state_check=True): 28 | r""" 29 | Wait for the BMC to complete a previously initiated reboot. 30 | 31 | Description of argument(s): 32 | start_boot_seconds The time that the boot test started. The format is the 33 | epoch time in seconds, i.e. the number of seconds since 34 | 1970-01-01 00:00:00 UTC. This value should be obtained 35 | from the BMC so that it is not dependent on any kind of 36 | synchronization between this machine and the target BMC 37 | This will allow this program to work correctly even in 38 | a simulated environment. This value should be obtained 39 | by the caller prior to initiating a reboot. It can be 40 | obtained as follows: 41 | state = st.get_state(req_states=['epoch_seconds']) 42 | wait_state_check By default check the state, ignore if set to False. 43 | 44 | """ 45 | 46 | st.wait_for_comm_cycle(int(start_boot_seconds)) 47 | 48 | gp.qprintn() 49 | if wait_state_check: 50 | st.wait_state( 51 | st.standby_match_state, wait_time="10 mins", interval="10 seconds" 52 | ) 53 | -------------------------------------------------------------------------------- /lib/vpd_utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | VPD functions. 5 | """ 6 | 7 | import json 8 | 9 | import bmc_ssh_utils as bsu 10 | import func_args as fa 11 | 12 | 13 | class VpdtoolException(Exception): 14 | r""" 15 | Base class for vpdtool related exceptions. 16 | """ 17 | 18 | def __init__(self, message): 19 | self.message = message 20 | super().__init__(self.message) 21 | 22 | 23 | def vpdtool(option_string, **bsu_options): 24 | r""" 25 | Run vpdtool on the BMC with the caller's option string and return the result. 26 | 27 | Example: 28 | 29 | ${vpd_results}= vpd-tool -i 30 | Rprint Vars vpd_results 31 | 32 | vpd_results: 33 | [/system/chassis/motherboard]: 34 | [PN]: PN12345 35 | [SN]: YL2E2D010000 36 | [LocationCode]: U78DA.ND1. -P0 37 | [CC]: 2E2D 38 | [DR]: SYSTEM BACKPLANE 39 | [FN]: F191014 40 | [type]: xyz.openbmc_project.Inventory.Item.Board.Motherboard 41 | [/system/chassis/motherboard/ebmc_card_bmc]: 42 | [PN]: PN12345 43 | [SN]: YL6B58010000 44 | [LocationCode]: U78DA.ND1. -P0-C5 45 | [CC]: 6B58 46 | [DR]: EBMC 47 | [FN]: F191014 48 | [type]: xyz.openbmc_project.Inventory.Item.Bmc 49 | 50 | Description of argument(s): 51 | option_string A string of options which are to be processed by 52 | the vpd-tool command. 53 | bsu_options Options to be passed directly to bmc_execute_command. 54 | See its prolog for details. 55 | """ 56 | 57 | bsu_options = fa.args_to_objects(bsu_options) 58 | out_buf, stderr, rc = bsu.bmc_execute_command( 59 | "vpd-tool " + option_string, **bsu_options 60 | ) 61 | 62 | # Only return output if its not a VPD write command. 63 | try: 64 | if "-w" not in option_string: 65 | out_buf = json.loads(out_buf) 66 | if "-r" in option_string: 67 | return out_buf 68 | else: 69 | return out_buf[0] 70 | except Exception as exception: 71 | raise VpdtoolException( 72 | "Failed to get VPD data from BMC : " + str(exception) 73 | ) from exception 74 | -------------------------------------------------------------------------------- /lib/xcat/resource.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | 3 | # XCAT related parameters 4 | 5 | ${XCAT_HOST} ${EMPTY} 6 | ${XCAT_USERNAME} ${EMPTY} 7 | ${XCAT_PASSWORD} ${EMPTY} 8 | ${XCAT_PORT} 22 9 | ${XCAT_DIR_PATH} /opt/xcat/bin/ 10 | ${GROUP} openbmc 11 | 12 | # Default BMC nodes config file. 13 | 14 | ${NODE_CFG_FILE_PATH} ../lib/xcat/bmc_nodes.cfg 15 | -------------------------------------------------------------------------------- /network/network_diagnostic_report.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Network diagnostic tool report and logs to console 3 | ... for information. For more information 'man mtr'. 4 | 5 | Library OperatingSystem 6 | Library ../lib/utilities.py 7 | Resource ../lib/utils.robot 8 | Test Setup Check If Tool Exist 9 | 10 | Test Tags Network_Diagnostic_Report 11 | 12 | *** Test Cases *** 13 | 14 | Check Network Latency 15 | [Documentation] Check network connection between host MTR and BMC host. 16 | [Tags] Check_Network_Latency 17 | 18 | Ping Host ${OPENBMC_HOST} 19 | Repeat Keyword 3 times Log Network Loss 20 | 21 | *** Keywords *** 22 | 23 | Log Network Loss 24 | [Documentation] Log Network packets loss percentage from MTR report. 25 | ${report}= Get MTR Row ${OPENBMC_HOST} 26 | Log To Console \n Network packets loss: ${report['loss']} percent 27 | Sleep 3s 28 | 29 | Check If Tool Exist 30 | [Documentation] Check if mtr tool exists. 31 | 32 | ${bin_path}= Run which mtr 33 | Should Contain ${bin_path} mtr msg=mtr tool is not installed. 34 | -------------------------------------------------------------------------------- /network/test_host_network_interfaces.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Verify that the OS network interfaces are configured and 4 | ... stable. 5 | 6 | # TEST PARAMETERS: 7 | # OS_HOST The OS host name or IP address. 8 | # OS_USERNAME The OS user name. 9 | # OS_PASSWORD The OS Host password. 10 | # FAIL_ON_LINK_DOWN If set to 1, the test will exit if 11 | # a link is down. Default is 1. 12 | 13 | Resource ../lib/os_utils_install.robot 14 | 15 | Test Tags Host_Network_Interfaces 16 | 17 | *** Variables *** 18 | 19 | ${FAIL_ON_LINK_DOWN} 1 20 | 21 | 22 | *** Test Cases *** 23 | Verify Network Interfaces 24 | [Documentation] Verify the states of all system interfaces. 25 | [Tags] Verify_Network_Interfaces 26 | 27 | Printn 28 | REST Power On 29 | @{interface_names}= Get OS Network Interface Names 30 | FOR ${interface_name} IN @{interface_names} 31 | ${ethtool_dict}= Get OS Ethtool ${interface_name} 32 | IF ${FAIL_ON__LINK_DOWN} == 1 33 | Should Be Equal ${ethtool_dict['link_detected']} yes 34 | ... msg=Link ${interface_name} is down. 35 | END 36 | END 37 | -------------------------------------------------------------------------------- /openpower/check_error_logs.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation BMC server health, check error logs. 3 | 4 | # Test Parameters: 5 | # OPENBMC_HOST The BMC host name or IP address. 6 | 7 | Resource ../lib/bmc_redfish_resource.robot 8 | Resource ../lib/openbmc_ffdc.robot 9 | 10 | Suite Setup Suite Setup Execution 11 | Test Setup Printn 12 | 13 | *** Variables *** 14 | ${QUIET} ${1} 15 | 16 | *** Test Cases *** 17 | 18 | Collect Error Logs 19 | [Documentation] Check error logs with Redfish. 20 | [Tags] Collect_Error_Logs 21 | [Setup] Redfish.Login 22 | [Teardown] Redfish Test Teardown Execution 23 | 24 | ${redfish_event_logs}= Get Event Logs 25 | ${redfish_event_logs}= gen_robot_print.Sprint Vars redfish_event_logs 26 | Set Suite Variable ${redfish_event_logs} 27 | Log To Console \n\nEvent logs:${redfish_event_logs} 28 | ${event_logs_flagged}= Get Event Logs Not Ok 29 | ${event_logs_flagged}= gen_robot_print.Sprint Vars event_logs_flagged 30 | Log To Console \n\nEvent logs flagged:${event_logs_flagged} 31 | 32 | 33 | *** Keywords *** 34 | 35 | Suite Setup Execution 36 | [Documentation] Do test suite setup tasks. 37 | 38 | Set Log Level DEBUG 39 | Log To Console ${OPENBMC_HOST} 40 | 41 | 42 | Redfish Test Teardown Execution 43 | [Documentation] Do the post test teardown for redfish. 44 | 45 | Redfish.Logout 46 | FFDC On Test Case Fail 47 | -------------------------------------------------------------------------------- /openpower/check_vpd_and_hw_status.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation BMC collect VPD and hardware status. 3 | 4 | # Test Parameters: 5 | # OPENBMC_HOST The BMC host name or IP address. 6 | 7 | Resource ../lib/bmc_redfish_resource.robot 8 | Resource ../lib/openbmc_ffdc.robot 9 | 10 | Suite Setup Suite Setup Execution 11 | Test Setup Printn 12 | 13 | *** Variables *** 14 | ${QUIET} ${1} 15 | 16 | *** Test Cases *** 17 | 18 | Collect VPD And Hardware Status 19 | [Documentation] Collect VPD and hardware status using Redfish. 20 | [Tags] Collect_VPD_And_Hardware_Status 21 | [Setup] Redfish.Login 22 | [Teardown] Redfish Test Teardown Execution 23 | 24 | ${system_properties}= Redfish_Utils.Get Properties ${SYSTEM_BASE_URI} 25 | ${system_memory_info}= Redfish_Utils.Enumerate Request ${SYSTEM_BASE_URI}/Memory 26 | ${system_processors_info}= Redfish_Utils.Enumerate Request ${SYSTEM_BASE_URI}/Processors 27 | 28 | # Python module: get_endpoint_path_list(resource_path, end_point_prefix) 29 | ${thermal_uri}= redfish_utils.Get Endpoint Path List ${REDFISH_CHASSIS_URI} Thermal 30 | ${system_fans_info}= Redfish_Utils.Get Attribute ${thermal_uri[0]} Fans 31 | 32 | ${collected_values}= gen_robot_print.Sprint Vars 33 | ... system_properties system_memory_info system_processors_info system_fans_info 34 | Log To Console ${\n}${collected_values}${\n} 35 | 36 | Run VPD Tool 37 | [Documentation] Run vpd-tool -i. 38 | [Tags] Run_VPD_Tool 39 | 40 | BMC Execute Command vpd-tool -i print_out=${1} 41 | 42 | *** Keywords *** 43 | 44 | Suite Setup Execution 45 | [Documentation] Do test case setup tasks. 46 | 47 | Set Log Level DEBUG 48 | Log To Console ${OPENBMC_HOST} 49 | 50 | 51 | Redfish Test Teardown Execution 52 | [Documentation] Do the post test teardown for redfish. 53 | 54 | Redfish.Logout 55 | FFDC On Test Case Fail 56 | -------------------------------------------------------------------------------- /openpower/test_inband_bmc_auth_reset.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation OEM IPMI in-band BMC authentication reset. 3 | 4 | # This resets the BMC authentication: 5 | # - Enable local users if they were disabled. 6 | # - Delete the LDAP configuration if there was one. 7 | # - Reset the root password back to the default one. 8 | 9 | Resource ../lib/resource.robot 10 | Resource ../lib/ipmi_client.robot 11 | Resource ../lib/boot_utils.robot 12 | Library ../lib/ipmi_utils.py 13 | 14 | Test Teardown FFDC On Test Case Fail 15 | 16 | *** Test Cases *** 17 | 18 | Test Inband IPMI Auth Reset 19 | [Documentation] Trigger in-band BMC authentication reset and verify. 20 | [Tags] Test_Inband_IPMI_Auth_Reset 21 | 22 | Create Session openbmc ${AUTH_URI} max_retries=1 23 | ${headers}= Create Dictionary Content-Type=application/json 24 | @{credentials}= Create List ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} 25 | ${data}= create dictionary data=@{credentials} 26 | ${resp}= POST On Session openbmc /login data=${data} headers=${headers} 27 | ... expected_status=any 28 | Should Be Equal As Strings ${resp.status_code} ${HTTP_UNAUTHORIZED} 29 | 30 | # Call reset method. 31 | Run Inband IPMI Raw Command 0x3a 0x11 32 | 33 | Initialize OpenBMC 34 | -------------------------------------------------------------------------------- /pldm/test_pldm_oem.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Module to test PLDM oem commands. 4 | 5 | Library ../lib/pldm_utils.py 6 | Variables ../data/pldm_variables.py 7 | Resource ../lib/openbmc_ffdc.robot 8 | 9 | Test Setup Printn 10 | Test Teardown FFDC On Test Case Fail 11 | 12 | Test Tags Pldm_OEM 13 | 14 | *** Test Cases *** 15 | 16 | Verify GetAlertStatus 17 | [Documentation] Verify get alert status descriptor response message. 18 | [Tags] Verify_GetAlertStatus 19 | 20 | ${pldm_output}= Pldmtool oem-ibm GetAlertStatus -i 0 21 | Rprint Vars pldm_output 22 | Valid Value pldm_output['rack entry'] ['0xff000030'] 23 | Valid Value pldm_output['pri cec node'] ['0x00008030'] 24 | 25 | 26 | Verify GetFileTable 27 | [Documentation] Verify GetFileTable response message. 28 | [Tags] Verify_GetFileTable 29 | 30 | ${pldm_output}= Pldmtool oem-ibm GetFileTable 31 | 32 | # Example output 33 | # [{ 34 | # "FileHandle": "0", 35 | # "FileNameLength": 7, 36 | # "FileName": "abcdxxx", 37 | # "FileSize": 28672, 38 | # "FileTraits": 1 39 | # }] 40 | 41 | Should Be Equal ${pldm_output[0]["FileHandle"]} 0 42 | ${output_length}= Get Length ${pldm_output} 43 | Should Be True ${output_length}>${1} 44 | -------------------------------------------------------------------------------- /redfish/__init__.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Get system environment for test suite. 3 | 4 | Resource ../lib/common_utils.robot 5 | 6 | Suite Setup Get System Environment 7 | 8 | *** Keywords *** 9 | 10 | Get System Environment 11 | [Documentation] System environment details. 12 | 13 | Run Keyword And Ignore Error Get BMC PNOR Version 14 | # Run Keyword Check BMC Performance 15 | Run Keyword And Ignore Error Check BMC Performance 16 | -------------------------------------------------------------------------------- /redfish/dmtf_tools/Redfish_Interop_Validator.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Test BMC Redfish conformance using 3 | ... https://github.com/DMTF/Redfish-Interop-Validator. 4 | ... DMTF tool. 5 | ... It validate the Redfish service based on an 6 | ... interoperability profile given to it. 7 | 8 | Resource ../../lib/dmtf_tools_utils.robot 9 | 10 | *** Variables *** 11 | 12 | ${DEFAULT_PYTHON} python3 13 | ${rsv_dir_path} Redfish-Interop-Validator 14 | ${rsv_github_url} https://github.com/DMTF/Redfish-Interop-Validator.git 15 | # In future, when the profile is available at https://redfish.dmtf.org/profiles/ 16 | # Default profile available at data/openbmc_redfish_interop_profile.json 17 | ${profile_path} ${EXECDIR}/data/openbmc_redfish_interop_profile.json 18 | ${cmd_str_master} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}RedfishInteropValidator.py 19 | ... --ip https://${OPENBMC_HOST}:${HTTPS_PORT} 20 | ... --authtype=Session 21 | ... -u ${OPENBMC_USERNAME} 22 | ... -p ${OPENBMC_PASSWORD} 23 | ... --logdir ${EXECDIR}${/}logs${/} 24 | ... ${profile_path} 25 | ... --debugging 26 | ${branch_name} main 27 | 28 | *** Test Cases *** 29 | 30 | Test BMC Redfish Using Redfish Interop Validator 31 | [Documentation] Check conformance based on the OpenBMC Interoperability profile. 32 | [Tags] Test_BMC_Redfish_Using_Redfish_Interop_Validator 33 | 34 | Download DMTF Tool ${rsv_dir_path} ${rsv_github_url} ${branch_name} 35 | 36 | ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${cmd_str_master} check_error=1 37 | 38 | IF ${rc} != 0 Fail Redfish-Interop-Validator Failed. 39 | -------------------------------------------------------------------------------- /redfish/dmtf_tools/Redfish_JsonSchema_ResponseValidator.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Test BMC using https://github.com/DMTF/Redfish-JsonSchema-ResponseValidator 3 | ... DMTF tool. 4 | 5 | Library OperatingSystem 6 | Resource ../../lib/dmtf_tools_utils.robot 7 | Resource ../../lib/bmc_redfish_resource.robot 8 | 9 | *** Variables *** 10 | 11 | ${DEFAULT_PYTHON} python3 12 | ${rsv_dir_path} Redfish-JsonSchema-ResponseValidator 13 | ${rsv_github_url} https://github.com/DMTF/Redfish-JsonSchema-ResponseValidator.git 14 | ${command_string} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}Redfish-JsonSchema-ResponseValidator.py 15 | ... -r https://${OPENBMC_HOST} -u ${OPENBMC_USERNAME} -p ${OPENBMC_PASSWORD} -S -v 16 | 17 | ${branch_name} main 18 | 19 | *** Test Cases *** 20 | 21 | Test BMC Redfish Using Redfish JsonSchema ResponseValidator 22 | [Documentation] Check OpenBMC conformance with JsonSchema files at the DMTF site. 23 | [Tags] Test_BMC_Redfish_Using_Redfish_JsonSchema_ResponseValidator 24 | 25 | Download DMTF Tool ${rsv_dir_path} ${rsv_github_url} ${branch_name} 26 | 27 | Redfish.Login 28 | ${url_list}= redfish_utils.List Request /redfish/v1 29 | Redfish.Logout 30 | 31 | Shell Cmd mkdir -p logs/ 32 | 33 | Set Test Variable ${test_run_status} ${True} 34 | 35 | FOR ${url} IN @{url_list} 36 | ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${command_string} -i ${url} 37 | ${status}= Run Keyword And Return Status Redfish JsonSchema ResponseValidator Result ${output} 38 | IF ${status} == ${False} Set Test Variable ${test_run_status} ${status} 39 | Save Logs For Debugging ${status} ${url} 40 | END 41 | 42 | IF ${test_run_status} == ${False} 43 | Fail Redfish-JsonSchema-ResponseValidator detected errors. 44 | END 45 | 46 | 47 | *** Keywords *** 48 | 49 | Save Logs For Debugging 50 | [Documentation] Save validate_errs on errors. 51 | [Arguments] ${status} ${url} 52 | 53 | # Description of arguments: 54 | # status True/False. 55 | # url Redfish resource path (e.g. "/redfish/v1/AccountService"). 56 | 57 | ${validate_errs}= Shell Cmd cat validate_errs 58 | Log ${validate_errs} 59 | 60 | # URL /redfish/v1/Managers/${MANAGER_ID} strip the last ending string and save off 61 | # the logs for debugging "validate_errs_AccountService" and move to logs/. 62 | IF ${status} == ${False} 63 | Shell Cmd mv validate_errs logs/validate_errs_${url.rsplit("/")[-1]} 64 | END 65 | -------------------------------------------------------------------------------- /redfish/dmtf_tools/Redfish_Protocol_Validator.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Test BMC using 3 | ... https://github.com/DMTF/Redfish-Protocol-Validator 4 | ... DMTF tool. 5 | 6 | Library OperatingSystem 7 | Resource ../../lib/dmtf_tools_utils.robot 8 | 9 | Test Setup Test Setup Execution 10 | 11 | *** Variables *** 12 | 13 | ${DEFAULT_PYTHON} python3 14 | 15 | ${rsv_github_url} https://github.com/DMTF/Redfish-Protocol-Validator 16 | ${rsv_dir_path} Redfish-Protocol-Validator 17 | 18 | ${command_string} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}rf_protocol_validator.py 19 | ... -r ${OPENBMC_HOST}:${HTTPS_PORT} 20 | ... -u ${OPENBMC_USERNAME} 21 | ... -p ${OPENBMC_PASSWORD} 22 | ... --no-cert-check 23 | ... 24 | 25 | ${branch_name} main 26 | 27 | *** Test Cases *** 28 | 29 | Test BMC Redfish Protocol Validator 30 | [Documentation] The Redfish Protocol Validator tests the HTTP protocol 31 | ... behavior of a Redfish service to validate that it 32 | ... conforms to the Redfish Specification. 33 | [Tags] Test_BMC_Redfish_Protocol_Validator 34 | 35 | ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${command_string} check_error=1 36 | 37 | # Example output and fail count regex: 38 | # Summary - PASS: 61, WARN: 1, FAIL: 42, NOT_TESTED: 60 39 | # Fail count group returned from regex ['FAIL: 42', '42'] 40 | 41 | ${fail_count}= Should Match Regexp ${output} FAIL: (\\d+) 42 | 43 | IF ${fail_count[1]} != 0 Fail Redfish Protocol Validator Failed 44 | 45 | 46 | *** Keywords *** 47 | 48 | Test Setup Execution 49 | [Documentation] Do test case setup tasks. 50 | 51 | Download DMTF Tool ${rsv_dir_path} ${rsv_github_url} ${branch_name} 52 | -------------------------------------------------------------------------------- /redfish/dmtf_tools/Redfish_Reference_Checker.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Test BMC using https://github.com/DMTF/Redfish-Reference-Checker 3 | ... DMTF tool. 4 | 5 | Library OperatingSystem 6 | Resource ../../lib/dmtf_tools_utils.robot 7 | Resource ../../lib/openbmc_ffdc.robot 8 | 9 | Test Setup Test Setup Execution 10 | 11 | *** Variables *** 12 | 13 | ${DEFAULT_PYTHON} python3 14 | 15 | ${rsv_github_url} https://github.com/DMTF/Redfish-Reference-Checker.git 16 | ${rsv_dir_path} Redfish-Reference-Checker 17 | 18 | ${command_string} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}RedfishReferenceTool.py 19 | ... --nochkcert 'https://${OPENBMC_HOST}:${HTTPS_PORT}/redfish/v1/$metadata' 20 | 21 | ${branch_name} main 22 | 23 | *** Test Cases *** 24 | 25 | Test BMC Redfish Reference 26 | [Documentation] Checks for valid reference URLs in CSDL XML files. 27 | [Tags] Test_BMC_Redfish_Reference 28 | 29 | ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${command_string} check_error=1 30 | 31 | # Work complete, total failures: 0 32 | Should Match Regexp ${output} Work complete, total failures:[ ]+0 33 | IF ${rc} != 0 Fail Redfish-Reference-Checker Failed. 34 | 35 | *** Keywords *** 36 | 37 | Test Setup Execution 38 | [Documentation] Do test case setup tasks. 39 | 40 | Printn 41 | Download DMTF Tool ${rsv_dir_path} ${rsv_github_url} ${branch_name} 42 | 43 | -------------------------------------------------------------------------------- /redfish/dmtf_tools/test_redfishtool_general.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | 4 | Documentation Verify Redfish tool general functionality. 5 | 6 | Library OperatingSystem 7 | Library String 8 | Library Collections 9 | 10 | Resource ../../lib/resource.robot 11 | Resource ../../lib/bmc_redfish_resource.robot 12 | Resource ../../lib/openbmc_ffdc.robot 13 | Resource ../../lib/dmtf_redfishtool_utils.robot 14 | 15 | 16 | Suite Setup Suite Setup Execution 17 | 18 | Test Tags Redfishtool_General 19 | 20 | *** Variables *** 21 | 22 | 23 | ${root_cmd_args} = SEPARATOR= 24 | ... redfishtool raw -r ${OPENBMC_HOST}:${HTTPS_PORT} -u ${OPENBMC_USERNAME} -p ${OPENBMC_PASSWORD} -S Always 25 | ${min_number_sensors} ${15} 26 | 27 | 28 | *** Test Cases *** 29 | 30 | Verify Redfishtool Sensor Commands 31 | [Documentation] Verify redfishtool's sensor commands. 32 | [Tags] Verify_Redfishtool_Sensor_Commands 33 | 34 | ${sensor_status}= Redfishtool Get /redfish/v1/Chassis/${CHASSIS_ID}/Sensors 35 | ${json_object}= Evaluate json.loads('''${sensor_status}''') json 36 | Should Be True ${json_object["Members@odata.count"]} > ${min_number_sensors} 37 | ... msg=There should be at least ${min_number_sensors} sensors. 38 | 39 | 40 | Verify Redfishtool Health Check Commands 41 | [Documentation] Verify redfishtool's health check command. 42 | [Tags] Verify_Redfishtool_Health_Check_Commands 43 | 44 | ${chassis_data}= Redfishtool Get /redfish/v1/Chassis/${CHASSIS_ID}/ 45 | ${json_object}= Evaluate json.loads('''${chassis_data}''') json 46 | ${status}= Set Variable ${json_object["Status"]} 47 | Should Be Equal OK ${status["Health"]} 48 | ... msg=Health status should be OK. 49 | 50 | 51 | *** Keywords *** 52 | 53 | 54 | Suite Setup Execution 55 | [Documentation] Do suite setup execution. 56 | 57 | ${tool_exist}= Run which redfishtool 58 | Should Not Be Empty ${tool_exist} 59 | -------------------------------------------------------------------------------- /redfish/extended/test_bmc_file_mirroring.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Test BMC file mirroring sync from primary flash chip to 3 | ... alternate flash chip side. 4 | 5 | Resource ../../lib/openbmc_ffdc.robot 6 | Resource ../../lib/bmc_network_utils.robot 7 | Resource ../../lib/bmc_redfish_resource.robot 8 | Library ../../lib/bmc_ssh_utils.py 9 | 10 | Test Teardown Test Teardown Execution 11 | 12 | *** Test Cases *** 13 | 14 | Test BMC Alt Side Mirroring 15 | [Documentation] Verify the modified file is synced to alt flash side. 16 | [Tags] Test_BMC_Alt_Side_Mirroring 17 | 18 | # BMC file sync list. 19 | # Example output from "cat /etc/synclist" file: 20 | # /etc/dropbear/ 21 | # /etc/group 22 | # /etc/gshadow 23 | # /etc/hostname 24 | # /etc/machine-id 25 | # /etc/passwd 26 | # /etc/shadow 27 | # /etc/ssl/ 28 | # /etc/ssl/certs/nginx/ 29 | # /etc/ssl/private/ 30 | # /etc/systemd/network/ 31 | 32 | # Save off the original hostname. 33 | ${orig_hostname} ${stderr} ${rc}= BMC Execute Command 34 | ... cat /etc/hostname 35 | Set Suite Variable ${hostname} ${orig_hostname} 36 | ${mirror_filename}= Set Variable mirror-filename 37 | 38 | Redfish.Login 39 | Configure Hostname ${mirror_filename} 40 | ${curr_hostname} ${stderr} ${rc}= BMC Execute Command hostname 41 | 42 | Should Be Equal As Strings ${curr_hostname} ${mirror_filename} 43 | ... msg=The hostname interface ${mirror_filename} and command value ${curr_hostname} do not match. 44 | 45 | # File "hostname" should have synced to alt media space. 46 | # Example output from "ls /media/alt/var/persist/etc/": 47 | # group group- gshadow gshadow- hostname machine-id ssl systemd 48 | 49 | # Wait time for syncing to ALT side. 50 | Sleep 2 51 | 52 | ${curr_hostname} ${stderr} ${rc}= BMC Execute Command 53 | ... cat /media/alt/var/persist/etc/hostname 54 | 55 | Should Be Equal As Strings ${curr_hostname} ${mirror_filename} 56 | ... msg=hostname primary file is not synced to the alt flash chip side. 57 | 58 | *** Keywords *** 59 | 60 | Test Teardown Execution 61 | [Documentation] Do the post test teardown. 62 | 63 | FFDC On Test Case Fail 64 | 65 | Redfish.Login 66 | Configure Hostname ${hostname} 67 | 68 | -------------------------------------------------------------------------------- /redfish/extended/test_os_reboot.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Module to test OS reboot functionality. 3 | 4 | Resource ../../lib/bmc_redfish_resource.robot 5 | Resource ../../lib/openbmc_ffdc.robot 6 | Resource ../../lib/boot_utils.robot 7 | 8 | Suite Setup Run Key Start SOL Console Logging 9 | Test Setup Redfish.Login 10 | Test Teardown Test Teardown Execution 11 | 12 | *** Variables *** 13 | 14 | # User defined boot test iteration. 15 | ${BOOT_LOOP_COUNT} ${1} 16 | 17 | *** Test Cases *** 18 | 19 | Host Reboot Loop 20 | [Documentation] Boot OS and trigger reboot and expect 21 | ... OS to boot back. 22 | [Tags] Host_Reboot_Loop 23 | 24 | # 1. Boot OS 25 | # 2. Verify OS is booted 26 | # 3. Issue "reboot" from OS 27 | # 4. Verify if OS is booted back 28 | 29 | # By default run test for 1 loop, else user input iteration. 30 | # Fails immediately if any of the execution rounds fail. 31 | 32 | # Note: Host Reboot is implemented by the OBMC Boot Test tool. 33 | # OBMC Boot Test will take the necessary steps to get the OBMC 34 | # to a host powered on state before attempting the Host Reboot. 35 | Repeat Keyword ${BOOT_LOOP_COUNT} times RF SYS GracefulRestart 36 | 37 | *** Keywords *** 38 | 39 | Test Teardown Execution 40 | [Documentation] Do the post test teardown. 41 | # 1. Capture FFDC on test failure. 42 | # 2. Stop SOL logging. 43 | # 3. Close all open SSH connections. 44 | 45 | FFDC On Test Case Fail 46 | 47 | ${keyword_buf}= Catenate Stop SOL Console Logging 48 | ... \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log 49 | Run Key ${keyword_buf} 50 | 51 | Close All Connections 52 | -------------------------------------------------------------------------------- /redfish/service_root/test_sessions_connection.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Test Redfish session and its connection stability. 4 | 5 | Resource ../../lib/bmc_redfish_utils.robot 6 | Resource ../../lib/openbmc_ffdc.robot 7 | 8 | Suite Setup Set Redfish Delete Session Flag ${0} 9 | Suite Teardown Run Keywords Set Redfish Delete Session Flag ${1} AND Redfish.Logout 10 | Test Setup Printn 11 | Test Teardown FFDC On Test Case Fail 12 | 13 | 14 | *** Variables *** 15 | 16 | ${duration} 6h 17 | ${interval} 30s 18 | ${reboot_interval} 30m 19 | 20 | 21 | *** Test Cases *** 22 | 23 | Create Session And Check Connection Stability 24 | [Documentation] Send heartbeat on session continuously and verify connection stability. 25 | [Tags] Create_Session_And_Check_Connection_Stability 26 | [Setup] Redfish.logout 27 | 28 | # Clear old session and start new session. 29 | Redfish.Login 30 | 31 | Repeat Keyword ${duration} Send Heartbeat 32 | 33 | 34 | Create Session And Check Connection Stability On Reboot 35 | [Documentation] Create Session And Check Connection Stability On Reboot 36 | [Tags] Create_Session_And_Check_Connection_Stability_On_Reboot 37 | [Setup] Redfish.logout 38 | 39 | # Clear old session and start new session. 40 | Redfish.Login 41 | 42 | Repeat Keyword ${duration} Check Connection On Reboot 43 | 44 | 45 | *** Keywords *** 46 | 47 | Send Heartbeat 48 | [Documentation] Send heartbeat to BMC. 49 | 50 | ${hostname}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName 51 | Sleep ${interval} 52 | 53 | 54 | Check Connection On Reboot 55 | [Documentation] Send heartbeat on BMC reboot. 56 | 57 | # Reboot BMC 58 | Redfish OBMC Reboot (Off) 59 | 60 | # Verify session is still active and no issues on connection after reboot. 61 | Repeat Keyword ${reboot_interval} Send Heartbeat 62 | -------------------------------------------------------------------------------- /redfish/systems/test_power_control_metrics.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Get the system power supply voltage readings. 3 | 4 | Resource ../../lib/bmc_redfish_resource.robot 5 | Resource ../../lib/bmc_redfish_utils.robot 6 | Resource ../../lib/openbmc_ffdc.robot 7 | Library ../../lib/gen_robot_valid.py 8 | 9 | Suite Setup Suite Setup Execution 10 | Suite Teardown Suite Teardown Execution 11 | Test Setup Printn 12 | Test Teardown Test Teardown Execution 13 | 14 | 15 | *** Test Cases *** 16 | 17 | Verify Power Control Consumed Watts 18 | [Documentation] Verify there are no invalid power control consumed watt records. 19 | [Tags] Verify_Power_Control_Consumed_Watts 20 | [Template] Verify Power Metric Records 21 | 22 | # record_type redfish_uri reading_type 23 | PowerControl ${REDFISH_CHASSIS_POWER_URI} PowerConsumedWatts 24 | 25 | 26 | *** Keywords *** 27 | 28 | Verify Power Metric Records 29 | [Documentation] Verify the power metric records. 30 | [Arguments] ${record_type} ${redfish_uri} ${reading_type} 31 | 32 | # Description of Arguments(s): 33 | # record_type The sensor record type (e.g. "PowerControl") 34 | # redfish_uri The power supply URI (e.g. /redfish/v1/Chassis/chassis/Power) 35 | # reading_type The power metric readings (e.g. "PowerConsumedWatts") 36 | 37 | Verify Valid Records ${record_type} ${redfish_uri} ${reading_type} 38 | 39 | ${records}= Redfish.Get Attribute ${redfish_uri} ${record_type} 40 | 41 | ${invalid_records}= Evaluate 42 | ... [x for x in ${records} if not x['${reading_type}'] <= x['PowerMetrics']['MaxConsumedWatts']] 43 | 44 | Valid Length invalid_records max_length=0 45 | 46 | 47 | Suite Teardown Execution 48 | [Documentation] Do the post suite teardown. 49 | 50 | Redfish.Logout 51 | 52 | 53 | Suite Setup Execution 54 | [Documentation] Do test case setup tasks. 55 | 56 | Printn 57 | Redfish Power On stack_mode=skip 58 | Redfish.Login 59 | 60 | 61 | Test Teardown Execution 62 | [Documentation] Do the post test teardown. 63 | 64 | FFDC On Test Case Fail 65 | -------------------------------------------------------------------------------- /redfish/systems/test_power_voltage_readings.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Getting the systems power sensor readings for voltages. 3 | 4 | Resource ../../lib/bmc_redfish_resource.robot 5 | Resource ../../lib/bmc_redfish_utils.robot 6 | Resource ../../lib/openbmc_ffdc.robot 7 | Library ../../lib/gen_robot_valid.py 8 | 9 | Suite Setup Suite Setup Execution 10 | Suite Teardown Suite Teardown Execution 11 | Test Setup Printn 12 | Test Teardown Test Teardown Execution 13 | 14 | 15 | *** Test Cases *** 16 | 17 | Get Power Sensor Voltage Records 18 | [Documentation] Get the power voltage records. 19 | [Tags] Get_Power_Sensor_Voltage_Records 20 | [Template] Get Voltage Records and Verify 21 | 22 | # record_type reading_type 23 | Voltages ReadingVolts 24 | 25 | 26 | *** Keywords *** 27 | 28 | Get Voltage Records and Verify 29 | [Documentation] Get the power records for voltages. 30 | [Arguments] ${record_type} ${reading_type} 31 | 32 | # Description of Arguments(s): 33 | # record_type The sensor record type (e.g. "Voltages") 34 | # reading_type The power voltage readings (e.g. "ReadingVolts") 35 | 36 | # A valid record will have "State" key "Enabled" and "Health" key "OK" 37 | ${records}= Redfish.Get Attribute 38 | ... ${REDFISH_CHASSIS_POWER_URI} ${record_type} 39 | 40 | ${num_records}= Get Length ${records} 41 | Rprint Vars num_records records fmt=terse 42 | 43 | ${invalid_records}= Filter Struct ${records} 44 | ... [('Health', '^OK$'), ('State', '^Enabled$'), ('${reading_type}', '')] regex=1 invert=1 45 | ${num_invalid_records}= Get Length ${invalid_records} 46 | 47 | IF ${num_invalid_records} > ${0} 48 | Rprint Vars num_invalid_records invalid_records fmt=terse 49 | END 50 | Valid Value num_invalid_records valid_values=[0] 51 | 52 | ${cmd} Catenate [x for x in ${records} 53 | ... if not x['LowerThresholdNonCritical'] <= x['ReadingVolts'] <= x['UpperThresholdNonCritical']] 54 | ${invalid_records}= Evaluate ${cmd} 55 | 56 | ${num_invalid_records}= Get Length ${invalid_records} 57 | IF ${num_invalid_records} > ${0} 58 | Rprint Vars num_invalid_records invalid_records fmt=terse 59 | END 60 | 61 | Valid Value num_invalid_records valid_values=[0] 62 | 63 | 64 | Suite Teardown Execution 65 | [Documentation] Do the post suite teardown. 66 | 67 | Redfish.Logout 68 | 69 | 70 | Suite Setup Execution 71 | [Documentation] Do test case setup tasks. 72 | 73 | Printn 74 | Redfish Power On stack_mode=skip 75 | Redfish.Login 76 | 77 | 78 | Test Teardown Execution 79 | [Documentation] Do the post test teardown. 80 | 81 | FFDC On Test Case Fail 82 | -------------------------------------------------------------------------------- /redfish/test_xit.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This suite is to run some test at the end of execution. 3 | 4 | Resource ../lib/resource.robot 5 | Resource ../lib/bmc_redfish_resource.robot 6 | Resource ../lib/openbmc_ffdc.robot 7 | 8 | Test Teardown Test Teardown Execution 9 | 10 | *** Variables *** 11 | 12 | # Error strings to check from journald. 13 | ${ERROR_REGEX} SEGV|core-dump|FAILURE|Failed to start|Found ordering cycle 14 | ${SKIP_ERROR} ${EMPTY} 15 | 16 | 17 | *** Test Cases *** 18 | 19 | Verify No BMC Dump And Application Failures In BMC 20 | [Documentation] Verify no BMC dump and application failure exists in BMC. 21 | [Tags] Verify_No_BMC_Dump_And_Application_Failures_In_BMC 22 | 23 | # Check dump entry based on Redfish API availability. 24 | Redfish.Login 25 | ${resp}= Redfish.Get /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries 26 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}] 27 | 28 | Log To Console ${resp} 29 | 30 | IF '${resp.status}' == '${HTTP_OK}' 31 | Should Be Equal As Strings ${resp.dict["Members@odata.count"]} 0 32 | ... msg=${resp.dict["Members@odata.count"]} dumps exist. 33 | END 34 | 35 | Check For Regex In Journald ${ERROR_REGEX} error_check=${0} boot=-b filter_string=${SKIP_ERROR} 36 | 37 | 38 | *** Keywords *** 39 | 40 | Test Teardown Execution 41 | [Documentation] Do test teardown operation. 42 | 43 | FFDC On Test Case Fail 44 | # Remove rm command once the BMC dump APIs are working. 45 | Run Keyword And Ignore Error BMC Execute Command rm -rf /var/lib/phosphor-debug-collector/dumps/ 46 | Run Keyword And Ignore Error Redfish Delete All BMC Dumps 47 | Run Keyword And Ignore Error Redfish Delete All System Dumps 48 | -------------------------------------------------------------------------------- /redfish/update_service/test_firmware_property.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Verify that firmware update properties. 3 | 4 | Resource ../../lib/resource.robot 5 | Resource ../../lib/bmc_redfish_resource.robot 6 | Resource ../../lib/openbmc_ffdc.robot 7 | Library ../../lib/gen_robot_valid.py 8 | 9 | Suite Setup Redfish.Login 10 | Suite Teardown Redfish.Logout 11 | Test Setup Printn 12 | Test Teardown FFDC On Test Case Fail 13 | 14 | Test Tags Firmware_Property 15 | 16 | *** Test Cases *** 17 | 18 | Verify Firmware Update ApplyTime Immediate 19 | [Documentation] Verify supported apply time "Immediate" property. 20 | [Tags] Verify_Firmware_Update_ApplyTime_Immediate 21 | 22 | # Example: 23 | # /redfish/v1/UpdateService 24 | # "HttpPushUriOptions": { 25 | # "HttpPushUriApplyTime": { 26 | # "ApplyTime": "Immediate" 27 | # } 28 | # } 29 | 30 | Redfish.Patch ${REDFISH_BASE_URI}UpdateService 31 | ... body={'HttpPushUriOptions' : {'HttpPushUriApplyTime' : {'ApplyTime' : 'Immediate'}}} 32 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}] 33 | 34 | ${http_push_uri_options}= Redfish.Get Attribute ${REDFISH_BASE_URI}UpdateService HttpPushUriOptions 35 | Rprint Vars http_push_uri_options 36 | Valid Value http_push_uri_options["HttpPushUriApplyTime"]["ApplyTime"] ['Immediate'] 37 | 38 | 39 | Verify Firmware Update ApplyTime OnReset 40 | [Documentation] Verify supported apply time "OnReset" property. 41 | [Tags] Verify_Firmware_Update_ApplyTime_OnReset 42 | 43 | # Example: 44 | # /redfish/v1/UpdateService 45 | # "HttpPushUriOptions": { 46 | # "HttpPushUriApplyTime": { 47 | # "ApplyTime": "OnReset" 48 | # } 49 | # } 50 | 51 | Redfish.Patch ${REDFISH_BASE_URI}UpdateService 52 | ... body={'HttpPushUriOptions' : {'HttpPushUriApplyTime' : {'ApplyTime' : 'OnReset'}}} 53 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}] 54 | 55 | ${http_push_uri_options}= Redfish.Get Attribute ${REDFISH_BASE_URI}UpdateService HttpPushUriOptions 56 | Rprint Vars http_push_uri_options 57 | Valid Value http_push_uri_options["HttpPushUriApplyTime"]["ApplyTime"] ['OnReset'] 58 | 59 | 60 | Verify Firmware Update ApplyTime Invalid 61 | [Documentation] Verify supported apply time returns error on invalid value. 62 | [Tags] Verify_Firmware_Update_ApplyTime_Invalid 63 | 64 | Redfish.Patch ${REDFISH_BASE_URI}UpdateService 65 | ... body={'HttpPushUriOptions' : {'HttpPushUriApplyTime' : {'ApplyTime' : 'Invalid'}}} 66 | ... valid_status_codes=[${HTTP_BAD_REQUEST}] 67 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | robotframework==7.2.2 2 | paramiko>=2.5.0 3 | requests 4 | robotframework-requests 5 | robotframework-jsonlibrary 6 | robotframework-sshlibrary 7 | robotframework-scplibrary 8 | robotframework-httplibrary 9 | redfish>=3.1.7 10 | redfishtool>=1.1.8 11 | -------------------------------------------------------------------------------- /requirements_optional.txt: -------------------------------------------------------------------------------- 1 | aenum==3.1.15 2 | colorama==0.4.6 3 | pyasn1==0.6.1 4 | pyasn1_modules==0.4.1 5 | requests==2.32.3 6 | sseclient-py==1.8.0 7 | urllib3==1.26.20 8 | 9 | -------------------------------------------------------------------------------- /security/test_bmcweb_security.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Test bmc web vulnerability. 3 | 4 | Resource ../lib/resource.robot 5 | Resource ../lib/bmc_redfish_resource.robot 6 | Resource ../lib/openbmc_ffdc.robot 7 | 8 | Test Setup Test Setup Execution 9 | Test Teardown FFDC On Test Case Fail 10 | 11 | Test Tags BMCweb_Security 12 | 13 | *** Variables *** 14 | 15 | ${LOOP_COUNT} 4 16 | 17 | *** Test Cases *** 18 | 19 | Check BMCWeb Service After Attempted GET With Invalid URL 20 | [Documentation] Request BMC GET with invalid URL. 21 | [Tags] Check_BMCWeb_Service_After_Attempted_GET_With_Invalid_URL 22 | 23 | ${invalid_url}= Set Variable https://${OPENBMC_HOST}:${HTTPS_PORT}/'redfish\\[' 24 | 25 | # Exhaust bmcweb restart policy by crashing 4 times in succession. 26 | Repeat Keyword ${LOOP_COUNT} times Run ${curl_tool} -k ${invalid_url} 27 | 28 | # This should fail, if bmcweb is crashed. 29 | Redfish.Login 30 | 31 | *** Keywords *** 32 | 33 | Test Setup Execution 34 | [Documentation] Do test setup execution. 35 | 36 | ${cmd_tool}= Run which curl 37 | Should Contain ${cmd_tool} curl 38 | Set Test Variable ${curl_tool} ${cmd_tool} 39 | -------------------------------------------------------------------------------- /security/test_ssl.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This testsuite is for testing SSL connection to OpenBMC. 3 | Suite Teardown Delete All Sessions 4 | 5 | Resource ../lib/rest_client.robot 6 | Resource ../lib/resource.robot 7 | Resource ../lib/openbmc_ffdc.robot 8 | Test Teardown FFDC On Test Case Fail 9 | 10 | *** Test Cases *** 11 | 12 | Test SSL Connection 13 | [Documentation] This testcase is for testing the SSL connection to the 14 | ... OpenBMC machine. 15 | [Tags] Test_SSL_Connection 16 | Initialize OpenBMC 17 | 18 | Test Non SSL Connection To Port 80 19 | [Documentation] Test that OpenBMC machine does not accept the non-secure 20 | ... http connection at port 80 and would expect a connection error. 21 | [Tags] Test_Non_SSL_Connection_To_Port_80 22 | 23 | Create Session openbmc http://${OPENBMC_HOST}/ timeout=3 24 | Run Keyword And Expect Error *ConnectTimeoutError* GET On Session openbmc /list 25 | 26 | Test Non SSL Connection To HTTPS Port 27 | [Documentation] Test that OpenBmc does not accept the non-secure 28 | ... http connection at port ${HTTPS_PORT} and would expect a connection error. 29 | [Tags] Test_Non_SSL_Connection_To_HTTPS_Port 30 | 31 | Create Session openbmc http://${OPENBMC_HOST}:${HTTPS_PORT}/ timeout=3 32 | Run Keyword And Expect Error ConnectionError* GET On Session openbmc /list 33 | -------------------------------------------------------------------------------- /systest/proc_freq_check.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | Documentation Check processor speed. 4 | 5 | # Test Parameters: 6 | # OPENBMC_HOST The BMC host name or IP address. 7 | # OS_HOST The OS host name or IP Address. 8 | # OS_USERNAME The OS login userid (usually root). 9 | # OS_PASSWORD The password for the OS login. 10 | 11 | Resource ../lib/os_utilities.robot 12 | 13 | Suite Setup Run Keyword Start SOL Console Logging 14 | Test Setup Test Setup Execution 15 | Test Teardown Test Teardown Execution 16 | 17 | Test Tags Proc_Freq_Check 18 | 19 | *** Test Cases *** 20 | 21 | Processor Speed Check 22 | [Documentation] Check processor speed. 23 | [Tags] Processor_Speed_Check 24 | 25 | ${actual_min_freq}= Get CPU Min Frequency 26 | ${min_freq_designated_lower_limit}= Get CPU Min Frequency Limit 27 | 28 | Printn 29 | Rpvars actual_min_freq min_freq_designated_lower_limit 30 | 31 | ${err_msg}= Catenate Reported CPU frequency below designated limit. 32 | Should Be True ${actual_min_freq} >= ${min_freq_designated_lower_limit} 33 | ... msg=${err_msg} 34 | 35 | ${actual_max_freq}= Get CPU Max Frequency 36 | ${max_freq_designated_limit}= Get CPU Max Frequency Limit 37 | 38 | Rpvars actual_max_freq max_freq_designated_limit 39 | 40 | ${err_msg}= Catenate Reported CPU frequency above designated limit. 41 | Should Be True ${actual_max_freq} <= ${max_freq_designated_limit} 42 | ... msg=${err_msg} 43 | 44 | Error Logs Should Not Exist 45 | 46 | 47 | *** Keywords *** 48 | 49 | Test Setup Execution 50 | [Documentation] Do the pre-test setup. 51 | 52 | REST Power On stack_mode=skip 53 | Delete All Error Logs 54 | Tool Exist ppc64_cpu 55 | Tool Exist lscpu 56 | 57 | 58 | Test Teardown Execution 59 | [Documentation] Do the post-test teardown. 60 | 61 | ${keyword_buf}= Catenate Stop SOL Console Logging 62 | ... \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log 63 | Run Key ${keyword_buf} 64 | 65 | FFDC On Test Case Fail 66 | Power Off Host 67 | Close All Connections 68 | -------------------------------------------------------------------------------- /systest/test_bmc_poll_errors.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation BMC error polling test to check errors every 10 seconds. 3 | 4 | Resource ../lib/rest_client.robot 5 | Resource ../lib/openbmc_ffdc.robot 6 | Resource ../lib/resource.robot 7 | Resource ../lib/boot_utils.robot 8 | Resource ../lib/bmc_redfish_resource.robot 9 | Resource ../lib/esel_utils.robot 10 | 11 | Suite Setup Suite Setup Execution 12 | Test Teardown Post Test Case Execution 13 | 14 | Test Tags BMC_Poll_Errors 15 | 16 | *** Variables *** 17 | 18 | # Default duration and interval of test to run. 19 | ${POLL_DURATION} 48 hours 20 | ${POLL_INTERVAL} 10 second 21 | 22 | # Error log Severities to ignore when checking Error Logs. 23 | @{ESEL_IGNORE_LIST} 24 | ... xyz.openbmc_project.Logging.Entry.Level.Informational 25 | 26 | 27 | *** Test Cases *** 28 | 29 | Poll BMC For Errors 30 | [Documentation] Poll BMC for errors. 31 | ... exist. 32 | [Tags] Poll_BMC_For_Errors 33 | 34 | Redfish.Login 35 | Repeat Keyword ${POLL_DURATION} Perform GET Request And Check For Errors 36 | 37 | 38 | *** Keywords *** 39 | 40 | Perform GET Request And Check For Errors 41 | [Documentation] Check if there is any error reported. 42 | 43 | Redfish.Get /redfish/v1/Chassis/${CHASSIS_ID}/Sensors 44 | 45 | Event Log Should Not Exist 46 | Sleep ${POLL_INTERVAL} 47 | 48 | 49 | Suite Setup Execution 50 | [Documentation] Do test setup initialization. 51 | 52 | Should Not Be Empty 53 | ... ${OS_HOST} msg=You must provide hostname or IP of the OS host. 54 | Should Not Be Empty 55 | ... ${OS_USERNAME} msg=You must provide OS host user name. 56 | Should Not Be Empty 57 | ... ${OS_PASSWORD} msg=You must provide OS host user password. 58 | 59 | Redfish Power On stack_mode=skip 60 | 61 | Run Keyword And Ignore Error Redfish Purge Event Log 62 | Run Keyword And Ignore Error Redfish Delete All BMC Dumps 63 | 64 | 65 | Post Test Case Execution 66 | [Documentation] Do the post test teardown. 67 | ... 1. Capture FFDC on test failure. 68 | 69 | FFDC On Test Case Fail 70 | Redfish.Logout 71 | -------------------------------------------------------------------------------- /templates/bash_simple_template: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Template to start a simple bash program. This is designed only for the 4 | # simplest of programs where all program parameters are positional, there is no 5 | # help text, etc. 6 | 7 | # Description of argument(s): 8 | # parm1 Bla, bla, bla (e.g. "example data"). 9 | 10 | 11 | function get_parms() { 12 | 13 | # Get program parms. 14 | 15 | parm1="${1}" ; shift 16 | 17 | return 0 18 | 19 | } 20 | 21 | 22 | function exit_function() { 23 | 24 | return 25 | 26 | } 27 | 28 | function validate_parms() { 29 | 30 | # Validate program parameters. 31 | 32 | # Your validation code here. 33 | 34 | if [ -z "${parm1}" ] ; then 35 | echo "**ERROR** You must provide..." >&2 36 | return 1 37 | fi 38 | 39 | trap "exit_function $signal \$?" EXIT 40 | 41 | return 0 42 | 43 | } 44 | 45 | 46 | function mainf() { 47 | 48 | get_parms "$@" || return 1 49 | 50 | validate_parms || return 1 51 | 52 | # Your code here... 53 | 54 | return 0 55 | 56 | } 57 | 58 | 59 | # Main 60 | 61 | mainf "${@}" 62 | rc="${?}" 63 | exit "${rc}" 64 | -------------------------------------------------------------------------------- /templates/pgm_template.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | This module is the python counterpart to pgm_template.py. 5 | """ 6 | 7 | import gen_print as gp 8 | import gen_robot_valid as grv 9 | 10 | 11 | def suite_setup(): 12 | r""" 13 | Do test suite setup tasks. 14 | """ 15 | 16 | gp.qprintn() 17 | 18 | validate_suite_parms() 19 | 20 | gp.qprint_pgm_header() 21 | 22 | 23 | def test_setup(): 24 | r""" 25 | Do test case setup tasks. 26 | """ 27 | 28 | gp.qprintn() 29 | gp.qprint_executing() 30 | 31 | 32 | def validate_suite_parms(): 33 | r""" 34 | Validate suite parameters. 35 | """ 36 | 37 | # Programmer must add these. 38 | grv.valid_value("OPENBMC_HOST") 39 | 40 | return 41 | 42 | 43 | def suite_teardown(): 44 | r""" 45 | Clean up after this program. 46 | """ 47 | 48 | gp.qprint_pgm_footer() 49 | -------------------------------------------------------------------------------- /templates/pgm_template.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | # Copy this template as a base to get a start on a robot program. 4 | # You may remove any generic comments (like this one). 5 | 6 | # Note: This is a template base code structure and not meant to 7 | # work as it is directly without modification. 8 | 9 | Documentation Base to get a start on a robot program. 10 | 11 | Library pgm_template.py 12 | Library gen_print.py 13 | Library gen_robot_print.py 14 | Library gen_robot_valid.py 15 | Resource bmc_redfish_resource.robot 16 | 17 | # Write your own keyword(s) for setup and teardown 18 | Suite Setup Suite Setup 19 | Suite Teardown Suite Teardown 20 | Test Setup Test Setup 21 | 22 | *** Variables *** 23 | # Initialize program parameters variables. 24 | # Create parm_list containing all of our program parameters. 25 | @{parm_list} TEST_MODE QUIET DEBUG 26 | 27 | # Initialize each program parameter. 28 | ${TEST_MODE} 0 29 | ${QUIET} 0 30 | ${DEBUG} 0 31 | 32 | 33 | *** Test Cases *** 34 | Test Case 1 35 | [Documentation] Test case 1 documentation. 36 | [Tags] Test_Case_1 37 | 38 | Log To Console First test case. 39 | -------------------------------------------------------------------------------- /templates/pgm_template.tcl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #\ 3 | exec wish "$0" -- ${1+"$@"} 4 | 5 | source [exec bash -c "which source.tcl"] 6 | my_source [list print.tcl opt.tcl] 7 | 8 | longoptions test_mode:=0 quiet:=0 9 | pos_parms 10 | 11 | 12 | # Create help dictionary for call to gen_print_help. 13 | set help_dict [dict create\ 14 | ${program_name} [list "${program_name} will..."]\ 15 | ] 16 | 17 | 18 | proc help {} { 19 | 20 | gen_print_help 21 | 22 | } 23 | 24 | 25 | proc exit_proc { {ret_code 0} } { 26 | 27 | # Execute whenever the program ends normally or with the signals that we catch (i.e. TERM, INT). 28 | 29 | dprint_executing 30 | dprint_var ret_code 31 | 32 | # Your code here. 33 | 34 | qprint_pgm_footer 35 | 36 | exit $ret_code 37 | 38 | } 39 | 40 | 41 | proc validate_parms {} { 42 | 43 | trap { exit_proc } [list SIGTERM SIGINT] 44 | 45 | # Your code here. 46 | 47 | } 48 | 49 | 50 | # Main 51 | 52 | gen_get_options $argv 53 | 54 | validate_parms 55 | 56 | qprint_pgm_header 57 | 58 | exit_proc 59 | -------------------------------------------------------------------------------- /templates/python_pgm_template: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from gen_arg import * 4 | from gen_print import * 5 | from gen_valid import * 6 | 7 | parser = argparse.ArgumentParser( 8 | usage="%(prog)s [OPTIONS]", 9 | description="%(prog)s will...", 10 | formatter_class=argparse.ArgumentDefaultsHelpFormatter, 11 | prefix_chars="-+", 12 | ) 13 | 14 | parser.add_argument("--whatever", default="", help="bla, bla.") 15 | 16 | # Populate stock_list with options we want. 17 | stock_list = [("test_mode", 0), ("quiet", 0), ("debug", 0)] 18 | 19 | 20 | def exit_function(): 21 | r""" 22 | Execute whenever the program ends normally or with the signals that we catch (i.e. TERM, INT). This 23 | function will be called by gen_exit_function(). 24 | """ 25 | 26 | # If you have no cleanup to do, you can delete this function altogether. 27 | 28 | # Your cleanup code here. 29 | 30 | 31 | def validate_parms(): 32 | r""" 33 | Validate program parameters, etc. This function will be called by gen_setup(). 34 | """ 35 | 36 | # If you have no validation to do, you can delete this function altogether. 37 | 38 | # Your validation code here... 39 | # valid_value(whatever) 40 | 41 | 42 | def main(): 43 | gen_setup() 44 | 45 | # Your code here. 46 | 47 | 48 | main() 49 | -------------------------------------------------------------------------------- /templates/test_openbmc_setup.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Test suite to verify if the Robot setup is ready for use. 3 | 4 | Resource ../lib/resource.robot 5 | Resource ../lib/connection_client.robot 6 | Resource ../lib/ipmi_client.robot 7 | Resource ../lib/bmc_redfish_resource.robot 8 | 9 | Test Tags Openbmc_Setup 10 | 11 | *** Variables *** 12 | 13 | ${REDFISH_SUPPORT_TRANS_STATE} ${1} 14 | 15 | *** Test Cases *** 16 | 17 | Test Redfish Setup 18 | [Documentation] Verify Redfish works. 19 | [Tags] Test_Redfish_Setup 20 | 21 | Redfish.Login 22 | Redfish.Get /redfish/v1/ 23 | Redfish.Logout 24 | 25 | 26 | Test SSH Setup 27 | [Documentation] Verify SSH works. 28 | [Tags] Test_SSH_Setup 29 | 30 | ${stdout} ${stderr} ${rc}= BMC Execute Command uname -a print_out=1 print_err=1 31 | IF ${rc} 32 | Fail BMC SSH login failed. 33 | END 34 | 35 | 36 | Test IPMI Setup 37 | [Documentation] Verify Out-of-band works. 38 | [Tags] Test_IPMI_Setup 39 | 40 | ${chassis_status}= Run IPMI Standard Command chassis status 41 | Log To Console \n ${chassis_status} 42 | -------------------------------------------------------------------------------- /test_lists/BMC_WEB_CI: -------------------------------------------------------------------------------- 1 | #Basic GUI operations 2 | --include Verify_IP_address 3 | --include Verify_Select_Health_Status_From_Server_Health 4 | --include Verify_Event_Log_Text_Appears_By_Clicking_Server_Health 5 | --include OpenBMC GUI Logoff 6 | -------------------------------------------------------------------------------- /test_lists/CT_basic_run: -------------------------------------------------------------------------------- 1 | # Redfish Test. 2 | --include Redfish_Login_And_Logout 3 | --include Redfish_Login_Using_Unsecured_HTTP 4 | --include Login_And_Verify_HTTP_Response_Header 5 | # Local user management 6 | --include Verify_AccountService_Available 7 | --include Verify_IPMI_User_Summary 8 | --include Create_Admin_Redfish_User_And_Verify_Login_Via_IPMI 9 | #REST SSL connection test 10 | --include Test_SSL_Connection 11 | #Basic REST test 12 | --include REST_Login_Session_To_BMC 13 | --include Verify_REST_JSON_Data_On_Success 14 | --include Verify_REST_JSON_Data_On_Failure 15 | #Basic poweron test 16 | --include Verify_Front_And_Rear_LED_At_Standby 17 | --include Verify_Redfish_Host_PowerOn 18 | --include Verify_Redfish_Host_PowerOff 19 | # Check for apps failures 20 | --include Check_For_Application_Failures 21 | #Power test via IPMI external 22 | --include Verify_SOL_During_Boot 23 | --include Verify_Host_PowerOff_Via_IPMI 24 | --include Verify_Deactivate_Non_Existing_SOL 25 | # IPMI SEL 26 | --include Verify_IPMI_SEL_Version 27 | --include Get_System_Time 28 | # Redfish Date Time 29 | --include Verify_Redfish_BMC_Time 30 | #Power restore. 31 | --include Test_Restore_Policy_ALWAYS_POWER_OFF_With_Host_Off 32 | #Inventory 33 | --include Get_Processor_Inventory_Via_Redfish_And_Verify 34 | #Sensors 35 | --include Get_Ambient_Temperature_Records 36 | #Certificate via Open SSL 37 | --include Verify_Server_Certificate_View_Via_Openssl 38 | #BMC sync list test 39 | --include Test_BMC_Alt_Side_Mirroring 40 | # Check for BMC dump. 41 | --include Verify_No_BMC_Dump_And_Application_Failures_In_BMC 42 | -------------------------------------------------------------------------------- /test_lists/HW_CI: -------------------------------------------------------------------------------- 1 | #Verify SSH and IPMI interfaces 2 | --include Test_SSH_And_IPMI_Connections 3 | #Basic poweron test 4 | --include Verify_Redfish_Host_PowerOn 5 | --include Verify_Redfish_Host_PowerOff 6 | #Check for apps failures. 7 | --include Check_For_Application_Failures 8 | #Verify system boot time average 9 | --include Verify_Uptime_Average_Against_Threshold 10 | #Redfish tests cases. 11 | --include Redfish_Login_And_Logout 12 | --include GET_Redfish_Resources_With_Login 13 | --include GET_Redfish_SessionService_Without_Login 14 | --include Redfish_Login_Using_Invalid_Token 15 | --include Delete_Redfish_Session_Using_Valid_Login 16 | --include Redfish_Login_With_Invalid_Credentials 17 | --include Redfish_Login_Using_Unsecured_HTTP 18 | --include Verify_Update_Service_Enabled 19 | --include Verify_Redfish_Software_Inventory_Collection 20 | --include Redfish_Software_Inventory_Status_Check 21 | #IPMI tests. 22 | --include Enable_IPMI_User_And_Verify 23 | --include Verify_IPMI_User_Deletion 24 | #Local user tests. 25 | --include Verify_AccountService_Available 26 | #Check for BMC dump. 27 | --include Verify_No_BMC_Dump_And_Application_Failures_In_BMC 28 | -------------------------------------------------------------------------------- /test_lists/HW_CI_DEV: -------------------------------------------------------------------------------- 1 | #Verify SSH and IPMI interfaces 2 | --include Test_SSH_And_IPMI_Connections 3 | #Basic poweron test 4 | --include Verify_Redfish_Host_PowerOn 5 | --include Verify_Redfish_Host_PowerOff 6 | #Check for apps failures. 7 | --include Check_For_Application_Failures 8 | #Verify system boot time average 9 | --include Verify_Uptime_Average_Against_Threshold 10 | #Redfish tests cases. 11 | --include Redfish_Login_And_Logout 12 | --include GET_Redfish_Resources_With_Login 13 | --include GET_Redfish_SessionService_Without_Login 14 | --include Redfish_Login_Using_Invalid_Token 15 | --include Delete_Redfish_Session_Using_Valid_Login 16 | --include Redfish_Login_With_Invalid_Credentials 17 | --include Redfish_Login_Using_Unsecured_HTTP 18 | --include Verify_Update_Service_Enabled 19 | --include Verify_Redfish_Software_Inventory_Collection 20 | --include Redfish_Software_Inventory_Status_Check 21 | #IPMI tests. 22 | --include Enable_IPMI_User_And_Verify 23 | --include Verify_IPMI_User_Deletion 24 | #Local user tests. 25 | --include Verify_AccountService_Available 26 | #Check for BMC dump. 27 | --include Verify_No_BMC_Dump_And_Application_Failures_In_BMC 28 | -------------------------------------------------------------------------------- /test_lists/HW_CI_NETWORK: -------------------------------------------------------------------------------- 1 | --include Add_Valid_IPv4_Address_And_Verify 2 | # TODO: Debugging system bricked by thus test case. 3 | #--include Modify_IPv4_Address_And_Verify 4 | --include Add_Valid_IPv4_Address_And_Check_Persistency 5 | --include Configure_And_Verify_Multiple_Static_IPv4_Addresses 6 | --include Configure_Hostname_And_Verify 7 | --include Configure_DNS_Server_And_Verify 8 | --include Delete_DNS_Server_And_Verify 9 | -------------------------------------------------------------------------------- /test_lists/QEMU_CI: -------------------------------------------------------------------------------- 1 | #Verify SSH and IPMI interfaces 2 | --include Test_SSH_And_IPMI_Connections 3 | #Check for apps failures. 4 | --include Check_For_Application_Failures 5 | #Redfish tests cases. 6 | --include Redfish_Login_And_Logout 7 | --include GET_Redfish_Resources_With_Login 8 | --include GET_Redfish_SessionService_Without_Login 9 | --include Redfish_Login_Via_SessionService 10 | --include Redfish_Login_Using_Invalid_Token 11 | --include Delete_Redfish_Session_Using_Valid_Login 12 | --include Redfish_Login_With_Invalid_Credentials 13 | --include Verify_Update_Service_Enabled 14 | --include Verify_Redfish_Software_Inventory_Collection 15 | --include Redfish_Software_Inventory_Status_Check 16 | # openbmc/bmcweb#264 --include Verify_Redfish_BMC_Time 17 | --include Verify_Redfish_Invalid_URL_Response_Code 18 | #IPMI tests. 19 | --include Enable_IPMI_User_And_Verify 20 | --include Verify_IPMI_User_Deletion 21 | --include Verify_IPMI_SEL_Version 22 | --include Test_Get_Self_Test_Results_via_IPMI_Raw_Command 23 | --include Test_Get_Device_GUID_Via_IPMI_Raw_Command 24 | #Local user tests. 25 | --include Verify_AccountService_Available 26 | #Check for BMC dump. 27 | --include Verify_No_BMC_Dump_And_Application_Failures_In_BMC 28 | -------------------------------------------------------------------------------- /test_lists/WEBUI_CI: -------------------------------------------------------------------------------- 1 | #Basic GUI operations 2 | --include Verify_Header_Text 3 | --include Verify_GUI_Logout 4 | -------------------------------------------------------------------------------- /test_lists/skip_test_palmetto: -------------------------------------------------------------------------------- 1 | # https://github.com/openbmc/openbmc/issues/93 2 | --exclude System_Present 3 | --exclude Chassis_Present 4 | # https://github.com/openbmc/openbmc-test-automation/issues/207 5 | --exclude Disable_PowerCap 6 | # https://github.com/openbmc/openbmc-test-automation/issues/123 7 | --exclude Execute_ipmi_BT_capabilities_command 8 | ##Testcase NA for Palmetto system 9 | --exclude io_board_Present 10 | --exclude io_board_Fault 11 | --exclude Verify_Enabling_OCC_Turbo_Setting_Via_IPMI 12 | --exclude Verify_Disabling_OCC_Turbo_Setting_Via_IPMI 13 | --exclude Verify_Setting_OCC_Turbo_Via_REST 14 | # https://github.com/openbmc/openbmc/issues/901 15 | --exclude Set_BMC_Time_With_Split_And_Manual 16 | # https://github.com/openbmc/openbmc/issues/1142 17 | --exclude Check_BMC_Name_Property_Is_Set 18 | # https://github.com/openbmc/openbmc-test-automation/issues/396 19 | --exclude NetworkManager 20 | # Test cases are NA for Palmetto 21 | --exclude LED_Group 22 | --exclude Check_BMC_GPIO_FSI_Name_Property_Is_Set 23 | --exclude Check_BMC_GPIO_FSI_Compatible_Property_Is_Set 24 | --exclude Check_BMC_GPIO_keys_Name_Property_Is_Set 25 | --exclude Check_BMC_GPIO_keys_Compatible_Property_Is_Set 26 | --exclude Check_BMC_IIO-HWMON_Name_Property_Is_Set 27 | --exclude Check_BMC_IIO-HWMON_Compatible_Property_Is_Set 28 | # https://github.com/openbmc/openbmc-test-automation/issues/546 29 | --exclude CPU_Present 30 | --exclude DIMM3_Present 31 | # System LED test cases which are NA for Palmetto system. 32 | --exclude Test_Beep_LED_And_Verify_Via_REST 33 | --exclude Test_Fault_LED_And_Verify_Via_REST 34 | --exclude Test_Rear_Identify_LED_And_Verify_Via_REST 35 | --exclude Verify_Enclosure_Fault_LED_On_Assertion 36 | --exclude Verify_Rear_Power_LED_Association_With_Group_LED 37 | # Network tests for xyz interface. 38 | # https://github.com/openbmc/openbmc-test-automation/issues/729 39 | --exclude Network_Test 40 | # FSI Related Test Cases NA for Palmetto System. 41 | --exclude Verify_Enabling_OCC_Turbo_Setting_Via_IPMI 42 | --exclude Verify_Disabling_OCC_Turbo_Setting_Via_IPMI 43 | --exclude Verify_Setting_OCC_Turbo_Via_REST 44 | --exclude Check_BMC_FSI_Compatible_Property_Is_Set 45 | --exclude Check_BMC_FSI_Name_Property_Is_Set 46 | # Applicable only for witherspoon 47 | --exclude Verify_Boxelder_Present_Property 48 | --exclude Verify_Boxelder_MAC_Address_Property_Is_Populated 49 | # https://github.com/openbmc/openbmc-test-automation/issues/1411 50 | --exclude Check_BMC_Memory_Name_Property_Is_Set 51 | --exclude Check_BMC_Memory_Device_Type_Property_Is_Set 52 | -------------------------------------------------------------------------------- /test_lists/witherspoon/skip_inband_ipmi: -------------------------------------------------------------------------------- 1 | #Skipping inband IPMI test cases to run all out-of-band IPMI test cases 2 | --exclude Verify_Disabling_And_Enabling_IPMI_Via_Host 3 | --exclude Verify_Disabling_IPMI_Via_OOB_IPMI 4 | --exclude Verify_IPMI_Disable_Persistency_After_BMC_Reboot 5 | --exclude eSEL 6 | -------------------------------------------------------------------------------- /test_lists/witherspoon/skip_oob_ipmi: -------------------------------------------------------------------------------- 1 | #Skipping out-of-band IPMI test cases to run all inband IPMI test cases 2 | --exclude Verify_Disabling_And_Enabling_IPMI_Via_Host 3 | --exclude Verify_Disabling_IPMI_Via_OOB_IPMI 4 | --exclude Verify_IPMI_Disable_Persistency_After_BMC_Reboot 5 | --exclude Ipmi_Sol 6 | -------------------------------------------------------------------------------- /tools/cleanup_bmc.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Cleanup user patches from BMC. 3 | 4 | Resource ../lib/bmc_cleanup.robot 5 | 6 | *** Test Cases *** 7 | 8 | Cleanup User Patches 9 | [Documentation] Do the cleanup in cleanup directory path. 10 | [Tags] Cleanup_User_Patches 11 | 12 | Cleanup Dir 13 | -------------------------------------------------------------------------------- /tools/convert_ip_to_dummy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This program will modify a file by substituting all instances of a specified 4 | # IP with "DUMMYIP". This is useful for making the IP address generic and thus 5 | # searchable. 6 | 7 | # Description of argument(s): 8 | # ip_addr An IP address. 9 | # file_path The path to a file which is to be modified. 10 | 11 | # Get arguments. 12 | ip_addr="${1}" ; shift 13 | file_path="${1}" ; shift 14 | 15 | # Validate arguments. 16 | if [ -z "${ip_addr}" ] ; then 17 | echo "**ERROR** You must provide an IP address as the first positional" \ 18 | "parameter." >&2 19 | exit 1 20 | fi 21 | 22 | if [ -z "${file_path}" ] ; then 23 | echo "**ERROR** You must provide a file path as the second positional" \ 24 | "parameter." >&2 25 | exit 1 26 | fi 27 | 28 | ip_addr_regex=`echo ${ip_addr} | sed 's/\(\.\)/\\\./g'` 29 | sed -i 's/'${ip_addr_regex}'/DUMMYIP/g' ${file_path} 30 | -------------------------------------------------------------------------------- /tools/factory_reset_bmc.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Factory reset BMC and set the network config back. 3 | 4 | # robot -v OPENBMC_HOST:xx.xx.xx.233 -v SUBNET_MASK:22 -v BMC_GW:xx.xx.xx.1 5 | # -v OPENBMC_SERIAL_HOST:xx.xx.xx.152 -v OPENBMC_SERIAL_PORT:2002 6 | # -v OPENBMC_MODEL:witherspoon factory_reset.robot 7 | 8 | Resource ../lib/resource.robot 9 | Resource ../lib/serial_connection/serial_console_client.robot 10 | Library ../lib/bmc_ssh_utils.py 11 | 12 | Test Setup Test Setup Execution 13 | 14 | *** Variables *** 15 | 16 | ${CMD_STATIC_IPV4_PREFIX} busctl call xyz.openbmc_project.Network 17 | ... /xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.IP.Create IP 18 | ... ssys "xyz.openbmc_project.Network.IP.Protocol.IPv4" 19 | 20 | ${CMD_STATIS_GW_PREFIX} busctl set-property xyz.openbmc_project.Network 21 | ... /xyz/openbmc_project/network/config 22 | ... xyz.openbmc_project.Network.SystemConfiguration DefaultGateway s 23 | 24 | 25 | *** Test Cases *** 26 | 27 | Factory Reset BMC 28 | [Documentation] Factory reset BMC and verify BMC comes back online. 29 | [Tags] Factory_Reset_BMC 30 | 31 | BMC Execute Command /usr/bin/hostnamectl set-hostname ${OPENBMC_MODEL} 32 | BMC Execute Command /sbin/fw_setenv rwreset true 33 | Execute Command On Serial Console reboot -f 34 | 35 | Sleep 4min 36 | 37 | ${cmd_ip}= Catenate ${CMD_STATIC_IPV4_PREFIX} ${OPENBMC_HOST} 38 | ... ${SUBNET_MASK} ${BMC_GW} 39 | Execute Command On Serial Console ${cmd_ip} 40 | 41 | ${cmd_gw}= Catenate ${CMD_STATIS_GW_PREFIX} ${BMC_GW} 42 | Execute Command On Serial Console ${cmd_gw} 43 | 44 | 45 | *** Keywords *** 46 | 47 | Test Setup Execution 48 | [Documentation] Check if parameters are provided. 49 | 50 | Should Not Be Empty ${OPENBMC_SERIAL_HOST} 51 | Should Not Be Empty ${OPENBMC_SERIAL_PORT} 52 | Should Not Be Empty ${OPENBMC_MODEL} 53 | Should Not Be Empty ${SUBNET_MASK} 54 | Should Not Be Empty ${BMC_GW} 55 | -------------------------------------------------------------------------------- /tools/generate_test_document: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This program will generate test documentation from the robot test cases. 4 | 5 | # Description of argument(s): 6 | # test_dir_path Test directory where robot test cases are available. 7 | # test_case_doc_file_path The test case document file path to be stored. 8 | 9 | 10 | function get_parms() { 11 | 12 | # Get program parms. 13 | 14 | test_dir_path="${1}" ; shift 15 | test_case_doc_file_path="${1}" ; shift 16 | 17 | return 0 18 | 19 | } 20 | 21 | 22 | function validate_parms() { 23 | 24 | # Validate program parameters. 25 | 26 | num_parms="${1}" ; shift 27 | 28 | (( ${num_parms} == 0 )) && return 0 29 | 30 | if [ -z "${test_dir_path}" ] ; then 31 | echo "**ERROR** You must provide test directory as the first positional" \ 32 | "parameter." >&2 33 | return 1 34 | fi 35 | 36 | if [ -z "${test_case_doc_file_path}" ] ; then 37 | echo "**ERROR** You must provide file path as the second positional" \ 38 | "parameter." >&2 39 | return 1 40 | fi 41 | 42 | return 0 43 | 44 | } 45 | 46 | 47 | function generate_all_test_document() { 48 | 49 | # Generate all test case documents 50 | 51 | local ret_code=0 52 | python3 -m robot.testdoc tests testsdirectoryTCdocs.html || ret_code=1 53 | python3 -m robot.testdoc extended extendeddirectoryTCdocs.html || ret_code=1 54 | python3 -m robot.testdoc gui guidirectoryTCdocs.html || ret_code=1 55 | python3 -m robot.testdoc systest systestdirectoryTCdocs.html || ret_code=1 56 | python3 -m robot.testdoc xcat xcatdirectoryTCdocs.html || ret_code=1 57 | python3 -m robot.testdoc mnfg mnfgdirectoryTCdocs.html || ret_code=1 58 | python3 -m robot.testdoc tools toolsdirectoryTCdocs.html || ret_code=1 59 | python3 -m robot.testdoc ./openpower/ras rasdirectoryTCdocs.html || ret_code=1 60 | python3 -m robot.testdoc ./openpower/secureboot securebootdirectoryTCdocs.html\ 61 | || ret_code=1 62 | python3 -m robot.testdoc network networkdirectoryTCdocs.html ||\ 63 | ret_code=1 64 | 65 | return ${ret_code} 66 | } 67 | 68 | 69 | function main_function() { 70 | 71 | get_parms "$@" || return 1 72 | 73 | validate_parms $# || return 1 74 | 75 | if (( ${num_parms} == 0 )) ; then 76 | generate_all_test_document || return 1 77 | return 0 78 | fi 79 | 80 | echo ${test_dir_path} ${test_case_doc_file_path} 81 | python3 -m robot.testdoc ${test_dir_path} ${test_case_doc_file_path}\ 82 | || return 1 83 | 84 | return 0 85 | 86 | } 87 | 88 | 89 | # Main 90 | 91 | main_function "${@}" 92 | rc="${?}" 93 | exit "${rc}" 94 | 95 | -------------------------------------------------------------------------------- /tools/myffdc.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This module is for triggering data collection on demand 3 | ... by manually running this robot suite. 4 | ... Usage: 5 | ... python -m robot -v OPENBMC_HOST:xx.xx.xx.xx myffdc.robot 6 | ... Logs will be generated as shown below 7 | ... logs 8 | ... └── 20161020045522673810_Myffdc 9 | ... └── 20161020045522673810_MyFFDCLogs 10 | ...    ├── 20161020045522673810_BMC_journalctl.txt 11 | ...    ├── 20161020045522673810_BMC_proc_list.txt 12 | ...     ├── 20161020045522673810_BMC_dmesg.txt 13 | ...    ├── 20161020045522673810_BMC_inventory.txt 14 | ...    ├── 20161020045522673810_BMC_led.txt 15 | ...    ├── 20161020045522673810_BMC_record_log.txt 16 | ...    ├── 20161020045522673810_BMC_sensor_list.txt 17 | ...    ├── 20161020045522673810_BMC_general.txt 18 | ...    ├── 20161020045522673810_OS_dmesg.txt 19 | ...    ├── 20161020045522673810_OS_msglog.txt 20 | ...    ├── 20161020045522673810_OS_cpufrequency.txt 21 | ...    ├── 20161020045522673810_OS_boot.txt 22 | ...    ├── 20161020045522673810_OS_isusb.txt 23 | ...    ├── 20161020045522673810_OS_kern.txt 24 | ...    ├── 20161020045522673810_OS_authlog.txt 25 | ...    ├── 20161020045522673810_OS_syslog.txt 26 | ...    ├── 20161020045522673810_OS_info.txt 27 | ...    ├── 20161020045522673810_OS_rsct.txt 28 | ...    └── 20161020045522673810_OS_secure.txt 29 | 30 | 31 | Resource ../lib/openbmc_ffdc.robot 32 | 33 | Test Teardown Gather FFDC 34 | 35 | *** Test Cases *** 36 | 37 | My FFDC Logs 38 | [Documentation] This test is needed to satisfy FFDC initial setup auto 39 | ... variables required for FFDC collection. 40 | [Tags] My_FFDC_Logs 41 | 42 | Log To Console Manual FFDC collection 43 | 44 | ** Keywords *** 45 | 46 | Gather FFDC 47 | [Documentation] Call point to call FFDC robot or FFDC script.. 48 | Run Keyword If ${FFDC_DEFAULT} == ${1} FFDC # Keyword from openbmc_ffdc.py 49 | ... ELSE ffdc_robot_script_cli # Keyword from ffdc_cli_robot_script.py 50 | -------------------------------------------------------------------------------- /tools/robot_custom_rules.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | r""" 3 | Custom rules file for robotframework-lint. 4 | Installation : pip3 install --upgrade robotframework-lint 5 | Example usage: 6 | python3 -m rflint -rA robot_standards -R robot_custom_rules.py . 7 | """ 8 | 9 | import re 10 | 11 | from rflint.common import ERROR, SuiteRule 12 | 13 | 14 | class ExtendInvalidTable(SuiteRule): 15 | r""" 16 | Extend robotframework-lint SuiteRule function for InvalidTable to allow a 17 | table section if it is a section of comments. 18 | e.g "*** Comments ***" 19 | """ 20 | 21 | severity = ERROR 22 | 23 | def apply(self, suite): 24 | r""" 25 | Walk through the code and report. 26 | """ 27 | for table in suite.tables: 28 | if not re.match( 29 | r"^(settings?|metadata|(test )?cases?|(user" 30 | r" )?keywords?|variables?|comments?)$", 31 | table.name, 32 | re.IGNORECASE, 33 | ): 34 | self.report( 35 | suite, 36 | table.name, 37 | table.linenumber, 38 | ) 39 | -------------------------------------------------------------------------------- /tools/robot_standards: -------------------------------------------------------------------------------- 1 | --configure LineTooLong: 110 2 | --ignore TooFewKeywordSteps 3 | --ignore TooFewTestSteps 4 | --ignore FileTooLong 5 | --ignore TooManyTestSteps 6 | --ignore TooManyTestCases 7 | --ignore InvalidTable 8 | -------------------------------------------------------------------------------- /tools/sensors_dbus_list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# 3 | # Script to generate valid Sensors dbus path list. # 4 | # To run this script, copy to BMC home or tmp directory # 5 | # Power on the system to Runtime and then execute: # 6 | # sh sensor.sh # 7 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# 8 | 9 | dbus_obj="xyz.openbmc_project.HwmonTempSensor xyz.openbmc_project.ADCSensor xyz.openbmc_project.VirtualSensor" 10 | 11 | for dobj in $dbus_obj 12 | do 13 | echo DBUS object:$dobj 14 | dbus_cmd_out=`busctl tree $dobj --list | grep /sensors/` 15 | 16 | for i in $dbus_cmd_out 17 | do 18 | exist=`busctl introspect $dobj $i | grep yz.openbmc_project.Sensor.Value` 19 | if [ ! -z "$exist" ]; then 20 | cmd_value=` busctl get-property $dobj $i xyz.openbmc_project.Sensor.Value Value` 21 | echo $i Value=${cmd_value##*d} 22 | fi 23 | done 24 | done 25 | -------------------------------------------------------------------------------- /tools/update_mac.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Update BMC MAC address with input MAC. 3 | 4 | Resource ../lib/bmc_network_utils.robot 5 | 6 | *** Test Cases *** 7 | 8 | Check And Reset MAC on BMC 9 | [Documentation] Verify and Update BMC MAC address. 10 | [Tags] Check_And_Reset_MAC_on_BMC 11 | 12 | Check And Reset MAC 13 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | skipsdist = True 3 | 4 | [testenv] 5 | passenv = * 6 | setenv = 7 | ARG_FILE={envtmpdir}/argument_file.txt 8 | OPENBMC_PASSWORD=0penBmc 9 | OPENBMC_USERNAME=root 10 | SYSLOG_IP_ADDRESS=127.0.0.1 11 | SYSLOG_PORT=514 12 | IPMI_COMMAND=External 13 | IPMI_CIPHER_LEVEL=17 14 | allowlist_externals = * 15 | install_command = pip install {opts} {packages} 16 | deps = -r{toxinidir}/requirements.txt 17 | commands = 18 | -mkdir -p {envtmpdir} 19 | bash {toxinidir}/tools/generate_argumentfile.sh 20 | cp bin/ssh_pw {envdir}/bin/ssh_pw 21 | 22 | 23 | [testenv:default] 24 | deps = {[testenv]deps} 25 | setenv = {[testenv]setenv} 26 | commands = 27 | {[testenv]commands} 28 | python3 -m robot.run --argumentfile {env:ARG_FILE} {posargs} 29 | 30 | 31 | [testenv:palmetto] 32 | deps = {[testenv]deps} 33 | setenv = {[testenv]setenv} 34 | OPENBMC_MODEL=./data/Palmetto.py 35 | commands = 36 | {[testenv]commands} 37 | python3 -m robot.run --argumentfile {env:ARG_FILE} {posargs} 38 | 39 | 40 | [testenv:qemu] 41 | deps = {[testenv]deps} 42 | setenv = {[testenv]setenv} 43 | OPENBMC_MODEL=./data/Palmetto.py 44 | commands = 45 | {[testenv]commands} 46 | python3 -m robot.run --argumentfile {env:ARG_FILE} {posargs} 47 | 48 | 49 | [testenv:witherspoon] 50 | deps = {[testenv]deps} 51 | setenv = {[testenv]setenv} 52 | OPENBMC_MODEL=./data/Witherspoon.py 53 | commands = 54 | {[testenv]commands} 55 | python3 -m robot.run --argumentfile {env:ARG_FILE} {posargs} 56 | 57 | [testenv:romulus] 58 | deps = {[testenv]deps} 59 | setenv = {[testenv]setenv} 60 | OPENBMC_MODEL=./data/Romulus.py 61 | commands = 62 | {[testenv]commands} 63 | python3 -m robot.run --argumentfile {env:ARG_FILE} {posargs} 64 | -------------------------------------------------------------------------------- /xcat/__init__.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Set metadata for test suite. 3 | 4 | Library SSHLibrary 5 | Resource ../lib/connection_client.robot 6 | Resource ../lib/rest_client.robot 7 | Resource ../lib/utils.robot 8 | Resource ../lib/code_update_utils.robot 9 | 10 | Suite Setup Log System Driver Data 11 | 12 | *** Keywords *** 13 | 14 | Log System Driver Data 15 | [Documentation] Log system driver information. 16 | 17 | Open Connection And Log In 18 | ${output} ${stderr}= Execute Command grep ^VERSION_ID= /etc/os-release 19 | ... return_stderr=True 20 | Should Be Empty ${stderr} 21 | Log ${output} 22 | 23 | ${software}= Get Host Software Objects Details 24 | Log ${software} 25 | 26 | ${bmc_model}= Get BMC System Model 27 | Log BMC Model=${bmc_model} 28 | 29 | -------------------------------------------------------------------------------- /xcat/test_power_operation.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Module for testing BMC via XCAT. 3 | 4 | Resource ../lib/xcat/resource.robot 5 | Resource ../lib/xcat/xcat_utils.robot 6 | Resource ../lib/state_manager.robot 7 | 8 | Library OperatingSystem 9 | Library String 10 | 11 | Suite Setup Test Suite Setup 12 | 13 | *** Test Cases *** 14 | 15 | Verify Power On Via XCAT 16 | [Documentation] Power on system via XCAT and verify using REST. 17 | [Tags] Verify_Power_On_Via_XCAT 18 | 19 | Execute Command On XCAT rpower on 20 | Wait Until Keyword Succeeds 10 min 10 sec Is Host Running 21 | 22 | Verify Power Off Via XCAT 23 | [Documentation] Power off system via XCAT and verify using REST. 24 | [Tags] Verify_Power_Off_Via_XCAT 25 | 26 | Execute Command On XCAT rpower off 27 | Wait Until Keyword Succeeds 6 min 10 sec Is Host Off 28 | 29 | Verify BMC State Via XCAT 30 | [Documentation] Verify BMC state using REST and XCAT. 31 | [Tags] Verify_BMC_State_Via_XCAT 32 | 33 | ${xcat_resp}= Execute Command On XCAT rpower bmcstate 34 | ${rest_resp}= Get BMC State 35 | Should Contain ${xcat_resp} ${rest_resp} 36 | 37 | Verify Soft Power Off Followed With Power On 38 | [Documentation] Verify soft power off system followed with power on. 39 | [Tags] Verify_Soft_Power_Off_Followed_With_Power_On 40 | [Setup] Initiate Host Boot 41 | 42 | Execute Command On XCAT rpower softoff 43 | Wait Until Keyword Succeeds 6 min 10 sec Is Host Off 44 | 45 | Execute Command On XCAT rpower on 46 | Wait Until Keyword Succeeds 10 min 10 sec Is Host Running 47 | 48 | Verify Hard Power Off Followed With Power On 49 | [Documentation] Verify hard power off system followed with power on. 50 | [Tags] Verify_Hard_Power_Off_Followed_With_Power_On 51 | [Setup] Initiate Host Boot 52 | 53 | Execute Command On XCAT rpower off 54 | Wait Until Keyword Succeeds 6 min 10 sec Is Host Off 55 | 56 | Execute Command On XCAT rpower on 57 | Wait Until Keyword Succeeds 10 min 10 sec Is Host Running 58 | 59 | *** Keywords *** 60 | 61 | Test Suite Setup 62 | [Documentation] Do the initial suite setup. 63 | 64 | Open Connection And Login To XCAT 65 | 66 | # Check if XCAT is installed. 67 | ${cmd_output}= Execute Command ${XCAT_DIR_PATH}/lsxcatd -v 68 | Should Not Be Empty ${cmd_output} msg=XCAT not installed. 69 | 70 | Add Nodes To XCAT ${OPENBMC_HOST} 71 | -------------------------------------------------------------------------------- /xcat/test_xcat_inventory.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Module for testing BMC inventory via XCAT. 3 | 4 | Resource ../lib/xcat/resource.robot 5 | Resource ../lib/xcat/xcat_utils.robot 6 | Resource ../lib/state_manager.robot 7 | 8 | Suite Setup XCAT Suite Setup 9 | 10 | *** Test Cases *** 11 | 12 | Verify BMC Version Via XCAT 13 | [Documentation] Verify BMC version using XCAT and REST. 14 | [Tags] Verify_BMC_Version_Via_XCAT 15 | 16 | # Get BMC version info via xcat 17 | ${version_via_xcat}= Execute Command On XCAT rinv firm 18 | 19 | # Get BMC version info via rest 20 | ${version_via_rest}= Get BMC Version 21 | 22 | Should Contain ${version_via_xcat} ${version_via_rest} 23 | 24 | *** Keywords *** 25 | 26 | XCAT Suite Setup 27 | [Documentation] XCAT suite setup. 28 | 29 | Open Connection And Login To XCAT 30 | 31 | # Check if XCAT is installed. 32 | ${cmd_output}= Execute Command ${XCAT_DIR_PATH}/lsxcatd -v 33 | Should Not Be Empty ${cmd_output} msg=XCAT not installed. 34 | 35 | Add Nodes To XCAT ${OPENBMC_HOST} 36 | --------------------------------------------------------------------------------