test: Add 2, update 4 and remove 1 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 54s
Build-Test-Publish / build (linux/arm64) (push) Successful in 1m15s
Build-Test-Publish / create-manifest (push) Successful in 12s

This commit is contained in:
Your Name
2025-09-02 17:53:06 +12:00
parent 4857754618
commit 96ed3e0553
7 changed files with 466 additions and 7463 deletions

View File

@@ -1,5 +1,25 @@
#!/bin/bash
# Download dshash utility
TEMP_DIR=$(mktemp -d)
trap "rm -rf $TEMP_DIR" EXIT
DSHASH="$TEMP_DIR/dshash"
echo "Downloading dshash utility..."
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH="x86_64"
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
ARCH="aarch64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
curl -L -o "$DSHASH" "https://getbin.xyz/dshash:latest-$ARCH" 2>/dev/null || { echo "Failed to download dshash"; exit 1; }
chmod +x "$DSHASH"
echo "dshash downloaded successfully"
# read ~/.config/simple_object_storage/sos_config.json
CONFIG_PATH="./sos_config.json"
if [ ! -f "${CONFIG_PATH}" ]; then
@@ -15,7 +35,7 @@ dd if=/dev/urandom of=test_file.bin bs=1M count=1024
# Calculate original file hash
echo "Calculating original file hash..."
ORIGINAL_HASH=$(sha256sum test_file.bin | cut -d' ' -f1)
ORIGINAL_HASH=$("$DSHASH" test_file.bin)
echo "Original hash: $ORIGINAL_HASH"
# get the host and port from the config
@@ -74,8 +94,8 @@ curl -o downloaded_by_tag.bin "http://${HOST}:${PORT}/object/test:latest"
# Verify downloaded files
echo "Verifying downloaded files..."
HASH_BY_HASH=$(sha256sum downloaded_by_hash.bin | cut -d' ' -f1)
HASH_BY_TAG=$(sha256sum downloaded_by_tag.bin | cut -d' ' -f1)
HASH_BY_HASH=$("$DSHASH" downloaded_by_hash.bin)
HASH_BY_TAG=$("$DSHASH" downloaded_by_tag.bin)
echo "Original hash: $ORIGINAL_HASH"
echo "Hash of file downloaded by hash: $HASH_BY_HASH"