From 31f03d0a978df94d4336394923d698c1689d7fcf Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 1 Mar 2022 17:29:59 +0100 Subject: Add tests/file-wait This tests that indexamajig --wait-for-file works --- tests/file-wait | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 tests/file-wait (limited to 'tests/file-wait') diff --git a/tests/file-wait b/tests/file-wait new file mode 100755 index 00000000..69c11c90 --- /dev/null +++ b/tests/file-wait @@ -0,0 +1,38 @@ +#!/bin/sh + +INDEXAMAJIG=$1 +INFILE=$2 +GEOM=$3 + +function make_link { + sleep 5 + ln -s $INFILE file_wait_input.h5 +} + +if [ -f file_wait_input.h5 ]; then + echo file_wait_input.h5 exists. Not proceeding! + exit 1 +fi + +if [ -f file_wait_input.lst ]; then + echo file_wait_input.lst exists. Not proceeding! + exit 1 +fi + +if [ -f file_wait_input.stream ]; then + echo file_wait_input.stream exists. Not proceeding! + exit 1 +fi + +make_link & + +echo "file_wait_input.h5" > file_wait_input.lst +$INDEXAMAJIG -i file_wait_input.lst -o file_wait_input.stream -g $GEOM --wait-for-file=10 +OUTVAL=$? + +wait +rm -f file_wait_input.h5 file_wait_input.lst file_wait_input.stream + +if [ $OUTVAL -ne 0 ]; then + exit 1; +fi -- cgit v1.2.3