[go: up one dir, main page]

False positive for existence of non-image file

Bug source: /charliecloud/test/run.bats Edit: Added markup syntax, reproduction steps, and expected/observed behavior

Reproduction

After a successful $ make test-build, this bug can be reproduced by the following:

  1. Assuming the CH_TEST_IMGDIR environment variable is set to /var/tmp/images, create the directory: $ mkdir /var/tmp/images

  2. Run $ make test-run

Expected Behavior

Since the /var/tmp/images directory is empty, the "prepare images directory" test should pass.

Observed Behavior

The test will terminate with the following error: $ found non-image /var/tmp/images; aborting


Cause

Line 10 in run.bats: if [[ -d $i && -f $i/WEIRD_AL_YANKOVIC ]]; then will generate a false positive for the existence of a non-image file and exit with a failure if the directory assigned to the CH_TEST_IMGDIR already exists and is empty.