blob: 036a048656c1b64ae61f9505f27114ca4046b45f (
plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#!/bin/bash
if [ -n "$PBUILDER_CHECKOUT" ]; then
. "$PBUILDER_CHECKOUT/testlib.sh"
PBUILDER_SATISFYDEPENDS_CHECKPARAMS="$PBUILDER_CHECKOUT/pbuilder-satisfydepends-checkparams"
else
# these currently don't need to be exported
PBUILDER_TEST_ROOT="${PBUILDER_ROOT:-}"
PBUILDER_TEST_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
. "$PBUILDER_TEST_PKGLIBDIR/testlib.sh"
PBUILDER_SATISFYDEPENDS_CHECKPARAMS="$PBUILDER_TEST_PKGLIBDIR/pbuilder-satisfydepends-checkparams"
fi
# testsuite to test pbuilder-satisfydepends-checkparams.
# mock function
checkbuilddep_internal() {
: # do nothing function
}
test_chrootexec2() {
set -- --internal-chrootexec 'chroot /tmp-hoge ' --chroot /tmp
. "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS"
}
expect_fail test_chrootexec2
test_chrootexec1() {
set -- --chroot /tmp --internal-chrootexec 'chroot /tmp-hoge '
. "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS"
}
expect_success test_chrootexec1
test_chrootexec_echo() {
set -- --echo --chroot /tmp
. "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS"
}
expect_fail test_chrootexec_echo
test_chrootexec_echo2() {
set -- --chroot /tmp --echo
. "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS"
echo $CHROOTEXEC
}
expect_output "echo chroot /tmp" test_chrootexec_echo2
test_chrootexec_expect() {
set -- --chroot /tmp --internal-chrootexec 'chroot /tmp-hoge '
. "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS"
echo $CHROOTEXEC
}
expect_output "chroot /tmp-hoge" test_chrootexec_expect
testlib_summary
|