Install all packages in debs directory if debs boot parameter is specified
[grml-autoconfig.git] / tests / test_debs.sh
1 #!/bin/zsh
2 # This test does not use shunit2 as shunit2 requires shwordsplit
3 # But shwordsplit is not enabled per default in zsh and needs to be
4 # taken care of in autoconfig.functions.
5
6 EXPECTED_COUNT=4
7 dpkg() {
8     # remove the -i parameter
9     shift
10
11     if [ $# -ne $EXPECTED_COUNT ] ; then
12         echo "wrong parameter count for dpkg, was $# expected $EXPECTED_COUNT" >&2
13         exit 1
14     fi
15 }
16
17 test_debs() {
18     . ../autoconfig.functions
19     CMDLINE='debs'
20     INSTALLED=''
21
22     TMPDIR=$(mktemp -d)
23     DCSDIR="$TMPDIR"
24     DEB_DIR="$DCSDIR"/debs
25     mkdir -p "$DEB_DIR"
26     touch "$DEB_DIR"/{1..$EXPECTED_COUNT}.deb
27
28     einfo() { echo "$*"; }
29     eend() { echo ; }
30     config_debs
31
32     rm -rf "$TMPDIR"
33 }
34
35 test_debs