Skip to content

use of utilities in test h5_test/run_h5_zstd_tests.sh, which should not run with --disable-utilities, but does #3289

@edhartnett

Description

@edhartnett

I have a fix and will put it up when current PRs clear out of the way...

h5_test/run_h5_zstd_tests.sh fails when configured with --disable-utilities

Problem Summary

When netCDF-C is configured with --disable-utilities, the h5_test/run_h5_zstd_tests.sh test fails because it depends on ncdump/ncpathcvt, which is not built when utilities are disabled.

Environment

  • OS: CYGWIN_NT-10.0-26100 (x86_64)
  • netCDF Version: 4.10.0-development
  • Build Type: Autotools (./configure && make)

Steps to Reproduce

autoreconf -i
./configure --disable-dap --disable-utilities
make -j check

Expected Behavior

Tests that depend on utilities should either:

  1. Be skipped when --disable-utilities is used, OR
  2. Not depend on utility programs

Actual Behavior

The test fails with:

FAIL: run_h5_zstd_tests
=======================

./run_h5_zstd_tests.sh: 1: /home/ed/netcdf-c/h5_test/findplugin.sh: /home/ed/netcdf-c/ncdump/ncpathcvt: not found
FAIL run_h5_zstd_tests.sh (exit status: 127)

Root Cause

The h5_test/findplugin.sh script calls ncpathcvt (located in ncdump/) to perform path conversions. When utilities are disabled, ncdump is not built, so ncpathcvt does not exist, causing the test script to fail with exit code 127 (command not found).

The relevant code in h5_test/findplugin.sh:

# The script sources test_common.sh which eventually calls ncpathcvt

Impact

  • 26 out of 27 HDF5 tests pass (tst_h_* programs)
  • Only the shell script wrapper run_h5_zstd_tests.sh fails
  • This is a test infrastructure issue, not a library bug

Possible Solutions

Option 1: Skip the test when utilities are disabled

Add a check at the start of run_h5_zstd_tests.sh:

if test ! -x "${TOPBUILDDIR}/ncdump/ncpathcvt"; then
    echo "SKIPPED: ncpathcvt not available (configured with --disable-utilities)"
    exit 77
fi

Option 2: Guard in Makefile.am

Only include run_h5_zstd_tests.sh in TESTS if utilities are enabled:

if ENABLE_UTILITIES
TESTS += run_h5_zstd_tests.sh
endif

Option 3: Remove the dependency

Refactor findplugin.sh to not require ncpathcvt for basic path operations that could be done with standard shell utilities.

Workaround

Until this is fixed, users can:

  1. Run individual HDF5 tests directly: make check TESTS=tst_h_zstd
  2. Or rebuild without --disable-utilities

Additional Notes

  • This issue likely affects other shell script tests in h5_test/ that use findplugin.sh
  • The actual HDF5 zstd functionality works fine (the tst_h_zstd binary passes when run directly)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions