File: 021_test_open.sh

package info (click to toggle)
cowdancer 0.90
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 648 kB
  • sloc: ansic: 4,593; sh: 407; makefile: 142; cpp: 5
file content (22 lines) | stat: -rwxr-xr-x 421 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# test close(0); open() pair will create FD=0
set -ex

TESTDIR=$(mktemp -d )
TESTCODE=$(readlink -f tests/021_test_open.c)

cd "${TESTDIR}"
mkdir 1/
# make a few files for testing.
touch 1/a 1/b 1/c 1/d
ln -s a 1/f
ln -s b 1/g
cp -al 1/ 2
# first, exclude non-cowdancer problem
021_test_open "${TESTCODE}"
#check that cowdancer works.
cow-shell 021_test_open "${TESTCODE}"
RET=$?
echo $RET

rm -rf ${TESTDIR}