-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add OpenStack Swift e2e test (#3493)
* chore: add openstack swift into .env.example * feat: add openstack swift e2e test * feat: drop rename as swift doesn't support it * fix: correct OPENDAL_SWIFT_ROOT value * chore: use another way to export env variables * tmp: add debug log * chore: modify timout and retries values * fix: adding tr -d '\n' to fix weird bug * chore: add trim_end to token as triage weird bug * chore: don't use token from GITHUB_ENV * feat: export env variable at once * chore: use different format to export env variable * chore: use echo -e to enable backslash escapes. * chore: use cat EOF to set token * chore: workaround by pre-apply token and trim end * chore: triage by merge two steps together * chore: prune and separate steps * chore: reset comment out for debug purpose
- Loading branch information
Showing
8 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: swift | ||
description: "Behavior test for OpenStack Swift" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Swift service | ||
shell: bash | ||
working-directory: fixtures/swift | ||
run: | | ||
docker compose -f docker-compose-swift.yml up -d --wait | ||
- name: Create test token and setup test container | ||
shell: bash | ||
run: | | ||
token=$(curl -i -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://127.0.0.1:8080/auth/v1.0 | grep X-Auth-Token | head -n1 | awk '{print $2}') | ||
curl --location --request PUT 'http://127.0.0.1:8080/v1/AUTH_test/testing' --header "X-Auth-Token: $token" | ||
echo "OPENDAL_SWIFT_TOKEN=$(echo "$token" | tr -d '[:space:]')" >> $GITHUB_ENV | ||
- name: Set environment variables | ||
shell: bash | ||
run: | | ||
cat << EOF >> $GITHUB_ENV | ||
OPENDAL_SWIFT_ENDPOINT=http://127.0.0.1:8080 | ||
OPENDAL_SWIFT_ACCOUNT=AUTH_test | ||
OPENDAL_SWIFT_CONTAINER=testing | ||
OPENDAL_SWIFT_ROOT=/ | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
version: '3.8' | ||
|
||
services: | ||
swift: | ||
image: openstackswift/saio:py3 | ||
ports: | ||
- 8080:8080 | ||
healthcheck: | ||
test: ["CMD", "curl", "-i", "-H", "X-Storage-User: test:tester", "-H", "X-Storage-Pass: testing", "http://localhost:8080/"] | ||
interval: 3s | ||
timeout: 20s | ||
retries: 10 |