mirror of
https://github.com/versity/versitygw.git
synced 2026-01-05 11:24:52 +00:00
301 lines
12 KiB
YAML
301 lines
12 KiB
YAML
name: system tests
|
|
permissions: {}
|
|
on: pull_request
|
|
jobs:
|
|
build:
|
|
name: RunTests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- set: "mc, posix, non-file count, non-static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "mc-non-file-count"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "mc, posix, file count, non-static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "mc-file-count"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "REST, posix, non-static, base|acl|multipart|put-object, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "rest-base,rest-acl,rest-multipart,rest-put-object"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "REST, posix, non-static, chunked|checksum|versioning|bucket, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "rest-chunked,rest-checksum,rest-versioning,rest-bucket,rest-list-buckets,rest-create-bucket,rest-head-bucket"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "REST, posix, non-static, not implemented|rest-delete-bucket-ownership-controls|rest-delete-bucket-tagging, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "rest-not-implemented,rest-delete-bucket-ownership-controls,rest-delete-bucket-tagging"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "REST, posix, static, base|acl|multipart|put-object, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "rest-base,rest-acl,rest-multipart,rest-put-object"
|
|
RECREATE_BUCKETS: "false"
|
|
DELETE_BUCKETS_AFTER_TEST: "false"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "REST, posix, static, chunked|checksum|versioning|bucket, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "rest-chunked,rest-checksum,rest-versioning,rest-bucket,rest-list-buckets,rest-create-bucket,rest-head-bucket"
|
|
RECREATE_BUCKETS: "false"
|
|
DELETE_BUCKETS_AFTER_TEST: "false"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "REST, posix, static, not implemented|rest-delete-bucket-ownership-controls|rest-delete-bucket-tagging, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "rest-not-implemented,rest-delete-bucket-ownership-controls,rest-delete-bucket-tagging"
|
|
RECREATE_BUCKETS: "false"
|
|
DELETE_BUCKETS_AFTER_TEST: "false"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "REST, posix, static, rest-put-bucket-tagging|rest-get-bucket-location, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "rest-put-bucket-tagging,rest-get-bucket-location"
|
|
RECREATE_BUCKETS: "false"
|
|
DELETE_BUCKETS_AFTER_TEST: "false"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "REST, posix, non-static, rest-put-bucket-tagging|rest-get-bucket-location, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "rest-put-bucket-tagging,rest-get-bucket-location"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-west-1"
|
|
- set: "s3, posix, non-file count, non-static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3-non-file-count"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3, posix, file count, non-static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3-file-count"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3api, posix, bucket|object|multipart, non-static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3api-bucket,s3api-object,s3api-multipart"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3api, posix, policy, non-static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3api-policy"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3api, posix, user, non-static, s3 IAM"
|
|
IAM_TYPE: s3
|
|
RUN_SET: "s3api-user"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3api, posix, bucket, static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3api-bucket"
|
|
RECREATE_BUCKETS: "false"
|
|
DELETE_BUCKETS_AFTER_TEST: "false"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3api, posix, multipart, static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3api-multipart"
|
|
RECREATE_BUCKETS: "false"
|
|
DELETE_BUCKETS_AFTER_TEST: "false"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3api, posix, object, static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3api-object"
|
|
RECREATE_BUCKETS: "false"
|
|
DELETE_BUCKETS_AFTER_TEST: "false"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3api, posix, policy, static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3api-policy"
|
|
RECREATE_BUCKETS: "false"
|
|
DELETE_BUCKETS_AFTER_TEST: "false"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3api, posix, user, static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3api-user"
|
|
RECREATE_BUCKETS: "false"
|
|
DELETE_BUCKETS_AFTER_TEST: "false"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
# TODO fix/debug s3 gateway
|
|
#- set: "s3api, s3, multipart|object, non-static, folder IAM"
|
|
# IAM_TYPE: folder
|
|
# RUN_SET: "s3api-bucket,s3api-object,s3api-multipart"
|
|
# RECREATE_BUCKETS: "true"
|
|
# BACKEND: "s3"
|
|
#- set: "s3api, s3, policy|user, non-static, folder IAM"
|
|
# IAM_TYPE: folder
|
|
# RUN_SET: "s3api-policy,s3api-user"
|
|
# RECREATE_BUCKETS: "true"
|
|
# BACKEND: "s3"
|
|
- set: "s3cmd, posix, file count, non-static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3cmd-file-count"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3cmd, posix, non-user, non-static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3cmd-non-user"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "s3cmd, posix, user, non-static, folder IAM"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "s3cmd-user"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
- set: "setup/remove static buckets scripts"
|
|
IAM_TYPE: folder
|
|
RUN_SET: "setup-remove-static"
|
|
RECREATE_BUCKETS: "true"
|
|
DELETE_BUCKETS_AFTER_TEST: "true"
|
|
BACKEND: "posix"
|
|
AWS_REGION: "us-east-1"
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "stable"
|
|
id: go
|
|
|
|
- name: Get Dependencies
|
|
run: |
|
|
go get -v -t -d ./...
|
|
|
|
- name: Install BATS
|
|
run: |
|
|
git clone https://github.com/bats-core/bats-core.git
|
|
cd bats-core && ./install.sh $HOME
|
|
git clone https://github.com/bats-core/bats-support.git ${{ github.workspace }}/tests/bats-support
|
|
git clone https://github.com/ztombol/bats-assert.git ${{ github.workspace }}/tests/bats-assert
|
|
|
|
- name: Install s3cmd
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install s3cmd
|
|
|
|
- name: Install mc
|
|
run: |
|
|
curl https://dl.min.io/client/mc/release/linux-amd64/mc --create-dirs -o /usr/local/bin/mc
|
|
chmod 755 /usr/local/bin/mc
|
|
|
|
- name: Install xml libraries (for rest)
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install libxml2-utils xmlstarlet
|
|
|
|
# see https://github.com/versity/versitygw/issues/1034
|
|
- name: Install AWS cli
|
|
run: |
|
|
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.22.35.zip" -o "awscliv2.zip"
|
|
unzip -o awscliv2.zip
|
|
./aws/install -i ${{ github.workspace }}/aws-cli -b ${{ github.workspace }}/bin
|
|
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
|
|
|
|
- name: Build and run
|
|
env:
|
|
IAM_TYPE: ${{ matrix.IAM_TYPE }}
|
|
RUN_SET: ${{ matrix.RUN_SET }}
|
|
AWS_PROFILE: versity
|
|
VERSITY_EXE: ${{ github.workspace }}/versitygw
|
|
RUN_VERSITYGW: true
|
|
BACKEND: ${{ matrix.BACKEND }}
|
|
RECREATE_BUCKETS: ${{ matrix.RECREATE_BUCKETS }}
|
|
DELETE_BUCKETS_AFTER_TEST: ${{ matrix.DELETE_BUCKETS_AFTER_TEST }}
|
|
CERT: ${{ github.workspace }}/cert.pem
|
|
KEY: ${{ github.workspace }}/versitygw.pem
|
|
LOCAL_FOLDER: /tmp/gw
|
|
BUCKET_ONE_NAME: versity-gwtest-bucket-one
|
|
BUCKET_TWO_NAME: versity-gwtest-bucket-two
|
|
USERS_FOLDER: /tmp/iam
|
|
USERS_BUCKET: versity-gwtest-iam
|
|
AWS_ENDPOINT_URL: https://127.0.0.1:7070
|
|
PORT: 7070
|
|
S3CMD_CONFIG: tests/s3cfg.local.default
|
|
MC_ALIAS: versity
|
|
LOG_LEVEL: 4
|
|
GOCOVERDIR: ${{ github.workspace }}/cover
|
|
USERNAME_ONE: HIJKLMN
|
|
PASSWORD_ONE: 1234567
|
|
USERNAME_TWO: OPQRSTU
|
|
PASSWORD_TWO: 8901234
|
|
TEST_FILE_FOLDER: ${{ github.workspace }}/versity-gwtest-files
|
|
REMOVE_TEST_FILE_FOLDER: true
|
|
VERSIONING_DIR: ${{ github.workspace }}/versioning
|
|
COMMAND_LOG: command.log
|
|
TIME_LOG: time.log
|
|
PYTHON_ENV_FOLDER: ${{ github.workspace }}/env
|
|
AUTOGENERATE_USERS: true
|
|
USER_AUTOGENERATION_PREFIX: github-actions-test-
|
|
AWS_REGION: ${{ matrix.AWS_REGION }}
|
|
run: |
|
|
make testbin
|
|
export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPQRST
|
|
export AWS_SECRET_ACCESS_KEY=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn
|
|
export AWS_REGION=$AWS_REGION
|
|
export AWS_ACCESS_KEY_ID_TWO=user
|
|
export AWS_SECRET_ACCESS_KEY_TWO=pass
|
|
export AWS_REQUEST_CHECKSUM_CALCULATION=WHEN_REQUIRED
|
|
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile versity
|
|
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile versity
|
|
aws configure set aws_region $AWS_REGION --profile versity
|
|
mkdir $LOCAL_FOLDER
|
|
export WORKSPACE=$GITHUB_WORKSPACE
|
|
openssl genpkey -algorithm RSA -out $KEY -pkeyopt rsa_keygen_bits:2048
|
|
openssl req -new -x509 -key $KEY -out $CERT -days 365 -subj "/C=US/ST=California/L=San Francisco/O=Versity/OU=Software/CN=versity.com"
|
|
mkdir $GOCOVERDIR $USERS_FOLDER
|
|
if [[ $RECREATE_BUCKETS == "false" ]]; then
|
|
BYPASS_ENV_FILE=true ${{ github.workspace }}/tests/setup_static.sh
|
|
fi
|
|
BYPASS_ENV_FILE=true ${{ github.workspace }}/tests/run.sh $RUN_SET
|
|
|
|
- name: Time report
|
|
run: |
|
|
if [ -e ${{ github.workspace }}/time.log ]; then
|
|
cat ${{ github.workspace }}/time.log
|
|
fi
|
|
|
|
- name: Coverage report
|
|
run: |
|
|
go tool covdata percent -i=cover
|