| 1 | #!/bin/bash |
| 2 | # test close(0); open() pair will create FD=0 |
| 3 | set -ex |
| 4 | |
| 5 | TESTDIR=$(mktemp -d ) |
| 6 | TESTCODE=$(readlink -f tests/021_test_open.c) |
| 7 | |
| 8 | cd "${TESTDIR}" |
| 9 | mkdir 1/ |
| 10 | # make a few files for testing. |
| 11 | touch 1/a 1/b 1/c 1/d |
| 12 | ln -s a 1/f |
| 13 | ln -s b 1/g |
| 14 | cp -al 1/ 2 |
| 15 | # first, exclude non-cowdancer problem |
| 16 | 021_test_open "${TESTCODE}" |
| 17 | #check that cowdancer works. |
| 18 | cow-shell 021_test_open "${TESTCODE}" |
| 19 | RET=$? |
| 20 | echo $RET |
| 21 | |
| 22 | rm -rf ${TESTDIR} |