Create new script for IPMI System Info Parameters 0 to 5

Following parameters are verfied in the script,
1. Set In Progress - param 0
2. System Firmware Version - param 1
3. System Name - param 2
4. Primary Operating System Name - param 3
5. Operating System Name - param 4
6. Present OS Version Number - param 5

Testcases Created:
  - Verify System Info Set In Progress
  - Verify System Info Set In Progress After BMC Reboot
  - Verify Get System Info Set In Progress With Invalid Data Length
  - Verify Set System Info Set In Progress With Invalid Data Length
  - Verify Set System Info Set In Progress With Invalid State
  - Verify System Info System Firmware Version
  - Verify Get System Info System Firmware Version With Invalid Data Length
  - Verify Set System Info System Firmware Version With Invalid Data Length
  - Verify System Info System Name
  - Verify Get System Info System Name With Invalid Data Length
  - Verify Set System Info System Name With Invalid Data Length
  - Verify System Info Primary Operating System Name
  - Verify System Info Primary Operating System Name After BMC Reboot
  - Verify Get System Info Primary Operating System Name With Invalid Data Length
  - Verify Set System Info Primary Operating System Name With Invalid Data Length
  - Verify System Info Operating System Name
  - Verify System Info Operating System Name After BMC Reboot
  - Verify Get System Info Operating System Name With Invalid Data Length
  - Verify Set System Info Operating System Name With Invalid Data Length
  - Verify System Info Present OS Version Number
  - Verify Get System Info Present OS Version Number With Invalid Data Request
  - Verify Set System Info Present OS Version Number With Invalid Data Request

For Param 0 - Set In Progress, validation for change in set-in-progress/ set-complete are verified with valid request data bytes and invalid request data bytes. Since it is volatile, the response bytes are verified after cold reset.

For param 1 - System Firmware Version, the request data bytes are generated randomly and verified with response data byte, and verified  invalid request data byte.

For param 3 - System Name, the request data bytes are generated randomly and verified with response data byte, and verified  invalid request data byte.

For param 3 - Primary Operating System Name,  the request data bytes are identified in variables section and verified with response data byte, and verified invalid request data byte given as invalid_os_name in variable section. Since it is non-volatile,  the response bytes are verified with os_version_name after cold reset.

For param 4 -  Operating System Name,  the request data bytes are identified in variables section and verified with response data byte, and verified invalid request data byte given as invalid_os_name in variable section. Since it is volatile,  the response bytes are verified with default value after cold reset.

For param 5 -  Present OS Version Number,  the request data bytes are identified in variables section and verified with response data byte, and verified invalid request data byte given as invalid_os_name in variable section.

Request data for system info parameter present in data/ipmi_raw_cmd_table.py
Functions used like 'Prefix Bytes' are defined under lib/ipmi_utils.py and 'Split String With Index' in lib/utils.py - already committed in - https://gerrit.openbmc-project.xyz/c/openbmc/openbmc-test-automation/+/51641.

Tested: Run robot ipmi\test_ipmi_systeminfo_parameters.robot

Signed-off-by: chithrag <chithrag@ami.com>
Change-Id: Ic0016db9d3707cac496a5b9dbc15ac0f348a51a4
2 files changed
tree: 5f24fc8482ebc6e9525bfc9377731ac6564e5b27
  1. bin/
  2. data/
  3. docs/
  4. extended/
  5. ffdc/
  6. gui/
  7. ipmi/
  8. lib/
  9. network/
  10. oem/
  11. openpower/
  12. pldm/
  13. redfish/
  14. security/
  15. snmp/
  16. syslib/
  17. systest/
  18. templates/
  19. test_lists/
  20. tests/
  21. tools/
  22. xcat/
  23. .gitignore
  24. .markdownlint.yaml
  25. CONTRIBUTING.md
  26. LICENSE
  27. MAINTAINERS
  28. OWNERS
  29. README.md
  30. requirements.txt
  31. robot_custom_rules.py
  32. robot_standards
  33. setup.cfg
  34. tox.ini
README.md

Features of OpenBMC Test Automation

Interface Feature List

  • REST
  • DMTF Redfish
  • Out-of-band IPMI
  • SSH to BMC and Host OS

Key Feature List

  • Power on/off
  • Reboot Host
  • Reset BMC
  • Code update BMC and host
  • Power management
  • Fan controller
  • HTX bootme
  • XCAT execution
  • Network
  • IPMI support (generic and DCMI compliant)
  • Factory reset
  • RAS (Reliability, availability and serviceability)
  • Web UI testing
  • Secure boot
  • SNMP (Simple Network Management Protocol)
  • Remote Logging via Rsyslog
  • LDAP (Lightweight Directory Access Protocol)
  • Certificate
  • Local User Management(Redfish/IPMI)
  • DateTime
  • Event Logging
  • PLDM (Platform Level Data Model) via pldmtool

Debugging Supported List

  • SOL collection
  • FFDC collection
  • Error injection from host

Installation Setup Guide

If using Python 3.x, use the corresponding pip3 to install packages. Note: Older Python 2.x is not actively supported.

REST base packages:

    $ pip install -U requests
    $ pip install -U robotframework-requests
    $ pip install -U robotframework-httplibrary

Python redfish library packages: For more detailed intstructions see python-redfish-library

    $ pip install redfish

SSH and SCP base packages: For more detailed installation instructions see robotframework-sshlibrary

    $ pip install robotframework-sshlibrary
    $ pip install robotframework-scplibrary

Installing requirement dependencies:

    $ pip install -r requirements.txt

you'll find this file once your clone openbmc-test-automation repository.

Installing tox:

    $ pip install -U tox

Installing expect:

    $ sudo apt-get install expect (Ubuntu example)

OpenBMC Test Development

These documents contain details on developing OpenBMC test code and debugging.

OpenBMC Test Documentation

Supported Systems Architecture

OpenBMC test infrastructure is proven capable of running on:

  • POWER
  • x86 systems running OpenBMC firmware stack.

Testing Setup Steps

To verify the installation setup is completed and ready to execute.

  • Download the openbmc-test-automation repository:
    $ git clone https://github.com/openbmc/openbmc-test-automation
    $ cd openbmc-test-automation
    
  • Execute basic setup test run:
    $ robot -v OPENBMC_HOST:xx.xx.xx.xx templates/test_openbmc_setup.robot
    
    where xx.xx.xx.xx is the BMC hostname or IP.

Test Layout

There are several sub-directories within the openbmc-test-automation base which contain test suites, tools, templates, etc. These sub-directories are classified as follows:

tests/: Contains the general test cases for OpenBMC stack functional verification. The "tests" subdirectory uses legacy REST and will be deprecated at some point and therefore no longer supported.

extended/: Contains test cases for boot testing, code update testing using legacy REST, etc.

systest/: Contains test cases for HTX bootme testing.

xcat/: Contains test cases for XCAT automation.

gui/test/: Contains test cases for testing web-based interface built on AngularJS.

gui/gui_test/: Contains test cases for testing web-based user interface built on Vue.js.

pldm/: Contains test cases for platform management subsystem (base, bios, fru, platform, OEM).

snmp/: Contains test cases for SNMP (Simple Network Management Protocol) configuration testing.

openpower/ras/: Contains test cases for RAS (Reliability, Availability and Serviceability) for an OpenPOWER system.

openpower/secureboot/: Contains test cases for secure boot testing on a secure boot feature enabled OpenPOWER system only.

tools/: Contains various tools.

templates/: Contains sample code examples and setup testing.

test_list/: Contains the argument files used for skipping test cases (e.g "skip_test", "skip_test_extended", etc.) or grouping them (e.g "HW_CI", "CT_basic_run", etc.).

Redfish Test Layout

OpenBMC is moving steadily towards DTMF Redfish, which is an open industry standard specification and schema that meets the expectations of end users for simple, modern and secure management of scalable platform hardware.

redfish/: Contains test cases for DMTF Redfish-related feature supported on OpenBMC.

redfish/extended/: Contains test cases for combined legacy REST and DMTF Redfish-related feature supported on OpenBMC.

Note: Work in progress test development parameter -v REDFISH_SUPPORT_TRANS_STATE:1 to force the test suites to execute in redfish mode only.

Quickstart

To run openbmc-automation first you need to install the prerequisite Python packages which will help to invoke tests through tox (Note that tox version 2.3.1 or greater is required) or via Robot CLI command.

Robot Command Line

  • Execute all test suites for tests/:

    $ robot -v OPENBMC_HOST:xx.xx.xx.xx  tests
    
  • Execute a test suite:

    $ robot -v OPENBMC_HOST:xx.xx.xx.xx redfish/extended/test_basic_ci.robot
    
  • Initialize the following test variables which will be used during test execution:

    User can forward declare as environment variables:

    $ export OPENBMC_HOST=<openbmc machine IP address/hostname>
    $ export OPENBMC_USERNAME=<openbmc username>
    $ export OPENBMC_PASSWORD=<openbmc password>
    $ export IPMI_COMMAND=<Dbus/External>
    

    or

    User can input as robot variables as part of the CLI command:

    -v OPENBMC_HOST:<openbmc machine IP address/hostname>
    -v OPENBMC_USERNAME:<openbmc username>
    -v OPENBMC_PASSWORD:<openbmc password>
    
  • For QEMU tests, set the following environment variables as well:

    $ export SSH_PORT=<ssh port number>
    $ export HTTPS_PORT=<https port number>
    
  • Run tests:

    $ tox tests
    
  • How to run individual test:

    One specific test:

    $ tox -e default -- --include Power_On_Test  tests/test_basic_poweron.robot
    

    No preset environment variables, default configuration for all supported systems:

    $ OPENBMC_HOST=x.x.x.x tox -e default -- tests
    

    No preset environment variables, one test case from a test suite:

    $ OPENBMC_HOST=x.x.x.x tox -e default -- --include Power_On_Test tests/test_basic_poweron.robot
    

    No preset environment variables, the entire test suite:

    $ OPENBMC_HOST=x.x.x.x tox -e default -- tests
    

    No preset environment variables, the entire test suite excluding test cases using argument file:

    $ OPENBMC_HOST=x.x.x.x tox -e default -- --argumentfile test_lists/skip_test tests
    

    Exclude test list for supported systems:

    Palmetto:  test_lists/skip_test_palmetto
    Witherspoon:  test_lists/skip_test_witherspoon
    
  • Run IPMI tests:

    Running only out-of-band IPMI tests:

    $ robot -v IPMI_COMMAND:External -v OPENBMC_HOST:x.x.x.x --argumentfile test_lists/witherspoon/skip_inband_ipmi tests/ipmi/
    

    Running only inband IPMI tests:

    $ robot -v IPMI_COMMAND:Inband -v OPENBMC_HOST:x.x.x.x -v OS_HOST:x.x.x.x -v OS_USERNAME:xxxx -v OS_PASSWORD:xxxx --argumentfile test_lists/witherspoon/skip_oob_ipmi tests/ipmi/
    
  • Run GUI tests:

    By default, GUI runs with Firefox browser and headless mode. Example with chrome browser and header mode:

    $ robot -v OPENBMC_HOST:x.x.x.x -v GUI_BROWSER:gc -v GUI_MODE:header gui/test/
    

    Run GUI default CI test bucket:

    $ robot -v OPENBMC_HOST:x.x.x.x --argumentfile test_lists/BMC_WEB_CI gui/test/
    
  • Run LDAP tests:

    Before using LDAP test functions, be sure appropriate LDAP user(s) and group(s) have been created on your LDAP server. Note: There are multiple ways to create LDAP users / groups and all depend on your LDAP server. One common way for openldap is ldapadd / ldapmodify refer https://linux.die.net/man/1/ldapadd For ldapsearch, refer to "https://linux.die.net/man/1/ldapsearch". Microsoft ADS: refer to https://searchwindowsserver.techtarget.com/definition/Microsoft-Active-Directory-Domain-Services-AD-DS

    Note: Currently, LDAP test automation for Redfish API is in progress. The format to invoke LDAP test is as follows:

    $ cd redfish/account_service/
    $ robot -v OPENBMC_HOST:x.x.x.x -v LDAP_SERVER_URI:<ldap(s)//LDAP Hostname / IP> -v LDAP_BIND_DN:<LDAP Bind DN> -v LDAP_BASE_DN:<LDAP Base DN> -v LDAP_BIND_DN_PASSWORD:<LDAP Bind password> -v LDAP_SEARCH_SCOPE:<LDAP search scope> -v LDAP_SERVER_TYPE:<LDAP server type> -v LDAP_USER:<LDAP user-id> -v LDAP_USER_PASSWORD:<LDAP PASSWORD> -v GROUP_NAME:<Group Name> -v GROUP_PRIVILEGE:<Privilege>  ./test_ldap_configuration.robot
    
  • How to run CI and CT bucket test:

    Default CI test bucket list:

    $ OPENBMC_HOST=x.x.x.x tox -e default -- --argumentfile test_lists/HW_CI tests
    

    Default CI smoke test bucket list:

    $ OPENBMC_HOST=x.x.x.x tox -e default -- --argumentfile test_lists/CT_basic_run tests
    
  • Run extended tests:

    For-loop test (default iteration is 10):

    $ robot -v OPENBMC_HOST:x.x.x.x -v OPENBMC_SYSTEMMODEL:xxxxxx -v ITERATION:n -v LOOP_TEST_COMMAND:xxxxxx extended/full_suite_regression.robot
    

    Example using tox testing a test suite for 5 iterations "witherspoon":

    OPENBMC_HOST=x.x.x.x  LOOP_TEST_COMMAND="tests/test_fw_version.robot" ITERATION=5 OPENBMC_SYSTEMMODEL=witherspoon tox -e witherspoon -- ./extended/full_suite_regression.robot
    
  • Host CPU architecture

    By default openbmc-test-automation framework assumes that host CPU is based on the POWER architecture. If your host CPU is x86 add -v PLATFORM_ARCH_TYPE:x86 variable setting to your CLI commands or set an environment variable:

    $ export PLATFORM_ARCH_TYPE=x86
    

Jenkins jobs tox commands

  • HW CI tox command:
    $ OPENBMC_HOST=x.x.x.x tox -e default -- --argumentfile test_lists/HW_CI tests