X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=tests%2Ftest_debs.sh;fp=tests%2Ftest_debs.sh;h=a1f5aa30b0961bc34e7837f2174c5ada05e883df;hp=0000000000000000000000000000000000000000;hb=d019c32acd94fb73afadbc8d0d6cf8cc23cde18c;hpb=2da1af5fd908813a61a520955bfb90a19396877f diff --git a/tests/test_debs.sh b/tests/test_debs.sh new file mode 100755 index 0000000..a1f5aa3 --- /dev/null +++ b/tests/test_debs.sh @@ -0,0 +1,33 @@ +#!/bin/zsh +# This test does not use shunit2 as shunit2 requires shwordsplit +# But shwordsplit is not enabled per default in zsh and needs to be +# taken care of in autoconfig.functions. + +EXPECTED_COUNT=4 +dpkg() { + # remove the -i parameter + shift + + if [ $# -ne $EXPECTED_COUNT ] ; then + echo "wrong parameter count for dpkg, was $# expected $EXPECTED_COUNT" >&2 + exit 1 + fi +} + +test_debs() { + . ../autoconfig.functions + CMDLINE='debs=*' + INSTALLED='' + + TMPDIR=$(mktemp -d) + DCSDIR="$TMPDIR" + DEB_DIR="$DCSDIR"/debs + mkdir -p "$DEB_DIR" + touch "$DEB_DIR"/{1..$EXPECTED_COUNT}.deb + + config_debs + + rm -rf "$TMPDIR" +} + +test_debs