Skip to content

Commit

Permalink
package: improve verify helper (#735)
Browse files Browse the repository at this point in the history
* show targets on startup
* show ID (e.g. debian:bookworm) when failed to compare versions
* skip test when "dummy" was specified for DEB_TARGETS/RPM_TARGETS
* logging for each test case (e.g.
install-debian-bookworm-on-exp-lts-5.log)

Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys authored Nov 14, 2024
1 parent c6cdc60 commit 814480a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fluent-package/test-install-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function check_installed_version()
echo "Succeeded to install $TARGET on $ID from $REPO"
;;
*)
echo "Failed to install $TARGET from $REPO"
echo "Failed to install $TARGET on $ID from $REPO"
exit 1
;;
esac
Expand Down
22 changes: 18 additions & 4 deletions fluent-package/test-verify-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@

function test_deb() {
for d in $DEB_TARGETS; do
if [ $d = "dummy" ]; then
continue
fi
for r in $REPO_TARGETS; do
echo "TEST: on $d $r"
docker run --rm -v $(pwd):/work $d /work/test-install-in-docker.sh $USER $r $VERSION
if [ $? -eq 0 ]; then
LOG=install-${d/:/-}-on-${r//\//-}.log
docker run --rm -v $(pwd):/work $d /work/test-install-in-docker.sh $USER $r $VERSION 2>&1 | tee $LOG
if [ ${PIPESTATUS[0]} -eq 0 ]; then
RESULTS="$RESULTS\nOK: $d $r"
else
RESULTS="$RESULTS\nNG: $d $r"
Expand All @@ -23,10 +27,14 @@ function test_deb() {

function test_rpm() {
for d in $RPM_TARGETS; do
if [ $d = "dummy" ]; then
continue
fi
for r in $REPO_TARGETS; do
echo "TEST: on $d $r"
docker run --rm -v $(pwd):/work $d /work/test-install-in-docker.sh $USER $r $VERSION
if [ $? -eq 0 ]; then
LOG=install-${d/:/-}-on-${r//\//-}.log
docker run --rm -v $(pwd):/work $d /work/test-install-in-docker.sh $USER $r $VERSION 2>&1 | tee $LOG
if [ ${PIPESTATUS[0]} -eq 0 ]; then
RESULTS="$RESULTS\nOK: $d $r"
else
RESULTS="$RESULTS\nNG: $d $r"
Expand All @@ -52,7 +60,13 @@ if [ -z "$REPO_TARGETS" ]; then
REPO_TARGETS="exp/5 exp/lts/5"
fi

echo "DEB_TARGETS: $DEB_TARGETS"
echo "RPM_TARGETS: $RPM_TARGETS"
echo "REPO_TARGETS: $REPO_TARGETS"
# give a grace period to terminate (Ctrl+C)
sleep 3
RESULTS=""
test_deb
test_rpm
grep "Failed to install" install-*.log
echo -e $RESULTS

0 comments on commit 814480a

Please sign in to comment.