Skip to content

Commit

Permalink
add swift_with_storage_url test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
zjregee committed Mar 1, 2024
1 parent cfc60fc commit fffb809
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/services/swift/swift_with_storage_url/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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_with_storage_url
description: "Behavior test for OpenStack Swift with storage_url."

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 environment variables and setup test container
shell: bash
run: |
response=$(curl -i -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://127.0.0.1:8080/auth/v1.0)
token=$(echo "$response" | grep X-Auth-Token | head -n1 | awk '{print $2}' | tr -d '[:space:]')
storage_url=$(echo "$response" | grep X-Storage-Url | head -n1 | awk '{print $2}' | tr -d '[:space:]')
curl --location --request PUT "${storage_url}/testing" --header "X-Auth-Token: $token"
echo "OPENDAL_SWIFT_TOKEN=${token}" >> $GITHUB_ENV
echo "OPENDAL_SWIFT_STORAGE_URL=${storage_url}" >> $GITHUB_ENV
echo
- name: Set environment variables
shell: bash
run: |
cat << EOF >> $GITHUB_ENV
OPENDAL_SWIFT_CONTAINER=testing
OPENDAL_SWIFT_ROOT=/
EOF

0 comments on commit fffb809

Please sign in to comment.