aboutsummaryrefslogtreecommitdiff
path: root/t/test_pbuilder-satisfydepends-checkparams
diff options
context:
space:
mode:
Diffstat (limited to 't/test_pbuilder-satisfydepends-checkparams')
-rwxr-xr-xt/test_pbuilder-satisfydepends-checkparams51
1 files changed, 51 insertions, 0 deletions
diff --git a/t/test_pbuilder-satisfydepends-checkparams b/t/test_pbuilder-satisfydepends-checkparams
new file mode 100755
index 0000000..ccb044d
--- /dev/null
+++ b/t/test_pbuilder-satisfydepends-checkparams
@@ -0,0 +1,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