Skip to content

nvml-mock-nri: unit tests, unix.Major/Minor, stale LD_PRELOAD comment #439

Description

@ArangoGutierrez

Follow-ups from PR #433 review triage — small correctness and hygiene items on the new NRI binary.

  • cmd/nvml-mock-nri has no unit tests: fromNRI, toNRI, nriDevice, splitCSV, envOr, major, minor are all uncovered.
  • Replace the hand-rolled major()/minor() with unix.Major/unix.Minor from the vendored golang.org/x/sys/unix: the current formula (dev >> 8) & 0xfff omits glibc's high-bits term, truncating majors >= 4096 (harmless with today's 195/510 majors, but a correct drop-in exists).
  • Update the stale LD_PRELOAD comment in deployments/nvml-mock/helm/nvml-mock/templates/daemonset.yaml (~line 137): it enumerates the shims as infiniband-only ("every other path passes through unchanged"), which libpcimocksys.so.1 (PCI sysfs rewriting) made false.

Acceptance: table-driven tests for the helpers; comment matches the actual shim chain.

Metadata

Metadata

Labels

kind/testissue/PR to fix/edit/create/enhance a project unit/e2e test

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions