File: execve-null-envp.t

package info (click to toggle)
fakechroot 2.20.1%2Bds-18
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,904 kB
  • sloc: ansic: 7,688; sh: 1,917; makefile: 375; perl: 191; java: 5
file content (30 lines) | stat: -rwxr-xr-x 969 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

srcdir=${srcdir:-.}
. $srcdir/common.inc.sh

prepare 4

chroot=fakechroot
version=`grep '^VERSION = ' "$srcdir/Makefile" | sed 's/.* = //'`

CLEARED=paranoid
export CLEARED

t=`LC_ALL=C $srcdir/$chroot.sh $testtree /bin/sh -c 'CLEARED=something; echo $CLEARED' 2>&1`
test "$t" = "something" || not
ok "$chroot echo \$CLEARED returns" $t

t=`LC_ALL=C $srcdir/$chroot.sh $testtree /bin/sh -c 'CLEARED=something; test-execve-null-envp "echo \\\$CLEARED"' 2>&1`
test -z "$t" || not
ok "$chroot test-execve-null-envp echo \$CLEARED returns" $t

t=`LC_ALL=C $srcdir/$chroot.sh $testtree /bin/sh -c 'test-execve-null-envp "echo \\\$FAKECHROOT"' 2>&1`
test "$t" = "true" || not
ok "$chroot test-execve-null-envp echo \$FAKECHROOT returns" $t

t=`LC_ALL=C $srcdir/$chroot.sh $testtree /bin/sh -c 'test-execve-null-envp "echo \\\$FAKECHROOT_VERSION"' 2>&1`
test "$t" = "$version" || not
ok "$chroot test-execve-null-envp echo \$FAKECHROOT_VERSION returns" $t

cleanup