pmrep: fix archive end time reporting
[pcp.git] / qa / 197
blob1b025189a7ae615d21f6b2876dd56b5108f5620e
1 #! /bin/sh
2 # PCP QA Test No. 197
3 # pmNewContext used to leak file descriptors across an exec()
4 # The close-on-exec flag is now set to prevent this.
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard filters
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 trap "rm -f $tmp.*; exit" 0 1 2 3 15
19 # real QA test starts here
20 src/context_fd_leak 4 >$tmp.out
22 # invocation 1: at startup, next free file descriptor = 3 at exit, next free file descriptor = 9
24 # expected range for the exit fd is >=4 and <= 12 ... depends on how
25 # libpcp is built, version of nss/nspr installed, ... but it needs to
26 # be the _same_ for all lines of output
28 $PCP_AWK_PROG <$tmp.out '
29 BEGIN { n = 0 }
30 /free file descriptor = / { if (n == 0 && $NF >=4 && $NF <=12) { n = $NF }
31 if (n == $NF) $NF = "OK"
33 { print }'