Skip to content

fix(test): repo_sync is explicit-only, V022 needs an external source, V058 cannot hang on a down node - #5955

Open
balajikumaran-c-s wants to merge 8 commits into
dell:mainfrom
balajikumaran-c-s:fix/fvt-repo-sync-v022-v058
Open

balajikumaran-c-s wants to merge 8 commits into
dell:mainfrom
balajikumaran-c-s:fix/fvt-repo-sync-v022-v058

Conversation

@balajikumaran-c-s

@balajikumaran-c-s balajikumaran-c-s commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

PR Title

fix(test): repo_sync is explicit-only, V022 needs an external source, V058 cannot hang on a down node

Description of the Solution

Three FVT test defects, fixed together because they all make the default verification fail or hang on a healthy deployment:

  1. repo_manager (repo_sync verification): the default verify ran the repo_sync suite although its result file only exists after an explicit run of the maintenance playbook repo_sync.yml; seven tests failed and the first failing tag stopped the verification, so status and user_registry were never verified. repo_sync is now explicit-only, like the other tags in EXCLUDE_TAGS.
  2. image_build_manager (IMGBM_FVT_VALIDATE_V022): the test judged the live repo_status.yml as an external source on every deployment, so it failed whenever the local repo_manager served the repositories. The live file now decides whether an external source is in use.
  3. orchestrator (ORCH_FVT_PXEBOOT_V058): the MPI job was pinned with --nodelist to two nodes and nothing bounded the wait, so a down node left the job PENDING and the test hung until the pipeline job timed out, leaving the job in the queue.

Related Issue

Changes

repo_manager (library/vars/domain_vars.py, fvt/repo_sync/test_repo_sync.py, README.md, ut)

  • repo_sync is added to EXCLUDE_TAGS; ./run_validation.sh fvt_repo_manager repo_sync test still runs the playbook and its seven checks.
  • If the result file is missing, the failure now says that repo_sync.yml was not run and gives the command. I kept this a failure and did not turn it into a skip: an explicit repo_sync verify that checks nothing must not look green, and the default run no longer reaches it.
  • Unit test RM_UT_339 (registered in the UT registry and README).

Compliance gate findings of the changed repo_sync file

  • The gate listed TestLogger output and Registry lookup (and two inline host.run calls) as open findings of fvt/repo_sync/test_repo_sync.py. They are fixed, not waived: the eight tests are registered in TEST_CASES (RM_FVT_REPO_SYNC_E001, V001-V007), each test builds its TestLogger from the registry, the IDs are no longer hard-coded in docstrings, and the Pulp query and the repomd fetch moved to library/functions/repo_sync_func.py.
  • The repo_manager score of the gate rose from 75.83 to 80.28, so .github/compliance/baseline.json is raised to 80.28 to keep the improvement from regressing. The other findings the gate lists for the three domains are older and in files this PR does not touch.
  • Checked on the lab OIM: ./run_validation.sh fvt_repo_manager repo_sync verify (read-only, without the playbook) now prints each test with its ID and a FAIL that names the missing file and the command to run.

image_build_manager (library/functions/contract_func.py, fvt/validate/contract, test_config.yml, ut)

  • V022 reads the repository hosts of the live file and skips with the reason when every host is this OIM (local repo_manager) and no external source is pinned or required. It runs the existing external-contract checks when a host is another server, when external_repo_host is set in test_config.yml (pin) or when REQUIRE_EXTERNAL_REPO=1. A file without repository hosts is not skipped. No setting is needed for an external source.
  • A host is this OIM when it is one of the OIM's names or addresses (hostname, FQDN, SYSTEM_HOSTNAME, interface addresses) or resolves to one (new external_hosts() with a 5 s limited DNS lookup, standard library only). A name that does not resolve is treated as external, so a typo is checked, not hidden. The shared verify_external_source (V023, V024) is unchanged.
  • The skip reason avoids the words the live_file summary looks for, so it does not trigger the "live file was not found" warning. external_repo_host, which the code already read, is documented in test_config.yml.
  • Unit tests IMGBM_UT_165-173.

orchestrator (library/vars/pxeboot_vars.py, library/functions/_workload_helpers.py, slurm_jobs_pxeboot_func.py, slurm_auth_pxeboot_func.py, ut)

  • Before anything else, V058 checks the Slurm state of its target nodes and fails in about a second naming each unusable node, its state and Slurm's reason, for example slurm-node-2 (state=down, availability=up, reason: Not responding).
  • The check reuses the readiness logic and ready-state list the PAM job tests already had (compute_not_ready_reason, moved to the shared helper) and no longer strips the * flag, so a node that is idle* (slurmd stopped, not yet marked down) is not treated as idle.
  • The compile and job srun commands get timeout, --immediate and, for the job, --time and a unique --job-name (constants SLURM_JOB_TIMEOUT_SECONDS, new SLURM_JOB_START_SECONDS, SLURM_JOB_KILL_GRACE_SECONDS, in the style of the other bounded srun commands); the job is cancelled by name at the end, whatever happened.
  • Unit tests ORCH_UT_385-389.

Files Changed

File Change Type Description
test/repo_manager/library/vars/domain_vars.py Modified repo_sync in EXCLUDE_TAGS
test/repo_manager/fvt/repo_sync/test_repo_sync.py Modified Clear message when the playbook was not run
test/repo_manager/README.md, ut/README.md, ut/test_framework_contract.py, library/vars/ut_test_case_vars.py Modified Docs and unit test
test/repo_manager/library/functions/repo_sync_func.py, library/functions/__init__.py, library/vars/test_case_vars.py Added / Modified Helpers and registry of the repo_sync tests
.github/compliance/baseline.json Modified repo_manager test baseline 75.83 to 80.28
test/image_build_manager/library/functions/contract_func.py Modified external_hosts() with a limited DNS lookup
test/image_build_manager/fvt/validate/contract/test_repo_contract.py, __init__.py Modified V022 decided by the live file
test/image_build_manager/test_config.yml Modified external_repo_host documented
test/image_build_manager/ut/test_external_contract_live_source.py, ut/test_external_hosts.py, ut/README.md, library/vars/ut_test_case_vars.py Added / Modified Unit tests
test/orchestrator/library/vars/pxeboot_vars.py Modified Bounded srun commands, new constants and queries
test/orchestrator/library/functions/_workload_helpers.py Modified Shared not-ready check with Slurm's reason
test/orchestrator/library/functions/slurm_jobs_pxeboot_func.py Modified V058 pre-check, bounded commands, cancel by name
test/orchestrator/library/functions/slurm_auth_pxeboot_func.py Modified Uses the shared helper
test/orchestrator/ut/test_slurm_openmpi_job_bounds.py Added Unit tests

Testing

Run on the lab OIM (the one where the failures were seen), with a copy of the pipeline checkout so the pipeline's own files were not touched:

  • V058, before the fix: with slurmd stopped on slurm-node-2 and the node DOWN, the test hung. The job stayed PENDING (ReqNodeNotAvail, UnavailableNodes:slurm-node-2) and was still in the queue after the runner was killed.
  • V058, after the fix, same state: fails in 0.8 s with the node, state and reason, and the queue is empty afterwards.
  • V058, healthy cluster: passes in about 6 s with the new srun options on both nodes (real OpenMPI job, ranks 0 and 1 on both nodes).
  • repo_manager verify: completes, exit 0, with precheck, prepare, execute, status and user_registry verified and no repo_sync.
  • image_build_manager validate verify --suite contract: V022 is skipped with the reason (every repository host is the OIM), 19 passed, 0 failed. On the OIM, its own admin IP and its FQDN are local and an unknown name is external.
  • The cluster was restored afterwards (slurmd started, both nodes idle, queue empty) and my temporary copies were removed.
  • Unit tests: orchestrator 59 selected tests (new and existing), repo_manager 341 passed, image_build_manager 270 collected with the 2 failures that main already has in test_driver_group_skip.py (bundled catalog resolution) unchanged.
  • Pylint of the changed files: lowest 9.61/10. PR Effective Lines: 255 of 1000. Compliance gate: PASS for orchestrator, repo_manager and image_build_manager.
  • Not run: a full pipeline; the --immediate / timeout expiry path (the node pre-check stops a down node first), covered only by the command-shape unit test.

Backward Compatibility

  • Test code only; no change to src/. The default repo_manager verification no longer includes repo_sync. V022 now skips only when every repository host is this OIM; an external repo_manager is detected from the file. A user who expects an external source but whose file points at the OIM sees a skip unless external_repo_host or REQUIRE_EXTERNAL_REPO=1 is set.
  • An idle* node now counts as not ready in the readiness helper that the PAM job tests share; that is the behaviour they already intended.

Security Review

  • Input Validation: node names and job names come from the PXE mapping and a random suffix; the existing quoting is kept.
  • Secret Management: N/A.
  • Path Security: N/A.
  • Command Injection: the new Slurm commands are fixed templates with %s values from the mapping (host names) and the generated job name.
  • Template Injection: N/A.
  • Network / TLS: N/A.
  • Container / K8s: N/A.
  • Logging: Secrets masked? Slurm's node reason text is shown, whitespace-collapsed; no credentials are involved.
  • Crypto / Tokens: N/A.
  • Dependencies: N/A.
  • Permissions / Temp files: N/A.
  • Testing: Unit tests and a run on the lab OIM, see Testing.

Security Notes: None.

Suggested Reviewers

Reviewer Review Focus
Orchestrator test owners V058 pre-check, bounded srun, shared readiness helper
repo_manager and image_build_manager test owners repo_sync exclusion, V022 condition

… V058 cannot hang on a down node

repo_manager: repo_sync needs an explicit run of repo_sync.yml, so the default verification leaves it
out like the other explicit-only tags; the missing-file message names the command to run.

image_build_manager: IMGBM_FVT_VALIDATE_V022 judges the live repo_status.yml as an external source
only when external_repo_host is set (or REQUIRE_EXTERNAL_REPO=1) and skips with the reason otherwise.

orchestrator: ORCH_FVT_PXEBOOT_V058 checks the Slurm state of its target nodes first and fails in
seconds naming the node and Slurm's reason; the srun compile and job commands get timeout,
--immediate and --time, the job has its own name and is cancelled at the end. The not-ready check of
the PAM job tests moves to the shared helper and now treats a not responding (*) node as not ready.

Signed-off-by: balajikumaran-c-s <balajikumaran.cs@dell.com>
@github-actions

Copy link
Copy Markdown

Secure Code Review

Advisory only: this check never blocks the PR. It scans the lines added by this PR against secure-coding rules derived from recent security fixes in this repository.

No reviewable source changes (tests, docs and workflows are excluded).
Result: 17 passed, 0 failed (0 file(s) scanned)

Checklist

  • PASS SEC-01 No hardcoded credentials
  • PASS SEC-04 No shell / command injection sinks
  • PASS SEC-05 Ansible shell/command variables are quoted
  • PASS SEC-06 No unsafe Jinja lookups
  • PASS SEC-07 YAML parsed safely
  • PASS SEC-11 Secrets not written to logs or errors
  • PASS SEC-12 Swallowed exceptions are logged
  • PASS SEC-13 Safe permissions on files and directories
  • PASS SEC-14 Secure temporary files
  • PASS SEC-15 Path inputs validated against traversal
  • PASS SEC-16 Input validated before shell/SSH/config use
  • PASS SEC-17 Container base images pinned by digest
  • PASS SEC-18 Python dependencies pinned to exact versions
  • PASS SEC-19 Kubernetes / pod hardening
  • PASS SEC-20 Firewall / network exposure not widened
  • PASS SEC-21 Strong crypto and token handling
  • PASS SEC-22 CSV/injection-safe output

Findings are heuristic; reviewers should confirm each one. Suppress a justified finding with a # nosec comment and a short reason.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Compliance Gate

Result: 3 passed, 0 not passed (3 domain scope(s) checked; unchanged domains are skipped)

Checked commit: f0518e9

Not checked (no changes in that domain): pipeline/pipeline, src/build_stream, src/discovery, src/image_build_manager, src/main, src/orchestrator, src/repo_manager, src/telemetry, src/utils, svt/svt, test/build_stream, test/discovery, test/main, test/telemetry, test/utils

test/image_build_manager: PASSED

  • PASSED score 100.0, baseline 100.0
  • WAIVED false positive: Security/HPC / Blocking security patterns: ut/test_input_validation_fail_closed.py:33 hardcoded CREDENTIALS
  • Open findings: 0

test/orchestrator: PASSED

  • PASSED score 83.3, baseline 83.3
  • OPEN: Test conventions / Pytest feature markers: fvt/validate/ipv6_ib/test_ipv6_nm_publication.py:136, fvt/validate/ipv6_ib/test_ipv6_nm_publication.py:159, fvt/validate/ipv6_ib/test_ipv6_nm_publication.py:176
  • OPEN: Test conventions / pytest.mark.order: fvt/validate/ipv6_ib/test_ipv6_nm_publication.py:136, fvt/validate/ipv6_ib/test_ipv6_nm_publication.py:159, fvt/validate/ipv6_ib/test_ipv6_nm_publication.py:176
  • OPEN: Test conventions / TestLogger output: fvt/validate/ipv6_ib/test_ipv6_nm_publication.py:136, fvt/validate/ipv6_ib/test_ipv6_nm_publication.py:159, fvt/validate/ipv6_ib/test_ipv6_nm_publication.py:176
  • OPEN: Test metadata / Registry lookup: fvt/validate/ipv6_ib/test_ipv6_nm_publication.py, fvt/validate/ipv6_ib/test_ipv6_validation_allocation.py
  • Open findings: 4

test/repo_manager: PASSED

  • PASSED score 100.0, baseline 100.0
  • WAIVED false positive: Security/HPC / Blocking security patterns: ut/test_error_message_redaction.py:37 hardcoded SECRET
  • Open findings: 0

…the OIM

The live repo_status.yml decides whether the external-source check applies: it skips when every
repository host is this OIM and no external source is pinned (external_repo_host) or required
(REQUIRE_EXTERNAL_REPO=1), and runs when a host is another server. A host is this OIM when it is one
of its names or addresses or resolves to one (short lookup with a time limit); a name that does not
resolve is treated as external so a typo is checked.

Signed-off-by: balajikumaran-c-s <balajikumaran.cs@dell.com>
@balajikumaran-c-s
balajikumaran-c-s marked this pull request as ready for review November 27, 2026 10:22
@abhishek-sa1

Copy link
Copy Markdown
Collaborator

The Compliance Gate passes, but it still reports several open findings across image_build_manager, orchestrator, and repo_manager. These findings are not fixed by this PR and appear to be pre-existing baseline debt.

Could you please either:

  1. Address the findings relevant to files changed by this PR—particularly the TestLogger output and Registry lookup findings in fvt/repo_sync/test_repo_sync.py; or
  2. Confirm that they are out of scope and create or link a follow-up issue for cleanup.

The unrelated IPv6, container, catalog, cleanup, canonical-ID, and known-debt findings should not necessarily expand this PR's scope.

Separately, the PR is currently blocked by Validate linked issue and IP policy and still requires review approval. Please add the appropriate issue reference and rerun the failed check before merge.

… registry

The repo_sync FVT had the test IDs only in docstrings, no TestLogger output and two inline host.run
calls, which the compliance gate listed as open findings of a file this PR changes. The IDs are now
registered (RM_FVT_REPO_SYNC_E001, V001-V007), every test builds its TestLogger from the registry,
the Pulp query and the repomd fetch moved to library/functions/repo_sync_func.py, and the
repo_manager baseline of the gate is raised to the new score (75.83 to 80.28).

Signed-off-by: balajikumaran-c-s <balajikumaran.cs@dell.com>
@balajikumaran-c-s

Copy link
Copy Markdown
Collaborator Author

Thanks for the review.

Compliance findings of the changed file. Fixed in b1c0b53, not waived: fvt/repo_sync/test_repo_sync.py now has its eight tests registered in TEST_CASES (RM_FVT_REPO_SYNC_E001, V001-V007), builds a TestLogger from the registry in every test (no IDs left in docstrings), and the two inline host.run calls moved to library/functions/repo_sync_func.py. The gate no longer lists any repo_sync finding; the repo_manager score went from 75.83 to 80.28 and I raised its baseline in .github/compliance/baseline.json to keep it. Run on the lab OIM: repo_sync verify without the playbook prints every test with its ID and a clear FAIL.

Other findings (IPv6, container, catalog, cleanup, canonical-ID, known debt): they are in files this PR does not change, so I left them out of scope, as you suggested.

Linked issue check: the issue references (#1783, #1784, #1785 on the EOS repository) will be added to the PR description by the author, then the check is rerun.

…n-c-s/omnia into fix/fvt-repo-sync-v022-v058
The gate comment is updated in place on every push (directly for same-repository PRs, through the
PR Comment workflow for fork PRs), but nothing in it showed which commit it described, so a stale
comment and a current one looked the same. The comment now starts with 'Checked commit: <sha>', taken
from the PR head passed by the workflow.

Signed-off-by: balajikumaran-c-s <balajikumaran.cs@dell.com>
…ild_manager

repo_manager: the NFT tests and the catalog_generate/add/delete deploy tests take their IDs from the
TEST_CASES registry (RM_NFT_001-005 added) instead of hard-coded strings; the input-file checks use
host.file and the selective cleanup runs Pulp through run_pulp, so no test calls host.run itself.

image_build_manager: the registry image check moved to library/functions/registry_func.py, and the two
NFT security IDs follow the approved IMGBM_NFT_<SEQ> format (IMGBM_NFT_SECURITY_001/002 to
IMGBM_NFT_005/006).

Baselines raised to the new scores (repo_manager 80.28 to 91.1, image_build_manager 92.5 to 100).

Signed-off-by: balajikumaran-c-s <balajikumaran.cs@dell.com>
…it, unique IDs; score 100

setup_env.sh no longer accepts the OIM password as an argument (it was visible in ps) nor expands it
in an unquoted heredoc: --password-env NAME and --password-stdin replace --password, which now fails
with the way to do it. The password step itself was broken (it passed a dict to
encrypt_test_credentials); it now writes the credential file with mode 0600 and encrypts it, checked
with a password that has quotes and a dollar sign. The unused duplicate registry entry that repeated
RM_FVT_CLEANUP_REPOS_E001 is removed, the three repo_manager known-debt waivers are removed, and the
baseline is raised to 100.

Signed-off-by: balajikumaran-c-s <balajikumaran.cs@dell.com>

This branch has not been deployed

No deployments
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