aboutsummaryrefslogtreecommitdiff
path: root/t/test_pbuilder-satisfydepends-checkparams
blob: ccb044db032cefd245eba1c9b6f85e82ab4c5f64 (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
#!/bin/bash

TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
    . "$TD/testlib.sh"
    PBUILDER_SATISFYDEPENDS_CHECKPARAMS="$PBUILDER_CHECKOUT/pbuilder-satisfydepends-checkparams"
else
    . "$TD/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