File: common.inc.sh

package info (click to toggle)
libnss-docker 0.02-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 1,676 kB
  • sloc: sh: 4,557; ansic: 320; makefile: 63
file content (31 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (4)
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
TRUE=0
FALSE=1

testtree=testtree-`basename $0 .t`

is_root () {
    if [ `id -u` = 0 ] && [ -z "$FAKEROOTKEY" ]; then
        return $TRUE
    else
        return $FALSE
    fi
}

cleanup () {
    test -n "$TEST_NO_CLEANUP" && ! test "$TEST_NO_CLEANUP" = 0 || rm -rf $testtree

    end
}

prepare () {
    plan $1

    rm -rf $testtree
    "$srcdir/testtree.sh" $testtree
    test "`cat $testtree/CHROOT 2>&1`" = "$testtree" || bail_out "cannot create $testtree"

    unset FAKECHROOT_CMD_SUBST FAKECHROOT_DEBUG FAKECHROOT_EXCLUDE_PATH
}

. "$srcdir/seq.inc.sh"
. "$srcdir/tap.inc.sh"