Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release/1.7] CRAYSAT-1937: Add the first functional test for SAT #654

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 7, 2025

Backport of #648

Add the first functional test for the System Admin Toolkit (SAT).  This
is a proof of concept for future tests for SAT.

This test simply executes the `sat --version` command on the NCN and
verifies that the output matches the value in the file used to set the
version.

SAT tests are implemented in Python using the `unittest` standard
library package.  This provides an easy way to structure tests, add set
up and tear down logic for each test, and run the tests from a script.
The Python code for the SAT tests is all under a `sat_functional`
subpackage, and individual subpackages and modules beneath that
subpackage will implement tests for specific SAT functionality. Tests
will be organized by the `sat` command they are testing.

The `__main__.py` in the `sat_testing` module simply passes along the
arguments, which should be a list of relative test paths, to the
`unittest.TextTestRunner`, which then runs the tests.

SAT tests are added in Gossfiles. Currently a single test file for SAT
tests, `goss-sat-version.yaml`, is created. A test suite is created in
the goss file `ncn-sat-functional-tests.yaml`. This test suite is
limited to run on only `ncn-m001`. It will eventually include all SAT
functional tests.

Test Description:
Downloaded the RPM built on Jenkins to drax. Extracted the RPM using
`rpm2cpio $RPM_FILE | cpio -idvmu`. Modified the path to the Python
virtual environment in the `test_sat_functional` script in the `bin`
directory of the virtualenv to match the extraction path, set
`GOSS_BASE` to the extracted Goss base directory, and then ran the Goss
test file and test suite using `goss -g $GOSS_FILE validate`.

(cherry picked from commit 539a1ea)
@haasken-hpe haasken-hpe force-pushed the backport/648-to-release/1.7 branch from 3483fef to f1ba825 Compare January 7, 2025 16:33
@haasken-hpe haasken-hpe merged commit ac7c462 into release/1.7 Jan 7, 2025
3 checks passed
@haasken-hpe haasken-hpe deleted the backport/648-to-release/1.7 branch January 7, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants