From b09d2ef896717d79321131d9adcfa092b82bd60a Mon Sep 17 00:00:00 2001 From: Raul-Mircea Date: Fri, 19 Dec 2025 15:57:10 +0200 Subject: [PATCH 1/3] Introduce EC variant --- README.md | 1 + build/mc/install.sh | 5 +++++ run/core/mc/README.md | 16 +++++++++++++++- run/core/mc/run.sh | 27 ++++++++++++++++++++++++++- 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 56e5ecef..e8db07aa 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Below environment variables are required to be passed to the podman container. S | `SECRET_KEY` | Secret Key for `SERVER_ENDPOINT` credentials | `zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG` | | `ENABLE_HTTPS` | (Optional) Set `1` to indicate to use HTTPS to access `SERVER_ENDPOINT`. Defaults to `0` (HTTP) | `1` | | `MINT_MODE` | (Optional) Set mode indicating what category of tests to be run by values `core`, `full`. Defaults to `core` | `full` | +| `MINT_MC_VARIANT` | (Optional) Select `mc` test variant by values `mc`, `ec`. Defaults to `mc`. (Using `ec` requires providing the `ec` repo in the container.) | `ec` | | `DOMAIN` | (Optional) Value of MINIO_DOMAIN environment variable used in Minio server | `myminio.com` | | `ENABLE_VIRTUAL_STYLE` | (Optional) Set `1` to indicate virtual style access . Defaults to `0` (Path style) | `1` | | `RUN_ON_FAIL` | (Optional) Set `1` to indicate execute all tests independent of failures (currently implemented for minio-go and minio-java) . Defaults to `0` | `1` | diff --git a/build/mc/install.sh b/build/mc/install.sh index dbc45498..a5194a5d 100755 --- a/build/mc/install.sh +++ b/build/mc/install.sh @@ -15,6 +15,11 @@ # limitations under the License. # +if [ "${MINT_MC_VARIANT:-mc}" = "ec" ]; then + echo "MINT_MC_VARIANT=ec: skipping upstream mc install (expecting ec-provided repo/binary/tests)" + exit 0 +fi + MC_VERSION=$(curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/mc/releases/latest | sed "s/https:\/\/github.com\/minio\/mc\/releases\/tag\///") if [ -z "$MC_VERSION" ]; then echo "unable to get mc version from github" diff --git a/run/core/mc/README.md b/run/core/mc/README.md index 9a550e09..977fc14c 100644 --- a/run/core/mc/README.md +++ b/run/core/mc/README.md @@ -2,7 +2,7 @@ This directory serves as the location for Mint tests using `mc`. Top level `mint.sh` calls `run.sh` to execute tests. ## Adding new tests -New tests is added into `test.sh` as new functions. +Upstream `mc` tests live in `functional-tests.sh` (fetched from `minio/mc` during the Mint image build). ## Running tests manually - Set environment variables `MINT_DATA_DIR`, `MINT_MODE`, `SERVER_ENDPOINT`, `ACCESS_KEY`, `SECRET_KEY`, `SERVER_REGION` and `ENABLE_HTTPS` @@ -17,3 +17,17 @@ export ENABLE_HTTPS=1 export SERVER_REGION=us-east-1 ./run.sh /tmp/output.log /tmp/error.log ``` + +## Running `ec` (enterprise) mc variant +If you want to run `mc` tests using the `ec` fork, set `MINT_MC_VARIANT=ec` and provide the `ec` repo inside the container. + +By default `run.sh` looks for: +- `./ec/` (a checkout of the `ec` repository) + +It then runs an `ec`-provided runner script at `./ec/mint/run.sh` (relative to this directory). + +Override locations/behavior with: +- `MINT_MC_EC_REPO_DIR` (path to the checked out `ec` repo; default `./ec`) +- `MINT_MC_EC_RUNNER` (path to an executable runner script; default `./ec/mint/run.sh`) + +Tip: `run-ec.sh` in this directory is a template you can copy into the `ec` repo as `mint/run.sh`. diff --git a/run/core/mc/run.sh b/run/core/mc/run.sh index 702db5b7..66f337e5 100755 --- a/run/core/mc/run.sh +++ b/run/core/mc/run.sh @@ -24,4 +24,29 @@ fi output_log_file="$1" error_log_file="$2" -./functional-tests.sh 1>>"$output_log_file" 2>"$error_log_file" +mc_variant="${MINT_MC_VARIANT:-mc}" + +case "$mc_variant" in + ec) + ec_repo_dir="${MINT_MC_EC_REPO_DIR:-./ec}" + ec_runner_default="${ec_repo_dir}/mint/run.sh" + ec_runner="${MINT_MC_EC_RUNNER:-$ec_runner_default}" + + if [ ! -f "$ec_runner" ]; then + echo "MINT_MC_VARIANT=ec but missing runner: $ec_runner" >&2 + echo "mount the ec repo at /mint/run/core/mc/ec (so $ec_runner_default exists) or set MINT_MC_EC_RUNNER" >&2 + exit 1 + fi + + # Use exec for the ec tests + exec bash "$ec_runner" "$output_log_file" "$error_log_file" + ;; + mc) + # Run upstream mc tests + ./functional-tests.sh 1>>"$output_log_file" 2>"$error_log_file" + ;; + *) + echo "unknown MINT_MC_VARIANT: $mc_variant (supported: mc, ec)" >&2 + exit 1 + ;; +esac From 5005159f4fbfa3892ac4cdfbada3d111b0696c18 Mon Sep 17 00:00:00 2001 From: Raul-Mircea Date: Fri, 19 Dec 2025 16:11:15 +0200 Subject: [PATCH 2/3] Fmt --- run/core/mc/run.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/run/core/mc/run.sh b/run/core/mc/run.sh index 66f337e5..6f934eb5 100755 --- a/run/core/mc/run.sh +++ b/run/core/mc/run.sh @@ -27,26 +27,26 @@ error_log_file="$2" mc_variant="${MINT_MC_VARIANT:-mc}" case "$mc_variant" in - ec) - ec_repo_dir="${MINT_MC_EC_REPO_DIR:-./ec}" - ec_runner_default="${ec_repo_dir}/mint/run.sh" - ec_runner="${MINT_MC_EC_RUNNER:-$ec_runner_default}" +ec) + ec_repo_dir="${MINT_MC_EC_REPO_DIR:-./ec}" + ec_runner_default="${ec_repo_dir}/mint/run.sh" + ec_runner="${MINT_MC_EC_RUNNER:-$ec_runner_default}" - if [ ! -f "$ec_runner" ]; then - echo "MINT_MC_VARIANT=ec but missing runner: $ec_runner" >&2 - echo "mount the ec repo at /mint/run/core/mc/ec (so $ec_runner_default exists) or set MINT_MC_EC_RUNNER" >&2 - exit 1 - fi - - # Use exec for the ec tests - exec bash "$ec_runner" "$output_log_file" "$error_log_file" - ;; - mc) - # Run upstream mc tests - ./functional-tests.sh 1>>"$output_log_file" 2>"$error_log_file" - ;; - *) - echo "unknown MINT_MC_VARIANT: $mc_variant (supported: mc, ec)" >&2 + if [ ! -f "$ec_runner" ]; then + echo "MINT_MC_VARIANT=ec but missing runner: $ec_runner" >&2 + echo "mount the ec repo at /mint/run/core/mc/ec (so $ec_runner_default exists) or set MINT_MC_EC_RUNNER" >&2 exit 1 - ;; + fi + + # Use exec for the ec tests + exec bash "$ec_runner" "$output_log_file" "$error_log_file" + ;; +mc) + # Run upstream mc tests + ./functional-tests.sh 1>>"$output_log_file" 2>"$error_log_file" + ;; +*) + echo "unknown MINT_MC_VARIANT: $mc_variant (supported: mc, ec)" >&2 + exit 1 + ;; esac From f5cfcf8d2bb77ebf282a0a981fb311138ad0f584 Mon Sep 17 00:00:00 2001 From: Raul-Mircea Date: Fri, 19 Dec 2025 18:07:58 +0200 Subject: [PATCH 3/3] Fixes --- README.md | 2 +- run/core/mc/README.md | 2 -- run/core/mc/run.sh | 5 ++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e8db07aa..e10151cc 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Below environment variables are required to be passed to the podman container. S | `SECRET_KEY` | Secret Key for `SERVER_ENDPOINT` credentials | `zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG` | | `ENABLE_HTTPS` | (Optional) Set `1` to indicate to use HTTPS to access `SERVER_ENDPOINT`. Defaults to `0` (HTTP) | `1` | | `MINT_MODE` | (Optional) Set mode indicating what category of tests to be run by values `core`, `full`. Defaults to `core` | `full` | -| `MINT_MC_VARIANT` | (Optional) Select `mc` test variant by values `mc`, `ec`. Defaults to `mc`. (Using `ec` requires providing the `ec` repo in the container.) | `ec` | +| `MINT_MC_VARIANT` | (Optional) Select `mc` test variant by values `mc`, `ec`. Defaults to `mc`. (Using `ec` requires providing the `ec` repo in the container.) | `ec` | | | `DOMAIN` | (Optional) Value of MINIO_DOMAIN environment variable used in Minio server | `myminio.com` | | `ENABLE_VIRTUAL_STYLE` | (Optional) Set `1` to indicate virtual style access . Defaults to `0` (Path style) | `1` | | `RUN_ON_FAIL` | (Optional) Set `1` to indicate execute all tests independent of failures (currently implemented for minio-go and minio-java) . Defaults to `0` | `1` | diff --git a/run/core/mc/README.md b/run/core/mc/README.md index 977fc14c..ede76655 100644 --- a/run/core/mc/README.md +++ b/run/core/mc/README.md @@ -29,5 +29,3 @@ It then runs an `ec`-provided runner script at `./ec/mint/run.sh` (relative to t Override locations/behavior with: - `MINT_MC_EC_REPO_DIR` (path to the checked out `ec` repo; default `./ec`) - `MINT_MC_EC_RUNNER` (path to an executable runner script; default `./ec/mint/run.sh`) - -Tip: `run-ec.sh` in this directory is a template you can copy into the `ec` repo as `mint/run.sh`. diff --git a/run/core/mc/run.sh b/run/core/mc/run.sh index 6f934eb5..693887df 100755 --- a/run/core/mc/run.sh +++ b/run/core/mc/run.sh @@ -29,12 +29,11 @@ mc_variant="${MINT_MC_VARIANT:-mc}" case "$mc_variant" in ec) ec_repo_dir="${MINT_MC_EC_REPO_DIR:-./ec}" - ec_runner_default="${ec_repo_dir}/mint/run.sh" - ec_runner="${MINT_MC_EC_RUNNER:-$ec_runner_default}" + ec_runner="${MINT_MC_EC_RUNNER:-${ec_repo_dir}/mint/run.sh}" if [ ! -f "$ec_runner" ]; then echo "MINT_MC_VARIANT=ec but missing runner: $ec_runner" >&2 - echo "mount the ec repo at /mint/run/core/mc/ec (so $ec_runner_default exists) or set MINT_MC_EC_RUNNER" >&2 + echo "mount the ec repo at ./ec (so ${ec_repo_dir}/mint/run.sh exists) or set MINT_MC_EC_RUNNER" >&2 exit 1 fi