~dexter/fakechroot/natty

« back to all changes in this revision

Viewing changes to test/t/popen.t

  • Committer: piotr.roszatycki at gmail
  • Date: 2010-09-12 18:21:38 UTC
  • mfrom: (0.1.7 upstream)
  • Revision ID: piotr.roszatycki@gmail.com-20100912182138-dpjazxgvcscsgd7e
* New upstream release:
  - All Debian patches were applied upstream.
  - Fixed getsockname(2) and getpeername(2) functions and bug when
    "host 127.0.0.1" is called. Closes: #596435.
  - Fixed canonicalize_file_name(3) function and bug when "man-db" command
    is called.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
prepare 4
7
7
 
 
8
case "`uname -s`" in
 
9
    Linux|KFreeBSD)
 
10
        exe=exe;;
 
11
    *)
 
12
        exe=file;;
 
13
esac
 
14
 
8
15
fakedir=`cd testtree; pwd -P`
9
16
 
10
17
for chroot in chroot fakechroot; do
16
23
        echo 'something' > testtree/$chroot-file
17
24
        echo "cat /$chroot-file" > testtree/$chroot-popen.sh
18
25
 
19
 
        t=`( $srcdir/$chroot.sh testtree /bin/test-popen 'trap "exit 0" USR1; for i in $(seq 1 10240); do echo $$; done' | while read pid; do readlink /proc/$pid/exe; kill -USR1 $pid; exit; done ) 2>&1`
20
 
        test "$t" = "$fakedir/bin/sh" || not
21
 
        ok "$chroot popen shell is" $t
 
26
        if [ ! -d /proc/1 ]; then
 
27
            skip 1 "/proc filesystem not found"
 
28
        else
 
29
            t=`($srcdir/$chroot.sh testtree /bin/test-popen 'echo $$ > PID; while :; do sleep 1; done' &); sleep 3; pid=$(cat testtree/PID 2>&1); readlink /proc/$pid/$exe 2>&1; kill $pid 2>/dev/null`
 
30
            test "$t" = "$fakedir/bin/sh" || not
 
31
            ok "$chroot popen shell is" $t
 
32
        fi
22
33
 
23
34
        t=`$srcdir/$chroot.sh testtree /bin/test-popen ". /$chroot-popen.sh" 2>&1`
24
35
        test "$t" = "something" || not