tests: Fix tools::is_hdd unit tests

Correct the unit tests for tools::is_hdd to avoid making assumptions
about the configuration of a particular device based solely on the
value of the __GLIBC__ preprocessor flag. Instead, rely on the
test invoker to provide paths for devices of specific types via
the process environment, thereby avoiding faulty assumptions and
improving the specificity of test assertions. To ensure appropriate
devices exist, add a script, tests/create_test_disks.sh, which
configures loopback devices mirroring relevant configurations.
This commit is contained in:
iamamyth
2025-01-17 02:48:48 -08:00
parent c0f3a1c1db
commit f48a73d919
3 changed files with 121 additions and 9 deletions

View File

@@ -213,6 +213,8 @@ jobs:
run: sudo ${{env.APT_INSTALL_LINUX}}
- name: install Python dependencies
run: pip install requests psutil monotonic zmq deepdiff
- name: create dummy disk drives for testing
run: tests/create_test_disks.sh >> $GITHUB_ENV
- name: tests
env:
CTEST_OUTPUT_ON_FAILURE: ON