Skip to content

test: add validation for hpc tuning#93

Open
lixuemin2016 wants to merge 1 commit intolinux-system-roles:mainfrom
lixuemin2016:testtuning
Open

test: add validation for hpc tuning#93
lixuemin2016 wants to merge 1 commit intolinux-system-roles:mainfrom
lixuemin2016:testtuning

Conversation

@lixuemin2016
Copy link
Collaborator

@lixuemin2016 lixuemin2016 commented Mar 5, 2026

Enhancement:

Add validation tests for system tuning configurations:

  • Add test for security limits configuration
  • Check systemd DefaultLimitMEMLOCK configuration
  • Check kernel module sunrpc is installed or not
  • Validate sysctl tuning parameters

Reason:
Add tests for system tuning configurations

Result:
`bash test-tuning.sh
[2026-03-05 12:01:56] ==========================================================
[2026-03-05 12:01:56] HPC System Tuning Validation Test
[2026-03-05 12:01:56] ==========================================================

[2026-03-05 12:01:56] Test: Unwanted package azsec-monitor availability...

[PASS] azsec-monitor package is not available as expected

[2026-03-05 12:01:56] Test: Security limits configuration...

[PASS] Security limits configured correctly

[2026-03-05 12:01:56] Test: Systemd memory lock configuration...

[PASS] Systemd DefaultLimitMEMLOCK configured correctly

[2026-03-05 12:01:56] Test: kernel module sunrpc ...

[PASS] sunrpc module configured correctly

[2026-03-05 12:01:56] Test: Sysctl tuning configuration...

[PASS] Sysctl parameters configured correctly

[2026-03-05 12:01:56] Test: NFS readahead udev rules...

[PASS] NFS readahead udev rules configured correctly

[2026-03-05 12:01:56] ==========================================================
[2026-03-05 12:01:56] All tests passed (6)
[2026-03-05 12:01:56] ==========================================================`

Issue Tracker Tickets (Jira or BZ if any):
JIRA: RHELHPC-122

Summary by Sourcery

Add an HPC system tuning validation script and install it as part of the role.

Tests:

  • Add a bash-based HPC system tuning validation script that verifies package removal, security limits, systemd memlock settings, sunrpc module configuration, sysctl parameters, and NFS readahead udev rules.
  • Install the tuning validation test script into the HPC Azure tests directory as an executable.

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 5, 2026

🧙 Sourcery has finished reviewing your pull request!


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The usage text and examples in test-tuning.sh.j2 refer to test-hpc-tuning.sh, but the installed script is named test-tuning.sh; consider aligning the script name in the help output with the deployed filename.
  • The test messages include a typo (availabile in the azsec-monitor check); updating these strings will make the output clearer and more professional.
  • Several tests hard-code configuration paths and expected values (limits, sysctl, udev rules); you may want to template these from the same Ansible variables used to configure the system to avoid drift between the role configuration and the validation script.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The usage text and examples in `test-tuning.sh.j2` refer to `test-hpc-tuning.sh`, but the installed script is named `test-tuning.sh`; consider aligning the script name in the help output with the deployed filename.
- The test messages include a typo (`availabile` in the azsec-monitor check); updating these strings will make the output clearer and more professional.
- Several tests hard-code configuration paths and expected values (limits, sysctl, udev rules); you may want to template these from the same Ansible variables used to configure the system to avoid drift between the role configuration and the validation script.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

# ------------------------------------------------------------------------------
# Test: Package Removal (azsec-monitor)
# ------------------------------------------------------------------------------
availabile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
availabile
available

Add validation tests for system tuning configurations:
- Add test for security limits configuration
- Check systemd DefaultLimitMEMLOCK configuration
- Check kernel module sunrpc is installed or not
- Validate sysctl tuning parameters

JIRA: RHELHPC-122

Signed-off-by: Xuemin Li <xuli@redhat.com>
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