ddc4c5dc3d
Description: reasons.py: added duplex_system reason heat_helper.py: replaced 'is' with '==' host_helper.py : in modify_host_memory and get_host_memories converted key to str from int unused variables in string format network_helper.py: in add_icmp_and_tcp_rules removed "protocol" and added egress for icmp unused variables in string format replaced 'is' with '==' security_helper.py: unused variables in string format storage_helper.py: replaced 'is' with '==' unused variables in string format pytest.ini: added robotperformance marker performance: added performance directory containing performance tests fixture_resources.py: added missing ',' in _RESOURCE_TYPES list pre_checks_and_configs.py: added no_duplex telnet.py: replace 'NotImplemented' with 'NotImplementedError' parse_log.py: replaced 'is' with '==' Signed-off-by: George Postolache <george.postolache@intel.com> Change-Id: I32e84aac33102e57f4b0eb28d9aca0f6684e6b64 |
||
---|---|---|
.. | ||
consts | ||
keywords | ||
testcases | ||
testfixtures | ||
utils | ||
README.rst | ||
__init__.py | ||
conftest.py | ||
pytest.ini | ||
requirements.txt | ||
setups.py | ||
stx-test_template.conf |
README.rst
StarlingX Integration Test Framework
The project contains integration test cases that can be executed on an installed and configured StarlingX system.
Supported test cases:
- CLI tests over SSH connection to StarlingX system via OAM floating IP
- Platform RestAPI test cases via external endpoints
- Horizon test cases
Packages Required
- python >='3.4.3,<3.7'
- pytest>='3.1.0,<4.0'
- pexpect
- pyyaml
- requests (used by RestAPI test cases only)
- selenium (used by Horizon test cases only)
- Firefox (used by Horizon test cases only)
- pyvirtualdisplay (used by Horizon test cases only)
- ffmpeg (used by Horizon test cases only)
- Xvfb or Xephyr or Xvnc (used by pyvirtualdisplay for Horizon test cases only)
Setup Test Tool
This is a off-box test tool that needs to be set up once on a Linux server that can reach the StarlingX system under test (such as SSH to STX system, send/receive RestAPI requests, open Horizon page).
- Install above packages
- Clone stx-test repo
- Add absolute path for automated-pytest-suite to PYTHONPATH environment variable
Execute Test Cases
Precondition: STX system under test should be installed and configured.
- Customized config can be provided via --testcase-config <config_file>.
Config template can be found at ${project_root}/stx-test_template.conf. - Test cases can be selected by specifying via -m <markers>
- If stx-openstack is not deployed, platform specific marker should be specified,
e.g., -m "platform_sanity or platform" - Automation logs will be created at ${HOME}/AUTOMATION_LOGS directory by default.
Log directory can also be specified with --resultlog=${LOG_DIR} commandline option - Examples:
export project_root=<automated-pytest-suite dir>
# Include $project_root to PYTHONPATH if not already done
export PYTHONPATH=${PYTHONPATH}:${project_root}
cd $project_root
# Example 1: Run all platform_sanity test cases under testcases/
pytest -m platform_sanity --testcase-config=~/my_config.conf testcases/
# Example 2: Run platform_sanity or sanity (requires stx-openstack) test cases,
# on a StarlingX virtual box system that is already saved in consts/lab.py
# and save automation logs to /tmp/AUTOMATION_LOGS
pytest --resultlog=/tmp/ -m sanity --lab=vbox --natbox=localhost testcases/
# Example 3: List (not execute) the test cases with "migrate" in the name
pytest --collect-only -k "migrate" --lab=<stx_oam_fip> testcases/
Contribute
- In order to contribute, python3.4 is required to avoid producing code that is incompatible with python3.4.