-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.72 KB
/
test-s3api.yaml
File metadata and controls
65 lines (54 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
on:
workflow_call:
inputs:
cache-key:
default: ""
required: false
type: string
name: Test OpenStack Swift
jobs:
test-devstack-swift-s3api:
runs-on: ubuntu-latest
name: Test Devstack Swift Service
steps:
- uses: actions/checkout@v3
- name: Save Memory and Disk Usage Info
run: |
free -h > memory-usage
df -h > disk-usage
- id: devstack
name: Run Devstack Swift Action
uses: ./
with:
s3api: "true"
# the cache-key here is for test purposes only, omit this for everyday usage
cache-key: ${{ inputs.cache-key }}
- name: Print Memory and Disk Usage
run: |
echo "Memory usage before:"
cat memory-usage
echo "Memory usage after:"
free -h
echo "Disk usage before:"
cat disk-usage
echo "Disk usage after:"
df -h
- name: Import Openstack Credentials
run: echo "${{ steps.devstack.outputs.credentials }}" > credentials
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install AWS S3 Client
run: pip3 install boto3
- name: Openstack Object Storage S3 API Functionality Test
shell: python
run: |
import boto3
import configparser
config = configparser.ConfigParser()
config.read_file(open("credentials"))
s3 = boto3.client('s3', **config["default"])
s3.create_bucket(Bucket="test")
s3.put_object(Bucket="test", Key="greeting", Body=b"hello")
assert s3.get_object(Bucket="test", Key="greeting")["Body"].read() == b"hello"