mirror of
https://github.com/minio/minio.git
synced 2025-04-17 01:10:29 -04:00
cleanup scripts and apply shfmt (#17284)
This commit is contained in:
parent
615169c4ec
commit
4a425cbac1
16
.github/workflows/run-mint.sh
vendored
16
.github/workflows/run-mint.sh
vendored
@ -25,20 +25,7 @@ docker run --rm --net=host \
|
|||||||
-e SECRET_KEY="${SECRET_KEY}" \
|
-e SECRET_KEY="${SECRET_KEY}" \
|
||||||
-e ENABLE_HTTPS=0 \
|
-e ENABLE_HTTPS=0 \
|
||||||
-e MINT_MODE="${MINT_MODE}" \
|
-e MINT_MODE="${MINT_MODE}" \
|
||||||
docker.io/minio/mint:edge \
|
docker.io/minio/mint:edge
|
||||||
aws-sdk-go \
|
|
||||||
aws-sdk-java \
|
|
||||||
aws-sdk-php \
|
|
||||||
aws-sdk-ruby \
|
|
||||||
awscli \
|
|
||||||
healthcheck \
|
|
||||||
mc \
|
|
||||||
minio-go \
|
|
||||||
minio-java \
|
|
||||||
minio-py \
|
|
||||||
s3cmd \
|
|
||||||
s3select \
|
|
||||||
versioning
|
|
||||||
|
|
||||||
docker-compose -f minio-${MODE}.yaml down || true
|
docker-compose -f minio-${MODE}.yaml down || true
|
||||||
sleep 10s
|
sleep 10s
|
||||||
@ -49,4 +36,3 @@ docker volume rm $(docker volume ls -f dangling=true) || true
|
|||||||
|
|
||||||
## change working directory
|
## change working directory
|
||||||
cd ../../../
|
cd ../../../
|
||||||
|
|
||||||
|
22
.github/workflows/shfmt.yml
vendored
Normal file
22
.github/workflows/shfmt.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: Shell formatting checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: runner / shfmt
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: luizm/action-sh-checker@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SHFMT_OPTS: "-s"
|
||||||
|
with:
|
||||||
|
sh_checker_shellcheck_disable: true # disable for now
|
@ -30,20 +30,19 @@ _init() {
|
|||||||
readlink() {
|
readlink() {
|
||||||
TARGET_FILE=$1
|
TARGET_FILE=$1
|
||||||
|
|
||||||
cd `dirname $TARGET_FILE`
|
cd $(dirname $TARGET_FILE)
|
||||||
TARGET_FILE=`basename $TARGET_FILE`
|
TARGET_FILE=$(basename $TARGET_FILE)
|
||||||
|
|
||||||
# Iterate down a (possible) chain of symlinks
|
# Iterate down a (possible) chain of symlinks
|
||||||
while [ -L "$TARGET_FILE" ]
|
while [ -L "$TARGET_FILE" ]; do
|
||||||
do
|
|
||||||
TARGET_FILE=$(env readlink $TARGET_FILE)
|
TARGET_FILE=$(env readlink $TARGET_FILE)
|
||||||
cd `dirname $TARGET_FILE`
|
cd $(dirname $TARGET_FILE)
|
||||||
TARGET_FILE=`basename $TARGET_FILE`
|
TARGET_FILE=$(basename $TARGET_FILE)
|
||||||
done
|
done
|
||||||
|
|
||||||
# Compute the canonicalized name by finding the physical path
|
# Compute the canonicalized name by finding the physical path
|
||||||
# for the directory we're in and appending the target file.
|
# for the directory we're in and appending the target file.
|
||||||
PHYS_DIR=`pwd -P`
|
PHYS_DIR=$(pwd -P)
|
||||||
RESULT=$PHYS_DIR/$TARGET_FILE
|
RESULT=$PHYS_DIR/$TARGET_FILE
|
||||||
echo $RESULT
|
echo $RESULT
|
||||||
}
|
}
|
||||||
@ -81,6 +80,7 @@ assert_is_supported_arch() {
|
|||||||
*)
|
*)
|
||||||
echo "Arch '${ARCH}' is not supported. Supported Arch: [x86_64, amd64, aarch64, ppc64le, arm*, s390x, loong64, loongarch64]"
|
echo "Arch '${ARCH}' is not supported. Supported Arch: [x86_64, amd64, aarch64, ppc64le, arm*, s390x, loong64, loongarch64]"
|
||||||
exit 1
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +100,7 @@ assert_is_supported_os() {
|
|||||||
*)
|
*)
|
||||||
echo "OS '${KNAME}' is not supported. Supported OS: [Linux, FreeBSD, OpenBSD, NetBSD, Darwin, DragonFly]"
|
echo "OS '${KNAME}' is not supported. Supported OS: [Linux, FreeBSD, OpenBSD, NetBSD, Darwin, DragonFly]"
|
||||||
exit 1
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,20 +12,20 @@ nr_servers=4
|
|||||||
|
|
||||||
addr="localhost"
|
addr="localhost"
|
||||||
args=""
|
args=""
|
||||||
for ((i=0;i<$[${nr_servers}];i++)); do
|
for ((i = 0; i < $((nr_servers)); i++)); do
|
||||||
args="$args $scheme://$addr:$[9100+$i]/${HOME}/tmp/dist/path1/$i"
|
args="$args $scheme://$addr:$((9100 + i))/${HOME}/tmp/dist/path1/$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo $args
|
echo $args
|
||||||
|
|
||||||
for ((i=0;i<$[${nr_servers}];i++)); do
|
for ((i = 0; i < $((nr_servers)); i++)); do
|
||||||
(minio server --address ":$[9100+$i]" $args 2>&1 > /tmp/log$i.txt) &
|
(minio server --address ":$((9100 + i))" $args 2>&1 >/tmp/log$i.txt) &
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep 10s
|
sleep 10s
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget --quiet -O ./mc https://dl.minio.io/client/mc/release/linux-amd64/./mc && \
|
wget --quiet -O ./mc https://dl.minio.io/client/mc/release/linux-amd64/./mc &&
|
||||||
chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -50,8 +50,8 @@ set -e
|
|||||||
killall -9 minio
|
killall -9 minio
|
||||||
|
|
||||||
export MINIO_API_ROOT_ACCESS=on
|
export MINIO_API_ROOT_ACCESS=on
|
||||||
for ((i=0;i<$[${nr_servers}];i++)); do
|
for ((i = 0; i < $((nr_servers)); i++)); do
|
||||||
(minio server --address ":$[9100+$i]" $args 2>&1 > /tmp/log$i.txt) &
|
(minio server --address ":$((9100 + i))" $args 2>&1 >/tmp/log$i.txt) &
|
||||||
done
|
done
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
|
@ -82,8 +82,7 @@ function main() {
|
|||||||
start_minio_4drive ${start_port}
|
start_minio_4drive ${start_port}
|
||||||
}
|
}
|
||||||
|
|
||||||
function purge()
|
function purge() {
|
||||||
{
|
|
||||||
rm -rf "$1"
|
rm -rf "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,14 +12,14 @@ cleanup() {
|
|||||||
|
|
||||||
verify_checksum_after_heal() {
|
verify_checksum_after_heal() {
|
||||||
local sum1
|
local sum1
|
||||||
sum1=$(curl -s "$2" | sha256sum);
|
sum1=$(curl -s "$2" | sha256sum)
|
||||||
mc admin heal --json -r "$1" >/dev/null; # test after healing
|
mc admin heal --json -r "$1" >/dev/null # test after healing
|
||||||
local sum1_heal
|
local sum1_heal
|
||||||
sum1_heal=$(curl -s "$2" | sha256sum);
|
sum1_heal=$(curl -s "$2" | sha256sum)
|
||||||
|
|
||||||
if [ "${sum1_heal}" != "${sum1}" ]; then
|
if [ "${sum1_heal}" != "${sum1}" ]; then
|
||||||
echo "mismatch expected ${sum1_heal}, got ${sum1}"
|
echo "mismatch expected ${sum1_heal}, got ${sum1}"
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ verify_checksum_mc() {
|
|||||||
|
|
||||||
if [ "${expected}" != "${got}" ]; then
|
if [ "${expected}" != "${got}" ]; then
|
||||||
echo "mismatch - expected ${expected}, got ${got}"
|
echo "mismatch - expected ${expected}, got ${got}"
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "matches - ${expected}, got ${got}"
|
echo "matches - ${expected}, got ${got}"
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,7 @@ function main() {
|
|||||||
start_minio_5drive ${start_port}
|
start_minio_5drive ${start_port}
|
||||||
}
|
}
|
||||||
|
|
||||||
function purge()
|
function purge() {
|
||||||
{
|
|
||||||
rm -rf "$1"
|
rm -rf "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,10 @@ function verify_rewrite() {
|
|||||||
cat "${WORK_DIR}/server1.log"
|
cat "${WORK_DIR}/server1.log"
|
||||||
echo "FAILED"
|
echo "FAILED"
|
||||||
mkdir -p inspects
|
mkdir -p inspects
|
||||||
(cd inspects; "${WORK_DIR}/mc" admin inspect minio/healing-rewrite-bucket/verify-build.sh/**)
|
(
|
||||||
|
cd inspects
|
||||||
|
"${WORK_DIR}/mc" admin inspect minio/healing-rewrite-bucket/verify-build.sh/**
|
||||||
|
)
|
||||||
|
|
||||||
"${WORK_DIR}/mc" mb play/inspects
|
"${WORK_DIR}/mc" mb play/inspects
|
||||||
"${WORK_DIR}/mc" mirror inspects play/inspects
|
"${WORK_DIR}/mc" mirror inspects play/inspects
|
||||||
@ -120,7 +123,10 @@ function verify_rewrite() {
|
|||||||
cat "${WORK_DIR}/server1.log"
|
cat "${WORK_DIR}/server1.log"
|
||||||
echo "FAILED"
|
echo "FAILED"
|
||||||
mkdir -p inspects
|
mkdir -p inspects
|
||||||
(cd inspects; "${WORK_DIR}/mc" admin inspect minio/healing-rewrite-bucket/verify-build.sh/**)
|
(
|
||||||
|
cd inspects
|
||||||
|
"${WORK_DIR}/mc" admin inspect minio/healing-rewrite-bucket/verify-build.sh/**
|
||||||
|
)
|
||||||
|
|
||||||
"${WORK_DIR}/mc" mb play/inspects
|
"${WORK_DIR}/mc" mb play/inspects
|
||||||
"${WORK_DIR}/mc" mirror inspects play/inspects
|
"${WORK_DIR}/mc" mirror inspects play/inspects
|
||||||
@ -140,8 +146,7 @@ function main() {
|
|||||||
verify_rewrite ${start_port}
|
verify_rewrite ${start_port}
|
||||||
}
|
}
|
||||||
|
|
||||||
function purge()
|
function purge() {
|
||||||
{
|
|
||||||
rm -rf "$1"
|
rm -rf "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,10 @@ function start_minio_16drive() {
|
|||||||
cat "${WORK_DIR}/server1.log"
|
cat "${WORK_DIR}/server1.log"
|
||||||
echo "FAILED"
|
echo "FAILED"
|
||||||
mkdir -p inspects
|
mkdir -p inspects
|
||||||
(cd inspects; "${WORK_DIR}/mc" support inspect minio/healing-shard-bucket/unaligned/**)
|
(
|
||||||
|
cd inspects
|
||||||
|
"${WORK_DIR}/mc" support inspect minio/healing-shard-bucket/unaligned/**
|
||||||
|
)
|
||||||
|
|
||||||
"${WORK_DIR}/mc" mb play/inspects
|
"${WORK_DIR}/mc" mb play/inspects
|
||||||
"${WORK_DIR}/mc" mirror inspects play/inspects
|
"${WORK_DIR}/mc" mirror inspects play/inspects
|
||||||
@ -140,7 +143,10 @@ function start_minio_16drive() {
|
|||||||
cat "${WORK_DIR}/server1.log"
|
cat "${WORK_DIR}/server1.log"
|
||||||
echo "FAILED"
|
echo "FAILED"
|
||||||
mkdir -p inspects
|
mkdir -p inspects
|
||||||
(cd inspects; "${WORK_DIR}/mc" support inspect minio/healing-shard-bucket/unaligned/**)
|
(
|
||||||
|
cd inspects
|
||||||
|
"${WORK_DIR}/mc" support inspect minio/healing-shard-bucket/unaligned/**
|
||||||
|
)
|
||||||
|
|
||||||
"${WORK_DIR}/mc" mb play/inspects
|
"${WORK_DIR}/mc" mb play/inspects
|
||||||
"${WORK_DIR}/mc" mirror inspects play/inspects
|
"${WORK_DIR}/mc" mirror inspects play/inspects
|
||||||
@ -161,8 +167,7 @@ function main() {
|
|||||||
start_minio_16drive ${start_port}
|
start_minio_16drive ${start_port}
|
||||||
}
|
}
|
||||||
|
|
||||||
function purge()
|
function purge() {
|
||||||
{
|
|
||||||
rm -rf "$1"
|
rm -rf "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,29 +32,25 @@ FILE_65_MB="$MINT_DATA_DIR/datafile-65-MB"
|
|||||||
|
|
||||||
FUNCTIONAL_TESTS="$WORK_DIR/functional-tests.sh"
|
FUNCTIONAL_TESTS="$WORK_DIR/functional-tests.sh"
|
||||||
|
|
||||||
function start_minio_fs()
|
function start_minio_fs() {
|
||||||
{
|
|
||||||
export MINIO_ROOT_USER=$ACCESS_KEY
|
export MINIO_ROOT_USER=$ACCESS_KEY
|
||||||
export MINIO_ROOT_PASSWORD=$SECRET_KEY
|
export MINIO_ROOT_PASSWORD=$SECRET_KEY
|
||||||
"${MINIO[@]}" server "${WORK_DIR}/fs-disk" >"$WORK_DIR/fs-minio.log" 2>&1 &
|
"${MINIO[@]}" server "${WORK_DIR}/fs-disk" >"$WORK_DIR/fs-minio.log" 2>&1 &
|
||||||
sleep 10
|
sleep 10
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_minio_erasure()
|
function start_minio_erasure() {
|
||||||
{
|
|
||||||
"${MINIO[@]}" server "${WORK_DIR}/erasure-disk1" "${WORK_DIR}/erasure-disk2" "${WORK_DIR}/erasure-disk3" "${WORK_DIR}/erasure-disk4" >"$WORK_DIR/erasure-minio.log" 2>&1 &
|
"${MINIO[@]}" server "${WORK_DIR}/erasure-disk1" "${WORK_DIR}/erasure-disk2" "${WORK_DIR}/erasure-disk3" "${WORK_DIR}/erasure-disk4" >"$WORK_DIR/erasure-minio.log" 2>&1 &
|
||||||
sleep 15
|
sleep 15
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_minio_erasure_sets()
|
function start_minio_erasure_sets() {
|
||||||
{
|
|
||||||
export MINIO_ENDPOINTS="${WORK_DIR}/erasure-disk-sets{1...32}"
|
export MINIO_ENDPOINTS="${WORK_DIR}/erasure-disk-sets{1...32}"
|
||||||
"${MINIO[@]}" server >"$WORK_DIR/erasure-minio-sets.log" 2>&1 &
|
"${MINIO[@]}" server >"$WORK_DIR/erasure-minio-sets.log" 2>&1 &
|
||||||
sleep 15
|
sleep 15
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_minio_pool_erasure_sets()
|
function start_minio_pool_erasure_sets() {
|
||||||
{
|
|
||||||
export MINIO_ROOT_USER=$ACCESS_KEY
|
export MINIO_ROOT_USER=$ACCESS_KEY
|
||||||
export MINIO_ROOT_PASSWORD=$SECRET_KEY
|
export MINIO_ROOT_PASSWORD=$SECRET_KEY
|
||||||
export MINIO_ENDPOINTS="http://127.0.0.1:9000${WORK_DIR}/pool-disk-sets{1...4} http://127.0.0.1:9001${WORK_DIR}/pool-disk-sets{5...8}"
|
export MINIO_ENDPOINTS="http://127.0.0.1:9000${WORK_DIR}/pool-disk-sets{1...4} http://127.0.0.1:9001${WORK_DIR}/pool-disk-sets{5...8}"
|
||||||
@ -64,8 +60,7 @@ function start_minio_pool_erasure_sets()
|
|||||||
sleep 40
|
sleep 40
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_minio_pool_erasure_sets_ipv6()
|
function start_minio_pool_erasure_sets_ipv6() {
|
||||||
{
|
|
||||||
export MINIO_ROOT_USER=$ACCESS_KEY
|
export MINIO_ROOT_USER=$ACCESS_KEY
|
||||||
export MINIO_ROOT_PASSWORD=$SECRET_KEY
|
export MINIO_ROOT_PASSWORD=$SECRET_KEY
|
||||||
export MINIO_ENDPOINTS="http://[::1]:9000${WORK_DIR}/pool-disk-sets-ipv6{1...4} http://[::1]:9001${WORK_DIR}/pool-disk-sets-ipv6{5...8}"
|
export MINIO_ENDPOINTS="http://[::1]:9000${WORK_DIR}/pool-disk-sets-ipv6{1...4} http://[::1]:9001${WORK_DIR}/pool-disk-sets-ipv6{5...8}"
|
||||||
@ -75,8 +70,7 @@ function start_minio_pool_erasure_sets_ipv6()
|
|||||||
sleep 40
|
sleep 40
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_minio_dist_erasure()
|
function start_minio_dist_erasure() {
|
||||||
{
|
|
||||||
export MINIO_ROOT_USER=$ACCESS_KEY
|
export MINIO_ROOT_USER=$ACCESS_KEY
|
||||||
export MINIO_ROOT_PASSWORD=$SECRET_KEY
|
export MINIO_ROOT_PASSWORD=$SECRET_KEY
|
||||||
export MINIO_ENDPOINTS="http://127.0.0.1:9000${WORK_DIR}/dist-disk1 http://127.0.0.1:9001${WORK_DIR}/dist-disk2 http://127.0.0.1:9002${WORK_DIR}/dist-disk3 http://127.0.0.1:9003${WORK_DIR}/dist-disk4"
|
export MINIO_ENDPOINTS="http://127.0.0.1:9000${WORK_DIR}/dist-disk1 http://127.0.0.1:9001${WORK_DIR}/dist-disk2 http://127.0.0.1:9002${WORK_DIR}/dist-disk3 http://127.0.0.1:9003${WORK_DIR}/dist-disk4"
|
||||||
@ -87,8 +81,7 @@ function start_minio_dist_erasure()
|
|||||||
sleep 40
|
sleep 40
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test_fs()
|
function run_test_fs() {
|
||||||
{
|
|
||||||
start_minio_fs
|
start_minio_fs
|
||||||
|
|
||||||
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
||||||
@ -105,8 +98,7 @@ function run_test_fs()
|
|||||||
return "$rv"
|
return "$rv"
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test_erasure_sets()
|
function run_test_erasure_sets() {
|
||||||
{
|
|
||||||
start_minio_erasure_sets
|
start_minio_erasure_sets
|
||||||
|
|
||||||
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
||||||
@ -123,8 +115,7 @@ function run_test_erasure_sets()
|
|||||||
return "$rv"
|
return "$rv"
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test_pool_erasure_sets()
|
function run_test_pool_erasure_sets() {
|
||||||
{
|
|
||||||
start_minio_pool_erasure_sets
|
start_minio_pool_erasure_sets
|
||||||
|
|
||||||
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
||||||
@ -147,8 +138,7 @@ function run_test_pool_erasure_sets()
|
|||||||
return "$rv"
|
return "$rv"
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test_pool_erasure_sets_ipv6()
|
function run_test_pool_erasure_sets_ipv6() {
|
||||||
{
|
|
||||||
start_minio_pool_erasure_sets_ipv6
|
start_minio_pool_erasure_sets_ipv6
|
||||||
|
|
||||||
export SERVER_ENDPOINT="[::1]:9000"
|
export SERVER_ENDPOINT="[::1]:9000"
|
||||||
@ -173,8 +163,7 @@ function run_test_pool_erasure_sets_ipv6()
|
|||||||
return "$rv"
|
return "$rv"
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test_erasure()
|
function run_test_erasure() {
|
||||||
{
|
|
||||||
start_minio_erasure
|
start_minio_erasure
|
||||||
|
|
||||||
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
||||||
@ -191,8 +180,7 @@ function run_test_erasure()
|
|||||||
return "$rv"
|
return "$rv"
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test_dist_erasure()
|
function run_test_dist_erasure() {
|
||||||
{
|
|
||||||
start_minio_dist_erasure
|
start_minio_dist_erasure
|
||||||
|
|
||||||
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
(cd "$WORK_DIR" && "$FUNCTIONAL_TESTS")
|
||||||
@ -217,13 +205,11 @@ function run_test_dist_erasure()
|
|||||||
return "$rv"
|
return "$rv"
|
||||||
}
|
}
|
||||||
|
|
||||||
function purge()
|
function purge() {
|
||||||
{
|
|
||||||
rm -rf "$1"
|
rm -rf "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function __init__()
|
function __init__() {
|
||||||
{
|
|
||||||
echo "Initializing environment"
|
echo "Initializing environment"
|
||||||
mkdir -p "$WORK_DIR"
|
mkdir -p "$WORK_DIR"
|
||||||
mkdir -p "$MINIO_CONFIG_DIR"
|
mkdir -p "$MINIO_CONFIG_DIR"
|
||||||
@ -256,8 +242,7 @@ function __init__()
|
|||||||
chmod a+x "$FUNCTIONAL_TESTS"
|
chmod a+x "$FUNCTIONAL_TESTS"
|
||||||
}
|
}
|
||||||
|
|
||||||
function main()
|
function main() {
|
||||||
{
|
|
||||||
echo "Testing in FS setup"
|
echo "Testing in FS setup"
|
||||||
if ! run_test_fs; then
|
if ! run_test_fs; then
|
||||||
echo "FAILED"
|
echo "FAILED"
|
||||||
|
@ -4,7 +4,6 @@ set -E
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
|
||||||
if [ ! -x "$PWD/minio" ]; then
|
if [ ! -x "$PWD/minio" ]; then
|
||||||
echo "minio executable binary not found in current directory"
|
echo "minio executable binary not found in current directory"
|
||||||
exit 1
|
exit 1
|
||||||
@ -14,7 +13,6 @@ WORK_DIR="$(mktemp -d)"
|
|||||||
MINIO_CONFIG_DIR="$WORK_DIR/.minio"
|
MINIO_CONFIG_DIR="$WORK_DIR/.minio"
|
||||||
MINIO=("$PWD/minio" --config-dir "$MINIO_CONFIG_DIR" server)
|
MINIO=("$PWD/minio" --config-dir "$MINIO_CONFIG_DIR" server)
|
||||||
|
|
||||||
|
|
||||||
function start_minio() {
|
function start_minio() {
|
||||||
start_port=$1
|
start_port=$1
|
||||||
|
|
||||||
@ -26,18 +24,18 @@ function start_minio() {
|
|||||||
|
|
||||||
args=()
|
args=()
|
||||||
for i in $(seq 1 4); do
|
for i in $(seq 1 4); do
|
||||||
args+=("http://localhost:$[${start_port}+$i]${WORK_DIR}/mnt/disk$i/ ")
|
args+=("http://localhost:$((start_port + i))${WORK_DIR}/mnt/disk$i/ ")
|
||||||
done
|
done
|
||||||
|
|
||||||
for i in $(seq 1 4); do
|
for i in $(seq 1 4); do
|
||||||
"${MINIO[@]}" --address ":$[$start_port+$i]" ${args[@]} 2>&1 >"${WORK_DIR}/server$i.log" &
|
"${MINIO[@]}" --address ":$((start_port + i))" ${args[@]} 2>&1 >"${WORK_DIR}/server$i.log" &
|
||||||
done
|
done
|
||||||
|
|
||||||
# Wait until all nodes return 403
|
# Wait until all nodes return 403
|
||||||
for i in $(seq 1 4); do
|
for i in $(seq 1 4); do
|
||||||
while [ "$(curl -m 1 -s -o /dev/null -w "%{http_code}" http://localhost:$[$start_port+$i])" -ne "403" ]; do
|
while [ "$(curl -m 1 -s -o /dev/null -w "%{http_code}" http://localhost:$((start_port + i)))" -ne "403" ]; do
|
||||||
echo -n ".";
|
echo -n "."
|
||||||
sleep 1;
|
sleep 1
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -96,4 +94,3 @@ rv=$?
|
|||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
exit "$rv"
|
exit "$rv"
|
||||||
|
|
||||||
|
@ -22,18 +22,18 @@ function start_minio_3_node() {
|
|||||||
start_port=$2
|
start_port=$2
|
||||||
args=""
|
args=""
|
||||||
for i in $(seq 1 3); do
|
for i in $(seq 1 3); do
|
||||||
args="$args http://127.0.0.1:$[$start_port+$i]${WORK_DIR}/$i/1/ http://127.0.0.1:$[$start_port+$i]${WORK_DIR}/$i/2/ http://127.0.0.1:$[$start_port+$i]${WORK_DIR}/$i/3/ http://127.0.0.1:$[$start_port+$i]${WORK_DIR}/$i/4/ http://127.0.0.1:$[$start_port+$i]${WORK_DIR}/$i/5/ http://127.0.0.1:$[$start_port+$i]${WORK_DIR}/$i/6/"
|
args="$args http://127.0.0.1:$((start_port + i))${WORK_DIR}/$i/1/ http://127.0.0.1:$((start_port + i))${WORK_DIR}/$i/2/ http://127.0.0.1:$((start_port + i))${WORK_DIR}/$i/3/ http://127.0.0.1:$((start_port + i))${WORK_DIR}/$i/4/ http://127.0.0.1:$((start_port + i))${WORK_DIR}/$i/5/ http://127.0.0.1:$((start_port + i))${WORK_DIR}/$i/6/"
|
||||||
done
|
done
|
||||||
|
|
||||||
"${MINIO[@]}" --address ":$[$start_port+1]" $args > "${WORK_DIR}/dist-minio-server1.log" 2>&1 &
|
"${MINIO[@]}" --address ":$((start_port + 1))" $args >"${WORK_DIR}/dist-minio-server1.log" 2>&1 &
|
||||||
pid1=$!
|
pid1=$!
|
||||||
disown ${pid1}
|
disown ${pid1}
|
||||||
|
|
||||||
"${MINIO[@]}" --address ":$[$start_port+2]" $args > "${WORK_DIR}/dist-minio-server2.log" 2>&1 &
|
"${MINIO[@]}" --address ":$((start_port + 2))" $args >"${WORK_DIR}/dist-minio-server2.log" 2>&1 &
|
||||||
pid2=$!
|
pid2=$!
|
||||||
disown $pid2
|
disown $pid2
|
||||||
|
|
||||||
"${MINIO[@]}" --address ":$[$start_port+3]" $args > "${WORK_DIR}/dist-minio-server3.log" 2>&1 &
|
"${MINIO[@]}" --address ":$((start_port + 3))" $args >"${WORK_DIR}/dist-minio-server3.log" 2>&1 &
|
||||||
pid3=$!
|
pid3=$!
|
||||||
disown $pid3
|
disown $pid3
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ function start_minio_3_node() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 1;
|
sleep 1
|
||||||
if pgrep minio; then
|
if pgrep minio; then
|
||||||
# forcibly killing, to proceed further properly.
|
# forcibly killing, to proceed further properly.
|
||||||
if ! pkill -9 minio; then
|
if ! pkill -9 minio; then
|
||||||
@ -82,20 +82,17 @@ function start_minio_3_node() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function check_online() {
|
function check_online() {
|
||||||
if grep -q 'Unable to initialize sub-systems' ${WORK_DIR}/dist-minio-*.log; then
|
if grep -q 'Unable to initialize sub-systems' ${WORK_DIR}/dist-minio-*.log; then
|
||||||
echo "1"
|
echo "1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function purge()
|
function purge() {
|
||||||
{
|
|
||||||
rm -rf "$1"
|
rm -rf "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function __init__()
|
function __init__() {
|
||||||
{
|
|
||||||
echo "Initializing environment"
|
echo "Initializing environment"
|
||||||
mkdir -p "$WORK_DIR"
|
mkdir -p "$WORK_DIR"
|
||||||
mkdir -p "$MINIO_CONFIG_DIR"
|
mkdir -p "$MINIO_CONFIG_DIR"
|
||||||
@ -127,8 +124,7 @@ function perform_test() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function main()
|
function main() {
|
||||||
{
|
|
||||||
# use same ports for all tests
|
# use same ports for all tests
|
||||||
start_port=$(shuf -i 10000-65000 -n 1)
|
start_port=$(shuf -i 10000-65000 -n 1)
|
||||||
|
|
||||||
|
@ -12,10 +12,10 @@ fi
|
|||||||
docker_switch_user() {
|
docker_switch_user() {
|
||||||
if [ -n "${MINIO_USERNAME}" ] && [ -n "${MINIO_GROUPNAME}" ]; then
|
if [ -n "${MINIO_USERNAME}" ] && [ -n "${MINIO_GROUPNAME}" ]; then
|
||||||
if [ -n "${MINIO_UID}" ] && [ -n "${MINIO_GID}" ]; then
|
if [ -n "${MINIO_UID}" ] && [ -n "${MINIO_GID}" ]; then
|
||||||
groupadd -f -g "$MINIO_GID" "$MINIO_GROUPNAME" && \
|
groupadd -f -g "$MINIO_GID" "$MINIO_GROUPNAME" &&
|
||||||
useradd -u "$MINIO_UID" -g "$MINIO_GROUPNAME" "$MINIO_USERNAME"
|
useradd -u "$MINIO_UID" -g "$MINIO_GROUPNAME" "$MINIO_USERNAME"
|
||||||
else
|
else
|
||||||
groupadd -f "$MINIO_GROUPNAME" && \
|
groupadd -f "$MINIO_GROUPNAME" &&
|
||||||
useradd -g "$MINIO_GROUPNAME" "$MINIO_USERNAME"
|
useradd -g "$MINIO_GROUPNAME" "$MINIO_USERNAME"
|
||||||
fi
|
fi
|
||||||
exec setpriv --reuid="${MINIO_USERNAME}" \
|
exec setpriv --reuid="${MINIO_USERNAME}" \
|
||||||
|
@ -39,7 +39,7 @@ unset MINIO_KMS_KES_ENDPOINT
|
|||||||
unset MINIO_KMS_KES_KEY_NAME
|
unset MINIO_KMS_KES_KEY_NAME
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc && \
|
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ unset MINIO_KMS_KES_ENDPOINT
|
|||||||
unset MINIO_KMS_KES_KEY_NAME
|
unset MINIO_KMS_KES_KEY_NAME
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc && \
|
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -42,10 +42,10 @@ unset MINIO_KMS_KES_ENDPOINT
|
|||||||
unset MINIO_KMS_KES_KEY_NAME
|
unset MINIO_KMS_KES_KEY_NAME
|
||||||
|
|
||||||
go build ./docs/debugging/s3-check-md5/
|
go build ./docs/debugging/s3-check-md5/
|
||||||
wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc \
|
wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
&& chmod +x mc
|
chmod +x mc
|
||||||
wget -O mc.RELEASE.2021-03-12T03-36-59Z https://dl.minio.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2021-03-12T03-36-59Z \
|
wget -O mc.RELEASE.2021-03-12T03-36-59Z https://dl.minio.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2021-03-12T03-36-59Z &&
|
||||||
&& chmod +x mc.RELEASE.2021-03-12T03-36-59Z
|
chmod +x mc.RELEASE.2021-03-12T03-36-59Z
|
||||||
|
|
||||||
minio server --address 127.0.0.1:9001 "http://127.0.0.1:9001/tmp/multisitea/data/disterasure/xl{1...4}" \
|
minio server --address 127.0.0.1:9001 "http://127.0.0.1:9001/tmp/multisitea/data/disterasure/xl{1...4}" \
|
||||||
"http://127.0.0.1:9002/tmp/multisitea/data/disterasure/xl{5...8}" >/tmp/sitea_1.log 2>&1 &
|
"http://127.0.0.1:9002/tmp/multisitea/data/disterasure/xl{5...8}" >/tmp/sitea_1.log 2>&1 &
|
||||||
|
@ -8,7 +8,7 @@ pkill minio
|
|||||||
rm -rf /tmp/xl
|
rm -rf /tmp/xl
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc && \
|
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -84,8 +84,7 @@ fi
|
|||||||
|
|
||||||
./mc admin decom start myminio/ /tmp/xl/{1...10}/disk{0...1}
|
./mc admin decom start myminio/ /tmp/xl/{1...10}/disk{0...1}
|
||||||
|
|
||||||
until $(./mc admin decom status myminio/ | grep -q Complete)
|
until $(./mc admin decom status myminio/ | grep -q Complete); do
|
||||||
do
|
|
||||||
echo "waiting for decom to finish..."
|
echo "waiting for decom to finish..."
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
@ -8,7 +8,7 @@ pkill minio
|
|||||||
rm -rf /tmp/xl
|
rm -rf /tmp/xl
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc && \
|
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -88,8 +88,7 @@ fi
|
|||||||
|
|
||||||
./mc admin decom start myminio/ /tmp/xl/{1...10}/disk{0...1}
|
./mc admin decom start myminio/ /tmp/xl/{1...10}/disk{0...1}
|
||||||
|
|
||||||
until $(./mc admin decom status myminio/ | grep -q Complete)
|
until $(./mc admin decom status myminio/ | grep -q Complete); do
|
||||||
do
|
|
||||||
echo "waiting for decom to finish..."
|
echo "waiting for decom to finish..."
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
@ -8,7 +8,7 @@ pkill minio
|
|||||||
rm -rf /tmp/xl
|
rm -rf /tmp/xl
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc && \
|
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -80,8 +80,7 @@ fi
|
|||||||
|
|
||||||
./mc admin decom start myminio/ /tmp/xl/{1...10}/disk{0...1}
|
./mc admin decom start myminio/ /tmp/xl/{1...10}/disk{0...1}
|
||||||
|
|
||||||
until $(./mc admin decom status myminio/ | grep -q Complete)
|
until $(./mc admin decom status myminio/ | grep -q Complete); do
|
||||||
do
|
|
||||||
echo "waiting for decom to finish..."
|
echo "waiting for decom to finish..."
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
@ -9,7 +9,7 @@ rm -rf /tmp/xl
|
|||||||
rm -rf /tmp/xltier
|
rm -rf /tmp/xltier
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc && \
|
wget --quiet -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -96,8 +96,7 @@ fi
|
|||||||
|
|
||||||
./mc admin decom start myminio/ /tmp/xl/{1...10}/disk{0...1}
|
./mc admin decom start myminio/ /tmp/xl/{1...10}/disk{0...1}
|
||||||
|
|
||||||
until $(./mc admin decom status myminio/ | grep -q Complete)
|
until $(./mc admin decom status myminio/ | grep -q Complete); do
|
||||||
do
|
|
||||||
echo "waiting for decom to finish..."
|
echo "waiting for decom to finish..."
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
@ -45,8 +45,8 @@ export MINIO_IDENTITY_LDAP_GROUP_SEARCH_BASE_DN="ou=swengg,dc=min,dc=io"
|
|||||||
export MINIO_IDENTITY_LDAP_GROUP_SEARCH_FILTER="(&(objectclass=groupOfNames)(member=%d))"
|
export MINIO_IDENTITY_LDAP_GROUP_SEARCH_FILTER="(&(objectclass=groupOfNames)(member=%d))"
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc \
|
wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
&& chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
minio server --config-dir /tmp/minio-ldap --address ":9001" /tmp/minio-ldap-idp1/{1...4} >/tmp/minio1_1.log 2>&1 &
|
minio server --config-dir /tmp/minio-ldap --address ":9001" /tmp/minio-ldap-idp1/{1...4} >/tmp/minio1_1.log 2>&1 &
|
||||||
@ -81,38 +81,38 @@ sleep 10
|
|||||||
./mc admin policy info minio1 rw
|
./mc admin policy info minio1 rw
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expecting the command to fail, exiting.."
|
echo "expecting the command to fail, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin policy info minio2 rw
|
./mc admin policy info minio2 rw
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expecting the command to fail, exiting.."
|
echo "expecting the command to fail, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user info minio1 "uid=dillon,ou=people,ou=swengg,dc=min,dc=io"
|
./mc admin user info minio1 "uid=dillon,ou=people,ou=swengg,dc=min,dc=io"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "policy mapping missing, exiting.."
|
echo "policy mapping missing, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user info minio2 "uid=dillon,ou=people,ou=swengg,dc=min,dc=io"
|
./mc admin user info minio2 "uid=dillon,ou=people,ou=swengg,dc=min,dc=io"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "policy mapping missing, exiting.."
|
echo "policy mapping missing, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user info minio3 "uid=dillon,ou=people,ou=swengg,dc=min,dc=io"
|
./mc admin user info minio3 "uid=dillon,ou=people,ou=swengg,dc=min,dc=io"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "policy mapping missing, exiting.."
|
echo "policy mapping missing, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# LDAP simple user
|
# LDAP simple user
|
||||||
./mc admin user svcacct add minio2 dillon --access-key testsvc --secret-key testsvc123
|
./mc admin user svcacct add minio2 dillon --access-key testsvc --secret-key testsvc123
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "adding svc account failed, exiting.."
|
echo "adding svc account failed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
@ -120,32 +120,32 @@ sleep 10
|
|||||||
./mc admin user svcacct info minio1 testsvc
|
./mc admin user svcacct info minio1 testsvc
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "svc account not mirrored, exiting.."
|
echo "svc account not mirrored, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct info minio2 testsvc
|
./mc admin user svcacct info minio2 testsvc
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "svc account not mirrored, exiting.."
|
echo "svc account not mirrored, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct rm minio1 testsvc
|
./mc admin user svcacct rm minio1 testsvc
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "removing svc account failed, exiting.."
|
echo "removing svc account failed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
./mc admin user svcacct info minio2 testsvc
|
./mc admin user svcacct info minio2 testsvc
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "svc account found after delete, exiting.."
|
echo "svc account found after delete, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct info minio3 testsvc
|
./mc admin user svcacct info minio3 testsvc
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "svc account found after delete, exiting.."
|
echo "svc account found after delete, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc mb minio1/newbucket
|
./mc mb minio1/newbucket
|
||||||
@ -162,13 +162,13 @@ sleep 5
|
|||||||
./mc stat minio2/newbucket
|
./mc stat minio2/newbucket
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting bucket to be present. exiting.."
|
echo "expecting bucket to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc stat minio3/newbucket
|
./mc stat minio3/newbucket
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting bucket to be present. exiting.."
|
echo "expecting bucket to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc cp README.md minio2/newbucket/
|
./mc cp README.md minio2/newbucket/
|
||||||
@ -177,20 +177,20 @@ sleep 5
|
|||||||
./mc stat minio1/newbucket/README.md
|
./mc stat minio1/newbucket/README.md
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc stat minio3/newbucket/README.md
|
./mc stat minio3/newbucket/README.md
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
./mc stat minio3/newbucket/lrgfile
|
./mc stat minio3/newbucket/lrgfile
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected object to be present, exiting.."
|
echo "expected object to be present, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
actual_checksum=$(./mc cat minio3/newbucket/lrgfile | md5sum)
|
actual_checksum=$(./mc cat minio3/newbucket/lrgfile | md5sum)
|
||||||
if [ "${expected_checksum}" != "${actual_checksum}" ]; then
|
if [ "${expected_checksum}" != "${actual_checksum}" ]; then
|
||||||
@ -202,31 +202,31 @@ rm ./lrgfile
|
|||||||
vID=$(./mc stat minio2/newbucket/README.md --json | jq .versionID)
|
vID=$(./mc stat minio2/newbucket/README.md --json | jq .versionID)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
./mc tag set --version-id "${vID}" minio2/newbucket/README.md "k=v"
|
./mc tag set --version-id "${vID}" minio2/newbucket/README.md "k=v"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting tag set to be successful. exiting.."
|
echo "expecting tag set to be successful. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
./mc tag remove --version-id "${vID}" minio2/newbucket/README.md
|
./mc tag remove --version-id "${vID}" minio2/newbucket/README.md
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting tag removal to be successful. exiting.."
|
echo "expecting tag removal to be successful. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
replStatus_minio2=$(./mc stat minio2/newbucket/README.md --json | jq -r .replicationStatus)
|
replStatus_minio2=$(./mc stat minio2/newbucket/README.md --json | jq -r .replicationStatus)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${replStatus_minio2} != "COMPLETED" ]; then
|
if [ ${replStatus_minio2} != "COMPLETED" ]; then
|
||||||
echo "expected tag removal to have replicated, exiting..."
|
echo "expected tag removal to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc rm minio3/newbucket/README.md
|
./mc rm minio3/newbucket/README.md
|
||||||
@ -235,13 +235,13 @@ sleep 5
|
|||||||
./mc stat minio2/newbucket/README.md
|
./mc stat minio2/newbucket/README.md
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expected file to be deleted, exiting.."
|
echo "expected file to be deleted, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc stat minio1/newbucket/README.md
|
./mc stat minio1/newbucket/README.md
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expected file to be deleted, exiting.."
|
echo "expected file to be deleted, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc mb --with-lock minio3/newbucket-olock
|
./mc mb --with-lock minio3/newbucket-olock
|
||||||
@ -250,30 +250,30 @@ sleep 5
|
|||||||
enabled_minio2=$(./mc stat --json minio2/newbucket-olock | jq -r .ObjectLock.enabled)
|
enabled_minio2=$(./mc stat --json minio2/newbucket-olock | jq -r .ObjectLock.enabled)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${enabled_minio2}" != "Enabled" ]; then
|
if [ "${enabled_minio2}" != "Enabled" ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
enabled_minio1=$(./mc stat --json minio1/newbucket-olock | jq -r .ObjectLock.enabled)
|
enabled_minio1=$(./mc stat --json minio1/newbucket-olock | jq -r .ObjectLock.enabled)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${enabled_minio1}" != "Enabled" ]; then
|
if [ "${enabled_minio1}" != "Enabled" ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# "Test if most recent tag update is replicated"
|
# "Test if most recent tag update is replicated"
|
||||||
./mc tag set minio2/newbucket "key=val1"
|
./mc tag set minio2/newbucket "key=val1"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting tag set to be successful. exiting.."
|
echo "expecting tag set to be successful. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
@ -281,7 +281,7 @@ sleep 10
|
|||||||
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
||||||
if [ "${val}" != "val1" ]; then
|
if [ "${val}" != "val1" ]; then
|
||||||
echo "expected bucket tag to have replicated, exiting..."
|
echo "expected bucket tag to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
# stop minio1
|
# stop minio1
|
||||||
kill -9 ${site1_pid}
|
kill -9 ${site1_pid}
|
||||||
@ -300,14 +300,14 @@ sleep 200
|
|||||||
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
||||||
if [ "${val}" != "val2" ]; then
|
if [ "${val}" != "val2" ]; then
|
||||||
echo "expected bucket tag to have replicated, exiting..."
|
echo "expected bucket tag to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test if bucket created/deleted when minio1 is down healed
|
# Test if bucket created/deleted when minio1 is down healed
|
||||||
diff -q <(./mc ls minio1) <(./mc ls minio2) 1>/dev/null
|
diff -q <(./mc ls minio1) <(./mc ls minio2) 1>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected 'bucket2' delete and 'newbucket2' creation to have replicated, exiting..."
|
echo "expected 'bucket2' delete and 'newbucket2' creation to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
@ -37,8 +37,8 @@ export MINIO_PROMETHEUS_AUTH_TYPE=public
|
|||||||
export MINIO_KMS_SECRET_KEY=my-minio-key:OSMM+vkKUTCvQs9YL/CVMIMt43HFhkUpqJxTmGl6rYw=
|
export MINIO_KMS_SECRET_KEY=my-minio-key:OSMM+vkKUTCvQs9YL/CVMIMt43HFhkUpqJxTmGl6rYw=
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc \
|
wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
&& chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
minio server --config-dir /tmp/minio-internal --address ":9001" /tmp/minio-internal-idp1/{1...4} >/tmp/minio1_1.log 2>&1 &
|
minio server --config-dir /tmp/minio-internal --address ":9001" /tmp/minio-internal-idp1/{1...4} >/tmp/minio1_1.log 2>&1 &
|
||||||
@ -91,49 +91,49 @@ sleep 10
|
|||||||
./mc admin policy info minio1 rw
|
./mc admin policy info minio1 rw
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expecting the command to fail, exiting.."
|
echo "expecting the command to fail, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin policy info minio2 rw
|
./mc admin policy info minio2 rw
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expecting the command to fail, exiting.."
|
echo "expecting the command to fail, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin policy info minio3 rw
|
./mc admin policy info minio3 rw
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expecting the command to fail, exiting.."
|
echo "expecting the command to fail, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user info minio1 foobar
|
./mc admin user info minio1 foobar
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "policy mapping missing on 'minio1', exiting.."
|
echo "policy mapping missing on 'minio1', exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user info minio2 foobar
|
./mc admin user info minio2 foobar
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "policy mapping missing on 'minio2', exiting.."
|
echo "policy mapping missing on 'minio2', exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user info minio3 foobar
|
./mc admin user info minio3 foobar
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "policy mapping missing on 'minio3', exiting.."
|
echo "policy mapping missing on 'minio3', exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin group info minio3 foobar-g
|
./mc admin group info minio3 foobar-g
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "group mapping missing on 'minio3', exiting.."
|
echo "group mapping missing on 'minio3', exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct add minio2 foobar --access-key testsvc --secret-key testsvc123
|
./mc admin user svcacct add minio2 foobar --access-key testsvc --secret-key testsvc123
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "adding svc account failed, exiting.."
|
echo "adding svc account failed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
@ -141,32 +141,32 @@ sleep 10
|
|||||||
./mc admin user svcacct info minio1 testsvc
|
./mc admin user svcacct info minio1 testsvc
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "svc account not mirrored, exiting.."
|
echo "svc account not mirrored, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct info minio2 testsvc
|
./mc admin user svcacct info minio2 testsvc
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "svc account not mirrored, exiting.."
|
echo "svc account not mirrored, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct rm minio1 testsvc
|
./mc admin user svcacct rm minio1 testsvc
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "removing svc account failed, exiting.."
|
echo "removing svc account failed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
./mc admin user svcacct info minio2 testsvc
|
./mc admin user svcacct info minio2 testsvc
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "svc account found after delete, exiting.."
|
echo "svc account found after delete, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct info minio3 testsvc
|
./mc admin user svcacct info minio3 testsvc
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "svc account found after delete, exiting.."
|
echo "svc account found after delete, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc mb minio1/newbucket
|
./mc mb minio1/newbucket
|
||||||
@ -180,24 +180,24 @@ sleep 5
|
|||||||
./mc stat minio2/newbucket
|
./mc stat minio2/newbucket
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting bucket to be present. exiting.."
|
echo "expecting bucket to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc stat minio3/newbucket
|
./mc stat minio3/newbucket
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting bucket to be present. exiting.."
|
echo "expecting bucket to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
err_minio2=$(./mc stat minio2/newbucket/xxx --json | jq -r .error.cause.message)
|
err_minio2=$(./mc stat minio2/newbucket/xxx --json | jq -r .error.cause.message)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be missing. exiting.."
|
echo "expecting object to be missing. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${err_minio2}" != "Object does not exist" ]; then
|
if [ "${err_minio2}" != "Object does not exist" ]; then
|
||||||
echo "expected to see Object does not exist error, exiting..."
|
echo "expected to see Object does not exist error, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc cp README.md minio2/newbucket/
|
./mc cp README.md minio2/newbucket/
|
||||||
@ -206,20 +206,20 @@ sleep 5
|
|||||||
./mc stat minio1/newbucket/README.md
|
./mc stat minio1/newbucket/README.md
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc stat minio3/newbucket/README.md
|
./mc stat minio3/newbucket/README.md
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
./mc stat minio3/newbucket/lrgfile
|
./mc stat minio3/newbucket/lrgfile
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected object to be present, exiting.."
|
echo "expected object to be present, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
actual_checksum=$(./mc cat minio3/newbucket/lrgfile | md5sum)
|
actual_checksum=$(./mc cat minio3/newbucket/lrgfile | md5sum)
|
||||||
@ -232,31 +232,31 @@ rm ./lrgfile
|
|||||||
vID=$(./mc stat minio2/newbucket/README.md --json | jq .versionID)
|
vID=$(./mc stat minio2/newbucket/README.md --json | jq .versionID)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
./mc tag set --version-id "${vID}" minio2/newbucket/README.md "k=v"
|
./mc tag set --version-id "${vID}" minio2/newbucket/README.md "k=v"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting tag set to be successful. exiting.."
|
echo "expecting tag set to be successful. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
./mc tag remove --version-id "${vID}" minio2/newbucket/README.md
|
./mc tag remove --version-id "${vID}" minio2/newbucket/README.md
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting tag removal to be successful. exiting.."
|
echo "expecting tag removal to be successful. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
replStatus_minio2=$(./mc stat minio2/newbucket/README.md --json | jq -r .replicationStatus)
|
replStatus_minio2=$(./mc stat minio2/newbucket/README.md --json | jq -r .replicationStatus)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${replStatus_minio2} != "COMPLETED" ]; then
|
if [ ${replStatus_minio2} != "COMPLETED" ]; then
|
||||||
echo "expected tag removal to have replicated, exiting..."
|
echo "expected tag removal to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc rm minio3/newbucket/README.md
|
./mc rm minio3/newbucket/README.md
|
||||||
@ -265,13 +265,13 @@ sleep 5
|
|||||||
./mc stat minio2/newbucket/README.md
|
./mc stat minio2/newbucket/README.md
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expected file to be deleted, exiting.."
|
echo "expected file to be deleted, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc stat minio1/newbucket/README.md
|
./mc stat minio1/newbucket/README.md
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expected file to be deleted, exiting.."
|
echo "expected file to be deleted, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc mb --with-lock minio3/newbucket-olock
|
./mc mb --with-lock minio3/newbucket-olock
|
||||||
@ -280,48 +280,48 @@ sleep 5
|
|||||||
enabled_minio2=$(./mc stat --json minio2/newbucket-olock | jq -r .ObjectLock.enabled)
|
enabled_minio2=$(./mc stat --json minio2/newbucket-olock | jq -r .ObjectLock.enabled)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${enabled_minio2}" != "Enabled" ]; then
|
if [ "${enabled_minio2}" != "Enabled" ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
enabled_minio1=$(./mc stat --json minio1/newbucket-olock | jq -r .ObjectLock.enabled)
|
enabled_minio1=$(./mc stat --json minio1/newbucket-olock | jq -r .ObjectLock.enabled)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${enabled_minio1}" != "Enabled" ]; then
|
if [ "${enabled_minio1}" != "Enabled" ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# "Test if most recent tag update is replicated"
|
# "Test if most recent tag update is replicated"
|
||||||
./mc tag set minio2/newbucket "key=val1"
|
./mc tag set minio2/newbucket "key=val1"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting tag set to be successful. exiting.."
|
echo "expecting tag set to be successful. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
||||||
if [ "${val}" != "val1" ]; then
|
if [ "${val}" != "val1" ]; then
|
||||||
echo "expected bucket tag to have replicated, exiting..."
|
echo "expected bucket tag to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
# Create user with policy consoleAdmin on minio1
|
# Create user with policy consoleAdmin on minio1
|
||||||
./mc admin user add minio1 foobarx foobar123
|
./mc admin user add minio1 foobarx foobar123
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "adding user failed, exiting.."
|
echo "adding user failed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
./mc admin policy attach minio1 consoleAdmin --user=foobarx
|
./mc admin policy attach minio1 consoleAdmin --user=foobarx
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "adding policy mapping failed, exiting.."
|
echo "adding policy mapping failed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ sleep 10
|
|||||||
./mc admin policy detach minio2 consoleAdmin --user=foobarx
|
./mc admin policy detach minio2 consoleAdmin --user=foobarx
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "unset policy mapping failed, exiting.."
|
echo "unset policy mapping failed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create a bucket bucket2 on minio1.
|
# create a bucket bucket2 on minio1.
|
||||||
@ -341,7 +341,7 @@ sleep 10
|
|||||||
policy=$(./mc admin user info minio1 foobarx --json | jq -r .policyName)
|
policy=$(./mc admin user info minio1 foobarx --json | jq -r .policyName)
|
||||||
if [ "${policy}" != "null" ]; then
|
if [ "${policy}" != "null" ]; then
|
||||||
echo "expected policy detach to have replicated, exiting..."
|
echo "expected policy detach to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kill -9 ${site1_pid}
|
kill -9 ${site1_pid}
|
||||||
@ -361,12 +361,12 @@ sleep 200
|
|||||||
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
||||||
if [ "${val}" != "val2" ]; then
|
if [ "${val}" != "val2" ]; then
|
||||||
echo "expected bucket tag to have replicated, exiting..."
|
echo "expected bucket tag to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test if bucket created/deleted when minio1 is down healed
|
# Test if bucket created/deleted when minio1 is down healed
|
||||||
diff -q <(./mc ls minio1) <(./mc ls minio2) 1>/dev/null
|
diff -q <(./mc ls minio1) <(./mc ls minio2) 1>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected 'bucket2' delete and 'newbucket2' creation to have replicated, exiting..."
|
echo "expected 'bucket2' delete and 'newbucket2' creation to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
@ -53,8 +53,8 @@ minio server --address ":9003" --console-address ":12000" /tmp/minio3/{1...4} >/
|
|||||||
site3_pid=$!
|
site3_pid=$!
|
||||||
|
|
||||||
if [ ! -f ./mc ]; then
|
if [ ! -f ./mc ]; then
|
||||||
wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc \
|
wget -O mc https://dl.minio.io/client/mc/release/linux-amd64/mc &&
|
||||||
&& chmod +x mc
|
chmod +x mc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
@ -71,12 +71,12 @@ sleep 5
|
|||||||
./mc admin policy info minio2 projecta >/dev/null 2>&1
|
./mc admin policy info minio2 projecta >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting the command to succeed, exiting.."
|
echo "expecting the command to succeed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
./mc admin policy info minio3 projecta >/dev/null 2>&1
|
./mc admin policy info minio3 projecta >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting the command to succeed, exiting.."
|
echo "expecting the command to succeed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin policy remove minio3 projecta
|
./mc admin policy remove minio3 projecta
|
||||||
@ -85,13 +85,13 @@ sleep 10
|
|||||||
./mc admin policy info minio1 projecta
|
./mc admin policy info minio1 projecta
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expecting the command to fail, exiting.."
|
echo "expecting the command to fail, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin policy info minio2 projecta
|
./mc admin policy info minio2 projecta
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expecting the command to fail, exiting.."
|
echo "expecting the command to fail, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin policy create minio1 projecta ./docs/site-replication/rw.json
|
./mc admin policy create minio1 projecta ./docs/site-replication/rw.json
|
||||||
@ -103,7 +103,7 @@ STS_CRED=$(MINIO_ENDPOINT=http://localhost:9001 go run ./docs/site-replication/g
|
|||||||
MC_HOST_foo=http://${STS_CRED}@localhost:9001 ./mc ls foo
|
MC_HOST_foo=http://${STS_CRED}@localhost:9001 ./mc ls foo
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Expected sts credential to work, exiting.."
|
echo "Expected sts credential to work, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
@ -112,13 +112,13 @@ sleep 2
|
|||||||
MC_HOST_foo=http://${STS_CRED}@localhost:9002 ./mc ls foo
|
MC_HOST_foo=http://${STS_CRED}@localhost:9002 ./mc ls foo
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Expected sts credential to work, exiting.."
|
echo "Expected sts credential to work, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MC_HOST_foo=http://${STS_CRED}@localhost:9003 ./mc ls foo
|
MC_HOST_foo=http://${STS_CRED}@localhost:9003 ./mc ls foo
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Expected sts credential to work, exiting.."
|
echo "Expected sts credential to work, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
STS_ACCESS_KEY=$(echo ${STS_CRED} | cut -d ':' -f 1)
|
STS_ACCESS_KEY=$(echo ${STS_CRED} | cut -d ':' -f 1)
|
||||||
@ -127,7 +127,7 @@ STS_ACCESS_KEY=$(echo ${STS_CRED} | cut -d ':' -f 1)
|
|||||||
./mc admin user svcacct add minio2 $STS_ACCESS_KEY --access-key testsvc --secret-key testsvc123
|
./mc admin user svcacct add minio2 $STS_ACCESS_KEY --access-key testsvc --secret-key testsvc123
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "adding svc account failed, exiting.."
|
echo "adding svc account failed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
@ -135,32 +135,32 @@ sleep 10
|
|||||||
./mc admin user svcacct info minio1 testsvc
|
./mc admin user svcacct info minio1 testsvc
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "svc account not mirrored, exiting.."
|
echo "svc account not mirrored, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct info minio2 testsvc
|
./mc admin user svcacct info minio2 testsvc
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "svc account not mirrored, exiting.."
|
echo "svc account not mirrored, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct rm minio1 testsvc
|
./mc admin user svcacct rm minio1 testsvc
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "removing svc account failed, exiting.."
|
echo "removing svc account failed, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
./mc admin user svcacct info minio2 testsvc
|
./mc admin user svcacct info minio2 testsvc
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "svc account found after delete, exiting.."
|
echo "svc account found after delete, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc admin user svcacct info minio3 testsvc
|
./mc admin user svcacct info minio3 testsvc
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "svc account found after delete, exiting.."
|
echo "svc account found after delete, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create a bucket bucket2 on minio1.
|
# create a bucket bucket2 on minio1.
|
||||||
@ -177,13 +177,13 @@ sleep 5
|
|||||||
./mc stat minio2/newbucket
|
./mc stat minio2/newbucket
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting bucket to be present. exiting.."
|
echo "expecting bucket to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc stat minio3/newbucket
|
./mc stat minio3/newbucket
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting bucket to be present. exiting.."
|
echo "expecting bucket to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc cp README.md minio2/newbucket/
|
./mc cp README.md minio2/newbucket/
|
||||||
@ -192,13 +192,13 @@ sleep 5
|
|||||||
./mc stat minio1/newbucket/README.md
|
./mc stat minio1/newbucket/README.md
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc stat minio3/newbucket/README.md
|
./mc stat minio3/newbucket/README.md
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting object to be present. exiting.."
|
echo "expecting object to be present. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc rm minio3/newbucket/README.md
|
./mc rm minio3/newbucket/README.md
|
||||||
@ -207,20 +207,20 @@ sleep 5
|
|||||||
./mc stat minio2/newbucket/README.md
|
./mc stat minio2/newbucket/README.md
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expected file to be deleted, exiting.."
|
echo "expected file to be deleted, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mc stat minio1/newbucket/README.md
|
./mc stat minio1/newbucket/README.md
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "expected file to be deleted, exiting.."
|
echo "expected file to be deleted, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
./mc stat minio3/newbucket/lrgfile
|
./mc stat minio3/newbucket/lrgfile
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected object to be present, exiting.."
|
echo "expected object to be present, exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
actual_checksum=$(./mc cat minio3/newbucket/lrgfile | md5sum)
|
actual_checksum=$(./mc cat minio3/newbucket/lrgfile | md5sum)
|
||||||
if [ "${expected_checksum}" != "${actual_checksum}" ]; then
|
if [ "${expected_checksum}" != "${actual_checksum}" ]; then
|
||||||
@ -235,37 +235,37 @@ sleep 5
|
|||||||
enabled_minio2=$(./mc stat --json minio2/newbucket-olock | jq -r .ObjectLock.enabled)
|
enabled_minio2=$(./mc stat --json minio2/newbucket-olock | jq -r .ObjectLock.enabled)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${enabled_minio2}" != "Enabled" ]; then
|
if [ "${enabled_minio2}" != "Enabled" ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
enabled_minio1=$(./mc stat --json minio1/newbucket-olock | jq -r .ObjectLock.enabled)
|
enabled_minio1=$(./mc stat --json minio1/newbucket-olock | jq -r .ObjectLock.enabled)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
echo "expected bucket to be mirrored with object-lock but not present, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${enabled_minio1}" != "Enabled" ]; then
|
if [ "${enabled_minio1}" != "Enabled" ]; then
|
||||||
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
echo "expected bucket to be mirrored with object-lock enabled, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# "Test if most recent tag update is replicated"
|
# "Test if most recent tag update is replicated"
|
||||||
./mc tag set minio2/newbucket "key=val1"
|
./mc tag set minio2/newbucket "key=val1"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expecting tag set to be successful. exiting.."
|
echo "expecting tag set to be successful. exiting.."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
||||||
if [ "${val}" != "val1" ]; then
|
if [ "${val}" != "val1" ]; then
|
||||||
echo "expected bucket tag to have replicated, exiting..."
|
echo "expected bucket tag to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
# stop minio1 instance
|
# stop minio1 instance
|
||||||
kill -9 ${site1_pid}
|
kill -9 ${site1_pid}
|
||||||
@ -284,12 +284,12 @@ sleep 200
|
|||||||
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
val=$(./mc tag list minio1/newbucket --json | jq -r .tagset | jq -r .key)
|
||||||
if [ "${val}" != "val2" ]; then
|
if [ "${val}" != "val2" ]; then
|
||||||
echo "expected bucket tag to have replicated, exiting..."
|
echo "expected bucket tag to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test if bucket created/deleted when minio1 is down healed
|
# Test if bucket created/deleted when minio1 is down healed
|
||||||
diff -q <(./mc ls minio1) <(./mc ls minio2) 1>/dev/null
|
diff -q <(./mc ls minio1) <(./mc ls minio2) 1>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "expected 'bucket2' delete and 'newbucket2' creation to have replicated, exiting..."
|
echo "expected 'bucket2' delete and 'newbucket2' creation to have replicated, exiting..."
|
||||||
exit_1;
|
exit_1
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user