diff options
Diffstat (limited to 'src/test/test_autoupdate.sh')
-rw-r--r-- | src/test/test_autoupdate.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/test/test_autoupdate.sh b/src/test/test_autoupdate.sh index e2eaf08..80ffa1b 100644 --- a/src/test/test_autoupdate.sh +++ b/src/test/test_autoupdate.sh @@ -9,9 +9,6 @@ export PACKAGE_DIR="${PACKAGE_DIR:-/var/spool/slack-autoupdate}" # Packages are temperarily stored here until success. export STAGING_DIR="${STAGING_DIR:-/var/cache/slack-autoupdate/staging}" -# The system's local Slackware mirror. -export LOCAL_MIRROR=${LOCAL_MIRROR:-"/var/cache/slack-autoupdate/mirror"} - # Use fake chmod and chown commands to avoid errors when making packages. BIN_DIR="$(realpath $(dirname "${BASH_SOURCE[0]}"))/bin" @@ -59,23 +56,26 @@ bwrap \ --" $INSTANCE ln -s ../lib/pkgtools/packages "/var/log/packages" +$INSTANCE mkdir --parents "/var/lib/pkgtools/packages" echo "Preparing slackpkg test case" ( - mkdir -p "$TEST_DIR/etc" + mkdir --parents "$TEST_DIR/etc" cp --recursive /etc/slackpkg "$TEST_DIR/etc/" - echo http://mirrors.kernel.org/slackware/slackware64-14.2/ > "$TEST_DIR/etc/slackpkg/mirrors" + echo http://mirrors.slackware.com/slackware/slackware64-15.0/ > "$TEST_DIR/etc/slackpkg/mirrors" echo "WGETFLAGS=\"-4 --quiet\"" >> "$TEST_DIR/etc/slackpkg/slackpkg.conf" # REMOVE ME - yes | $INSTANCE slackpkg update >/dev/null || exit 1 - echo http://mirrors.kernel.org/slackware/slackware64-15.0/ > "$TEST_DIR/etc/slackpkg/mirrors" + + yes | $INSTANCE slackpkg update gpg + $INSTANCE slackpkg -batch=on -default_answer=y update + touch "$TEST_DIR/var/lib/pkgtools/packages/xpdf-4.00-x86_64-3" + touch "$TEST_DIR/var/lib/pkgtools/packages/xz-5.0.0-x86_64-4_slack15.0" ) echo "Preparing sbotools test case" ( $INSTANCE sboconfig --pkg-dir "$STAGING_DIR" >/dev/null - mkdir -p "$TEST_DIR/var/lib/pkgtools/packages" touch "$TEST_DIR/var/lib/pkgtools/packages/bubblewrap-0.7.0-x86_64-1_SBo" $INSTANCE sbosnap fetch ) @@ -104,11 +104,11 @@ if [ ! -f "$TEST_DIR/$PACKAGE_DIR/info.txt" ]; then echo "expected '$PACKAGE_DIR/info.txt' file to be created" fi -$INSTANCE slackpkg -mirror="file:///$LOCAL_MIRROR/" check-updates >/dev/null -if [ "$?" -ne 100 ]; then +if [ -z "$(find "$TEST_DIR/$PACKAGE_DIR" -name 'xpdf-*.t*z')" ] \ + || [ -z "$(find "$TEST_DIR/$PACKAGE_DIR" -name 'xz-*.t*z')" ]; then TESTS_PASS=false - echo "slackpkg: expected to have updates available but had exit code $?" + echo "slackpkg: expected to have xpdf and xz package update" else echo "slackpkg: ok" fi |