Skip to content

Cray-HPE/csm-testing

Folders and files

NameName
Last commit message
Last commit date
Nov 5, 2024
May 6, 2022
Mar 11, 2025
Dec 3, 2024
Oct 28, 2024
Feb 27, 2025
Nov 1, 2024
Mar 18, 2024
Jan 8, 2025
Oct 17, 2024
Jul 13, 2022
Dec 10, 2024
Nov 10, 2021
Dec 10, 2024
Dec 3, 2024
Dec 5, 2024
Feb 6, 2025
Dec 5, 2024
Dec 3, 2024
Dec 5, 2024
Feb 6, 2025
Dec 5, 2024
Feb 6, 2025
Dec 5, 2024
Nov 5, 2024

Repository files navigation

Overview

This repository contains Goss test files, Goss variable files and code for the goss-servers systemd service, which provides a run-time Goss testing endpoint on nodes where it is installed.

Goss Testing

Goss tests are being used to test the LiveCD (a.k.a. PIT node) and Non-Compute Node (NCN) environments.

Some Goss tests are used at build-time for the LiveCD and NCN images. Other Goss tests are used at runtime.

The LiveCD runtime tests verify that the necessary services and infrastructure are in place to allow the NCNs to boot successfully.

The NCN runtime tests verify that the necessary services have started to allow the Shasta environment to operate successfully.

Running Remote Run-Time Tests

Run the NCN runtime Goss test suite at the following endpoint:

http://[ip-or-hostname-of-ncn]:8080/ncn-tests-all

The endpoint can be queried from the LiveCD or other nodes with access to the NCN. The response format will be in JSON.

Python Code

All csm-testing Python tests and utiltities are packaged into the csm-testing package, installed into a virtual environment on the system. The source code for all of this is under src/csm_testing.

Python Version

See Jenkinsfile.github and pyproject.toml for details on which Python version is used. Currently version 3.6 is used because:

  1. It is available on all NCNs
  2. This is the version that has been used to run all of the csm-testing Python code so far (i.e. it has not been tested on newer Python versions)
  3. One of the Python dependencies (rados) is not available for any other Python versions.

Python Tests

All test scripts should be created as submodules under src/csm_testing/tests. The test submodule should include a __main__.py file which contains a main() function with the following signature:

def main() -> int:
    """
    Returns 0 on success.
    Returns non-0 on failure.
    """

When the RPM is built, each test submodule will have a link created in the following two locations (note the lack of a .py extension):

  • /opt/cray/tests/install/livecd/scripts/python/<submodule_name>
  • /opt/cray/tests/install/ncn/scripts/python/<submodule_name>

Python Tools

All utility scripts should be created as submodules under src/csm_testing/tools. These submodules have the same __main__.py requirement as the Python Tests.

When the RPM is built, each tool submodule will have a link created in the following two locations (note the lack of a .py extension):

  • /opt/cray/tests/install/livecd/automated/python/<submodule_name>
  • /opt/cray/tests/install/ncn/automated/python/<submodule_name>

Python Library

Helper submodules that are not directly invoked as scripts should be created under [src/csm_testing/lib](src/csm_testing/lib].

Python Requirements

If additional Python packages are required, add them to requirements.txt, along with version constraints on that package (and any dependencies it pulls in) in constraints.txt. These will be installed into the virtual environment when the RPM is built.

Note that for a few dependencies, the dependency is fulfilled by inheriting the package from the system Python installation. This should not normally be done. If it does need to be done, be sure to list the required system Python package in the csm-testing-requirements.spec file (along with applicable version constraints, if any). Also be sure to update requirements.txt -- see that file for details on how to list a package that is being inherited from the system Python installation.