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

CRAYSAT-1939: add testing for sat version #649

Draft
wants to merge 7 commits into
base: release/1.6
Choose a base branch
from

Conversation

ethanholen-hpe
Copy link

Summary and Scope

Summarize what has changed. Explain why this PR is necessary. What is impacted? Is this a new feature, critical bug fix, etc?

Is this change backwards incompatible, backwards compatible, or a backwards compatible bugfix?

Issues and Related PRs

List and characterize relationship to Jira/Github issues and other pull requests. Be sure to list dependencies.

  • Resolves [issue id](issue link)
  • Change will also be needed in <insert branch name here>
  • Future work required by [issue id](issue link)
  • Documentation changes required in [issue id](issue link)
  • Merge with/before/after <insert PR URL here>

Testing

List the environments in which these changes were tested.

Tested on:

  • <development system>
  • Local development environment
  • Virtual Shasta

Test description:

How were the changes tested and success verified? If schema changes were part of this change, how were those handled in your upgrade/downgrade testing?

  • Were the install/upgrade-based validation checks/tests run (goss tests/install-validation doc)?
  • Were continuous integration tests run? If not, why?
  • Was upgrade tested? If not, why?
  • Was downgrade tested? If not, why?
  • Were new tests (or test issues/Jiras) created for this change?

Risks and Mitigations

Are there known issues with these changes? Any other special considerations?

Pull Request Checklist

  • Version number(s) incremented, if applicable
  • Copyrights updated
  • License file intact
  • Target branch correct
  • CHANGELOG.md updated
  • Testing is appropriate and complete, if applicable
  • HPC Product Announcement prepared, if applicable

haasken-hpe and others added 2 commits December 12, 2024 17:39
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`.
@ethanholen-hpe ethanholen-hpe marked this pull request as draft December 16, 2024 19:57
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.

2 participants