Skip to content

Commit

Permalink
Invoke tests with verbose logging
Browse files Browse the repository at this point in the history
Invoke apt update initially

Because the github runner image could be without any metadata indices
  • Loading branch information
rickysarraf committed Apr 5, 2024
1 parent 69701bd commit 05e3ed7
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 136 deletions.
108 changes: 46 additions & 62 deletions tests/apt-offline-tests-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ BUNDLE_FILE="$DIR/bundle-file.zip"
THREADS=5
APT_OFFLINE="./apt-offline "

run()
{
echo "Executing command: $1"
$1
}

set_features () {
if [ ! -z $1 ]; then
URI=$1
Expand All @@ -21,73 +27,59 @@ set_features () {
# Needs root
APT_OFFLINE="sudo $APT_OFFLINE"

echo "Executing command 'set $URI --simulate '"
$APT_OFFLINE set $URI --simulate --update --upgrade
run "sudo apt update"

echo "Executing command 'set $URI --update'"
$APT_OFFLINE set $URI --update
run "$APT_OFFLINE set $URI --simulate --update --upgrade"

echo "Executing command 'set $URI --upgrade'"
$APT_OFFLINE set $URI --upgrade
run "$APT_OFFLINE set $URI --update"

echo "Executing command 'set $URI --update --upgrade'"
$APT_OFFLINE set $URI --update --upgrade
run "$APT_OFFLINE set $URI --upgrade"

echo "Executing command 'set $URI --update --upgrade --upgrade-type upgrade'"
$APT_OFFLINE set $URI --update --upgrade --upgrade-type upgrade
run "$APT_OFFLINE set $URI --update --upgrade"

echo "Executing command 'set $URI --update --upgrade --upgrade-type upgrade --release $RELEASE'"
$APT_OFFLINE set $URI --update --upgrade --upgrade-type upgrade --release $RELEASE
run "$APT_OFFLINE set $URI --update --upgrade --upgrade-type upgrade"

echo "Executing command 'set $URI --install-packages $DISLIKED_PACKAGES'"
$APT_OFFLINE set $URI --install-packages $DISLIKED_PACKAGES
run "$APT_OFFLINE set $URI --update --upgrade --upgrade-type upgrade --release $RELEASE"

echo "Executing command 'set $URI --install-packages $DISLIKED_PACKAGES --release $RELEASE'"
$APT_OFFLINE set $URI --install-packages $DISLIKED_PACKAGES --release $RELEASE
run "$APT_OFFLINE set $URI --install-packages $DISLIKED_PACKAGES"

echo "Executing command 'set $URI --install-src-packages $DISLIKED_SRC_PACKAGES'"
$APT_OFFLINE set $URI --install-src-packages $DISLIKED_SRC_PACKAGES
run "$APT_OFFLINE set $URI --install-packages $DISLIKED_PACKAGES --release $RELEASE"

echo "Executing command 'set $URI --install-src-packages $DISLIKED_SRC_PACKAGES --release $RELEASE'"
$APT_OFFLINE set $URI --install-src-packages $DISLIKED_SRC_PACKAGES --release $RELEASE
run "$APT_OFFLINE set $URI --install-src-packages $DISLIKED_SRC_PACKAGES"

echo "Executing command 'set $URI --src-build-dep --install-src-packages $DISLIKED_SRC_PACKAGES'"
$APT_OFFLINE set $URI --src-build-dep --install-src-packages $DISLIKED_SRC_PACKAGES
run "$APT_OFFLINE set $URI --install-src-packages $DISLIKED_SRC_PACKAGES --release $RELEASE"

echo "Executing command 'set $URI --src-build-dep --install-src-packages $DISLIKED_SRC_PACKAGES --release $RELEASE'"
$APT_OFFLINE set $URI --src-build-dep --install-src-packages $DISLIKED_SRC_PACKAGES --release $RELEASE
run "$APT_OFFLINE set $URI --src-build-dep --install-src-packages $DISLIKED_SRC_PACKAGES"

run "$APT_OFFLINE set $URI --src-build-dep --install-src-packages $DISLIKED_SRC_PACKAGES --release $RELEASE"

}

get_features () {
if [ ! -z $1 ]; then
URI=$1
fi
echo "Executing command 'get $URI '"
$APT_OFFLINE get $URI --quiet --bundle $BUNDLE_FILE

run "sudo apt update"

run "$APT_OFFLINE get $URI --quiet --bundle $BUNDLE_FILE"
rm -f $BUNDLE_FILE

echo "Executing command 'get $URI --threads $THREADS'"
$APT_OFFLINE get $URI --quiet --threads $THREADS --bundle $BUNDLE_FILE
run "$APT_OFFLINE get $URI --quiet --threads $THREADS --bundle $BUNDLE_FILE"
rm -f $BUNDLE_FILE

echo "Executing command 'get $URI --threads $THREADS --socket-timeout 30'"
$APT_OFFLINE get $URI --quiet --threads $THREADS --socket-timeout 30 --bundle $BUNDLE_FILE --bug-reports
run "$APT_OFFLINE get $URI --quiet --threads $THREADS --socket-timeout 30 --bundle $BUNDLE_FILE --bug-reports"

echo "Executing command 'get $URI --threads $THREADS -d $DOWNLOAD_DIR'"
$APT_OFFLINE get $URI --quiet --threads $THREADS -d $DOWNLOAD_DIR
run "$APT_OFFLINE get $URI --quiet --threads $THREADS -d $DOWNLOAD_DIR"
rm -rf $DOWNLOAD_DIR

echo "Executing command 'get $URI --threads $THREADS -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR'"
$APT_OFFLINE get $URI --quiet --threads $THREADS -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR
run "$APT_OFFLINE get $URI --quiet --threads $THREADS -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR"
rm -rf $DOWNLOAD_DIR

echo "Executing command 'get $URI --no-checksum -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR'"
$APT_OFFLINE get $URI --quiet --no-checksum -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR
run "$APT_OFFLINE get $URI --quiet --no-checksum -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR"
rm -rf $DOWNLOAD_DIR

echo "Executing command 'get $URI --bug-reports --threads $THREADS -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR'"
$APT_OFFLINE get $URI --quiet --threads $THREADS --bug-reports -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR
run "$APT_OFFLINE get $URI --quiet --threads $THREADS --bug-reports -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR"

}

Expand All @@ -100,17 +92,15 @@ install_features () {
# Needs root
APT_OFFLINE="sudo $APT_OFFLINE"

echo "Executing command 'install $DOWNLOAD_DIR --skip-bug-reports'"
$APT_OFFLINE install $DOWNLOAD_DIR --skip-bug-reports
run "sudo apt update"

run "$APT_OFFLINE install $DOWNLOAD_DIR --skip-bug-reports"

echo "Executing command 'install $DOWNLOAD_DIR --skip-bug-reports --allow-unauthenticated'"
$APT_OFFLINE install $DOWNLOAD_DIR --skip-bug-reports --allow-unauthenticated
run "$APT_OFFLINE install $DOWNLOAD_DIR --skip-bug-reports --allow-unauthenticated"

echo "Executing command 'install $BUNDLE_FILE --skip-bug-reports'"
$APT_OFFLINE install $BUNDLE_FILE --skip-bug-reports
run "$APT_OFFLINE install $BUNDLE_FILE --skip-bug-reports"

echo "Executing command 'install $BUNDLE_FILE --skip-bug-reports --allow-unauthenticated'"
$APT_OFFLINE install $BUNDLE_FILE --skip-bug-reports --allow-unauthenticated
run "$APT_OFFLINE install $BUNDLE_FILE --skip-bug-reports --allow-unauthenticated"
}

install_features_prompt () {
Expand All @@ -122,29 +112,23 @@ install_features_prompt () {
# Needs root
APT_OFFLINE="sudo $APT_OFFLINE"

echo "Executing command 'install $DOWNLOAD_DIR '"
$APT_OFFLINE install $DOWNLOAD_DIR
run "sudo apt update"

run "$APT_OFFLINE install $DOWNLOAD_DIR"

echo "Executing command 'install $DOWNLOAD_DIR --simulate'"
$APT_OFFLINE install $DOWNLOAD_DIR --simulate
run "$APT_OFFLINE install $DOWNLOAD_DIR --simulate"

echo "Executing command 'install $DOWNLOAD_DIR'"
$APT_OFFLINE install $DOWNLOAD_DIR --simulate
run "$APT_OFFLINE install $DOWNLOAD_DIR --simulate"

echo "Executing command 'install $DOWNLOAD_DIR --allow-unauthenticated'"
$APT_OFFLINE install $DOWNLOAD_DIR --simulate --allow-unauthenticated
run "$APT_OFFLINE install $DOWNLOAD_DIR --simulate --allow-unauthenticated"

echo "Executing command 'install $BUNDLE_FILE '"
$APT_OFFLINE install $BUNDLE_FILE
run "$APT_OFFLINE install $BUNDLE_FILE"

echo "Executing command 'install $BUNDLE_FILE --simulate'"
$APT_OFFLINE install $BUNDLE_FILE --simulate
run "$APT_OFFLINE install $BUNDLE_FILE --simulate"

echo "Executing command 'install $BUNDLE_FILE'"
$APT_OFFLINE install $BUNDLE_FILE --simulate
run "$APT_OFFLINE install $BUNDLE_FILE --simulate"

echo "Executing command 'install $BUNDLE_FILE --allow-unauthenticated'"
$APT_OFFLINE install $BUNDLE_FILE --simulate --allow-unauthenticated
run "$APT_OFFLINE install $BUNDLE_FILE --simulate --allow-unauthenticated"
}

all_features () {
Expand Down
121 changes: 47 additions & 74 deletions tests/apt-offline-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,78 +12,65 @@ BUNDLE_FILE="$DIR/bundle-file.zip"
THREADS=5
APT_OFFLINE="./apt-offline "

run()
{
echo "Executing command: $1"
$1
}

set_features () {
if [ ! -z $1 ]; then
URI=$1
fi
echo "Executing command 'set $URI'"
$APT_OFFLINE set $URI

echo "Executing command 'set $URI --simulate '"
$APT_OFFLINE set $URI --simulate
run "$APT_OFFLINE set $URI"

run "$APT_OFFLINE set $URI --simulate"

echo "Executing command 'set $URI --update'"
$APT_OFFLINE set $URI --update
run "$APT_OFFLINE set $URI --update"

echo "Executing command 'set $URI --upgrade'"
$APT_OFFLINE set $URI --upgrade
run "$APT_OFFLINE set $URI --upgrade"

echo "Executing command 'set $URI --update --upgrade'"
$APT_OFFLINE set $URI --update --upgrade
run "$APT_OFFLINE set $URI --update --upgrade"

echo "Executing command 'set $URI --update --upgrade --upgrade-type upgrade'"
$APT_OFFLINE set $URI --update --upgrade --upgrade-type upgrade
run "$APT_OFFLINE set $URI --update --upgrade --upgrade-type upgrade"

echo "Executing command 'set $URI --update --upgrade --upgrade-type upgrade --release $RELEASE'"
$APT_OFFLINE set $URI --update --upgrade --upgrade-type upgrade --release $RELEASE
run "$APT_OFFLINE set $URI --update --upgrade --upgrade-type upgrade --release $RELEASE"

echo "Executing command 'set $URI --install-packages $DISLIKED_PACKAGES'"
$APT_OFFLINE set $URI --install-packages $DISLIKED_PACKAGES
run "$APT_OFFLINE set $URI --install-packages $DISLIKED_PACKAGES"

echo "Executing command 'set $URI --install-packages $DISLIKED_PACKAGES --release $RELEASE'"
$APT_OFFLINE set $URI --install-packages $DISLIKED_PACKAGES --release $RELEASE
run "$APT_OFFLINE set $URI --install-packages $DISLIKED_PACKAGES --release $RELEASE"

echo "Executing command 'set $URI --install-src-packages $DISLIKED_PACKAGES'"
$APT_OFFLINE set $URI --install-src-packages $DISLIKED_PACKAGES
run "$APT_OFFLINE set $URI --install-src-packages $DISLIKED_PACKAGES"

echo "Executing command 'set $URI --install-src-packages $DISLIKED_PACKAGES --release $RELEASE'"
$APT_OFFLINE set $URI --install-src-packages $DISLIKED_PACKAGES --release $RELEASE
run "$APT_OFFLINE set $URI --install-src-packages $DISLIKED_PACKAGES --release $RELEASE"

echo "Executing command 'set $URI --src-build-dep --install-src-packages $DISLIKED_PACKAGES'"
$APT_OFFLINE set $URI --src-build-dep --install-src-packages $DISLIKED_PACKAGES
run "$APT_OFFLINE set $URI --src-build-dep --install-src-packages $DISLIKED_PACKAGES"

echo "Executing command 'set $URI --src-build-dep --install-src-packages $DISLIKED_PACKAGES --release $RELEASE'"
$APT_OFFLINE set $URI --src-build-dep --install-src-packages $DISLIKED_PACKAGES --release $RELEASE
run "$APT_OFFLINE set $URI --src-build-dep --install-src-packages $DISLIKED_PACKAGES --release $RELEASE"

}

get_features () {
if [ ! -z $1 ]; then
URI=$1
fi
echo "Executing command 'get $URI '"
$APT_OFFLINE get $URI

echo "Executing command 'get $URI --threads $THREADS'"
$APT_OFFLINE get $URI --threads $THREADS
run "$APT_OFFLINE get $URI"

echo "Executing command 'get $URI --threads $THREADS --socket-timeout 30'"
$APT_OFFLINE get $URI --threads $THREADS --socket-timeout 30
run "$APT_OFFLINE get $URI --threads $THREADS"

echo "Executing command 'get $URI --threads $THREADS -d $DOWNLOAD_DIR'"
$APT_OFFLINE get $URI --threads $THREADS -d $DOWNLOAD_DIR
run "$APT_OFFLINE get $URI --threads $THREADS --socket-timeout 30"

echo "Executing command 'get $URI --threads $THREADS -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR'"
$APT_OFFLINE get $URI --threads $THREADS -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR
run "$APT_OFFLINE get $URI --threads $THREADS -d $DOWNLOAD_DIR"

echo "Executing command 'get $URI --no-checksum -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR'"
$APT_OFFLINE get $URI --no-checksum -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR
run "$APT_OFFLINE get $URI --threads $THREADS -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR"

echo "Executing command 'get $URI --bug-reports --threads $THREADS -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR'"
$APT_OFFLINE get $URI --threads $THREADS --bug-reports -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR
run "$APT_OFFLINE get $URI --no-checksum -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR"

echo "Executing command 'get $URI --bug-reports --threads $THREADS --bundle $BUNDLE_FILE -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR'"
$APT_OFFLINE get $URI --threads $THREADS --bug-reports -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR --bundle $BUNDLE_FILE
run "$APT_OFFLINE get $URI --threads $THREADS --bug-reports -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR"

run "$APT_OFFLINE get $URI --threads $THREADS --bug-reports -d $DOWNLOAD_DIR --cache-dir $CACHE_DIR --bundle $BUNDLE_FILE"

}

Expand All @@ -92,59 +79,45 @@ install_features () {
DOWNLOAD_DIR=$1
BUNDLE_FILE=$1
fi
echo "Executing command 'install $DOWNLOAD_DIR --skip-bug-reports'"
$APT_OFFLINE install $DOWNLOAD_DIR --skip-bug-reports

echo "Executing command 'install $DOWNLOAD_DIR --simulate --skip-bug-reports'"
$APT_OFFLINE install $DOWNLOAD_DIR --simulate --skip-bug-reports
run "$APT_OFFLINE install $DOWNLOAD_DIR --skip-bug-reports"

run "$APT_OFFLINE install $DOWNLOAD_DIR --simulate --skip-bug-reports"

echo "Executing command 'install $DOWNLOAD_DIR --skip-bug-reports'"
$APT_OFFLINE install $DOWNLOAD_DIR --simulate --skip-bug-reports
run "$APT_OFFLINE install $DOWNLOAD_DIR --simulate --skip-bug-reports"

echo "Executing command 'install $DOWNLOAD_DIR --skip-bug-reports --allow-unauthenticated'"
$APT_OFFLINE install $DOWNLOAD_DIR --simulate --skip-bug-reports --allow-unauthenticated
run "$APT_OFFLINE install $DOWNLOAD_DIR --simulate --skip-bug-reports --allow-unauthenticated"

echo "Executing command 'install $BUNDLE_FILE --skip-bug-reports'"
$APT_OFFLINE install $BUNDLE_FILE --skip-bug-reports
run "$APT_OFFLINE install $BUNDLE_FILE --skip-bug-reports"

echo "Executing command 'install $BUNDLE_FILE --simulate --skip-bug-reports'"
$APT_OFFLINE install $BUNDLE_FILE --simulate --skip-bug-reports
run "$APT_OFFLINE install $BUNDLE_FILE --simulate --skip-bug-reports"

echo "Executing command 'install $BUNDLE_FILE --skip-bug-reports'"
$APT_OFFLINE install $BUNDLE_FILE --simulate --skip-bug-reports
run "$APT_OFFLINE install $BUNDLE_FILE --simulate --skip-bug-reports"

echo "Executing command 'install $BUNDLE_FILE --skip-bug-reports --allow-unauthenticated'"
$APT_OFFLINE install $BUNDLE_FILE --simulate --skip-bug-reports --allow-unauthenticated
run "$APT_OFFLINE install $BUNDLE_FILE --simulate --skip-bug-reports --allow-unauthenticated"
}

install_features_prompt () {
if [ ! -z $1 ]; then
DOWNLOAD_DIR=$1
BUNDLE_FILE=$1
fi
echo "Executing command 'install $DOWNLOAD_DIR '"
$APT_OFFLINE install $DOWNLOAD_DIR

echo "Executing command 'install $DOWNLOAD_DIR --simulate'"
$APT_OFFLINE install $DOWNLOAD_DIR --simulate
run "$APT_OFFLINE install $DOWNLOAD_DIR"

run "$APT_OFFLINE install $DOWNLOAD_DIR --simulate"

echo "Executing command 'install $DOWNLOAD_DIR'"
$APT_OFFLINE install $DOWNLOAD_DIR --simulate
run "$APT_OFFLINE install $DOWNLOAD_DIR --simulate"

echo "Executing command 'install $DOWNLOAD_DIR --allow-unauthenticated'"
$APT_OFFLINE install $DOWNLOAD_DIR --simulate --allow-unauthenticated
run "$APT_OFFLINE install $DOWNLOAD_DIR --simulate --allow-unauthenticated"

echo "Executing command 'install $BUNDLE_FILE '"
$APT_OFFLINE install $BUNDLE_FILE
run "$APT_OFFLINE install $BUNDLE_FILE"

echo "Executing command 'install $BUNDLE_FILE --simulate'"
$APT_OFFLINE install $BUNDLE_FILE --simulate
run "$APT_OFFLINE install $BUNDLE_FILE --simulate"

echo "Executing command 'install $BUNDLE_FILE'"
$APT_OFFLINE install $BUNDLE_FILE --simulate
run "$APT_OFFLINE install $BUNDLE_FILE --simulate"

echo "Executing command 'install $BUNDLE_FILE --allow-unauthenticated'"
$APT_OFFLINE install $BUNDLE_FILE --simulate --allow-unauthenticated
run "$APT_OFFLINE install $BUNDLE_FILE --simulate --allow-unauthenticated"
}

all_features () {
Expand Down

0 comments on commit 05e3ed7

Please sign in to comment.