#!/bin/bash # $HeadURL$ $LastChangedRevision$ PROGNAME=`basename $0` SANDPIT=`pwd` . $(ade-config ade_share_prefix)/include/adetestsupport.sh # Ensure dates are consistently formatted export LC_ALL=C # Set variables used in this test # Ensure DB is created in sandpit export PAA_RCDIR=$SANDPIT/.paa # Don't try to move old state files out of the real directory export PAA_STATE_PREFIX=$SANDPIT/var CMD="paa -v repo reponame xxx owned true" echo "calling \"$CMD\" (i.e. bad package type) ..." adetestsupport_invert_rc "$CMD" echo CMD="paa -v repo reponame deb xxx true" echo "calling \"$CMD\" (i.e. bad repo type) ..." adetestsupport_invert_rc "$CMD" echo CMD="paa -v repo reponame deb owned xxx" echo "calling \"$CMD\" (i.e. bad is-distro flag) ..." adetestsupport_invert_rc "$CMD" echo echo "setting up a respository to allow testing the insert command with bad parameters ..." paa -v repo reponame deb owned false mkdir -p $SANDPIT/bin echo -e '#!/bin/sh\n\ncat > $1' > $SANDPIT/bin/caton chmod 755 $SANDPIT/bin/caton export EDITOR=$SANDPIT/bin/caton mkdir -p $SANDPIT/repos/reponame paa -v editrepo reponame <./" path $SANDPIT/repos/reponame origin "Joe Bloggs" label "Joe Bloggs" signer "jbloggs" mirror_dir $SANDPIT/mirrors/reponame freeze_dir $SANDPIT/freezes/reponame indirect_dir $SANDPIT/indirects/reponame EOF echo CMD="paa -v insert xxx lenny,squeeze main $ADETEST_MODROOT/tests/in/*.deb" # Can't say 'echo "$CMD"' 'cos that varies. echo "calling \"paa -v insert xxx lenny,squeeze main ...\" (i.e. bad reponame) ..." adetestsupport_invert_rc "$CMD" echo CMD="paa -v insert reponame xxx main $ADETEST_MODROOT/tests/in/*.deb" # Can't say 'echo "$CMD"' 'cos that varies. echo "calling \"paa -v insert reponame xxx main ...\" (i.e. bad release) ..." adetestsupport_invert_rc "$CMD" echo CMD="paa -v insert reponame xxx,squeeze main $ADETEST_MODROOT/tests/in/*.deb" # Can't say 'echo "$CMD"' 'cos that varies. echo "calling \"paa -v insert reponame xxx,squeeze main ...\" (i.e. one bad release, one good release) ..." adetestsupport_invert_rc "$CMD" echo CMD="paa -v insert reponame lenny,squeeze xxx $ADETEST_MODROOT/tests/in/*.deb" # Can't say 'echo "$CMD"' 'cos that varies. echo "calling \"paa -v insert reponame lenny,squeeze xxx ...\" (i.e. bad section) ..." adetestsupport_invert_rc "$CMD" echo ls > a-corrupt-deb-file.deb CMD="paa -v insert reponame lenny,squeeze main a-corrupt-deb-file.deb" echo "calling \"$CMD\" (i.e. bad bad deb file) ..." adetestsupport_invert_rc "$CMD" echo