From c8aa1eb481c18b1a35ef45d37071ab1af804a382 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sat, 15 May 2021 10:24:20 +0200 Subject: [PATCH] Add preliminary support for Duck --- script/dev-env-duck.sh | 52 ++++++++++++++++++++++++++++++++++++++++++ script/test-smoke.sh | 19 +++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 script/dev-env-duck.sh diff --git a/script/dev-env-duck.sh b/script/dev-env-duck.sh new file mode 100644 index 00000000..f9d96021 --- /dev/null +++ b/script/dev-env-duck.sh @@ -0,0 +1,52 @@ +mkdir -p /tmp/garage.cyberduck.home/.duck/profiles + +DUCK_ACCESS_KEY=`cat /tmp/garage.s3 |cut -d' ' -f1` +DUCK_SECRET_KEY=`cat /tmp/garage.s3 |cut -d' ' -f2` + +cat > /tmp/garage.cyberduck.home/.duck/credentials < /tmp/garage.cyberduck.home/.duck/profiles/garage.cyberduckprofile < + + + + Protocol + s3 + Vendor + garage + Scheme + https + Description + GarageS3 + Default Hostname + 127.0.0.1 + Default Port + 4443 + Hostname Configurable + + Port Configurable + + Username Configurable + + Username Placeholder + Access Key ID (GK...) + Password Placeholder + Secret Key + Properties + + s3service.disable-dns-buckets=true + + Region + garage + Regions + + garage + + + +EOF + +function duck { HOME=/tmp/garage.cyberduck.home/ command duck --username $DUCK_ACCESS_KEY $@ ; } + diff --git a/script/test-smoke.sh b/script/test-smoke.sh index 9fe06de9..0417b2af 100755 --- a/script/test-smoke.sh +++ b/script/test-smoke.sh @@ -10,6 +10,9 @@ GARAGE_DEBUG="${REPO_FOLDER}/target/debug/" GARAGE_RELEASE="${REPO_FOLDER}/target/release/" PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH" +# @FIXME Duck is not ready for testing, we have a bug +SKIP_DUCK=1 + echo "⏳ Setup" cargo build ${SCRIPT_FOLDER}/dev-clean.sh @@ -90,6 +93,22 @@ if [ -z "$SKIP_RCLONE" ]; then done fi +# Duck (aka Cyberduck CLI) +if [ -z "$SKIP_DUCK" ]; then + echo "🛠️ Testing with duck (aka cyberduck cli)" + source ${SCRIPT_FOLDER}/dev-env-duck.sh + duck --list garage:/ + duck --mkdir "garage:/eprouvette/duck" + for idx in $(seq 1 3); do + duck --verbose --upload "garage:/eprouvette/duck/" "/tmp/garage.$idx.rnd" + duck --list garage:/eprouvette/duck/ + duck --download "garage:/eprouvette/duck/garage.$idx.rnd" "/tmp/garage.$idx.dl" + diff /tmp/garage.$idx.rnd /tmp/garage.$idx.dl + rm /tmp/garage.$idx.dl + duck --delete "garage:/eprouvette/duck/garage.$idx.dk" + done +fi + rm /tmp/garage.{1,2,3}.rnd if [ -z "$SKIP_AWS" ]; then