[go: up one dir, main page]

File: cp.t

package info (click to toggle)
fakechroot 2.19-3.3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,148 kB
  • sloc: ansic: 6,893; sh: 5,995; makefile: 349; perl: 169; java: 5
file content (36 lines) | stat: -rwxr-xr-x 899 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
31
32
33
34
35
36
#!/bin/sh

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

prepare 4

case "`uname -s`" in
    Linux|KFreeBSD)
        CP_ARGS=-dp;;
    *)
        CP_ARGS=-a;;
esac

for chroot in chroot fakechroot; do

    if [ $chroot = "chroot" ] && ! is_root; then
        skip $(( $tap_plan / 2 )) "not root"
    else

        echo 'something' > $testtree/file-$chroot
        ln -s /file-$chroot $testtree/symlink-$chroot

        t=`$srcdir/$chroot.sh $testtree /bin/sh -c "cp $CP_ARGS /file-$chroot /file2-$chroot; cat /file2-$chroot" 2>&1`
        test "$t" = "something" || not
        ok "$chroot cp $CP_ARGS /file-$chroot /file2-$chroot:" $t

        t=`$srcdir/$chroot.sh $testtree /bin/sh -c "cp $CP_ARGS /symlink-$chroot /symlink2-$chroot; cat /symlink2-$chroot" 2>&1`
        test "$t" = "something" || not
        ok "$chroot cp $CP_ARGS /symlink-$chroot /symlink2-$chroot:" $t

    fi

done

cleanup