]> git.proxmox.com Git - ceph.git/blame - ceph/qa/workunits/rgw/run-s3tests.sh
update sources to v12.1.0
[ceph.git] / ceph / qa / workunits / rgw / run-s3tests.sh
CommitLineData
7c673cae
FG
1#!/bin/bash -ex
2
3# run s3-tests from current directory. assume working
4# ceph environment (radosgw-admin in path) and rgw on localhost:8000
5# (the vstart default).
6
7branch=$1
8[ -z "$1" ] && branch=master
9port=$2
10[ -z "$2" ] && port=8000 # this is vstart's default
11
12##
13
31f18b77
FG
14if [ -e CMakeCache.txt ]; then
15 BIN_PATH=$PWD/bin
16elif [ -e $root_path/../build/CMakeCache.txt ]; then
17 cd $root_path/../build
18 BIN_PATH=$PWD/bin
19fi
20PATH=$PATH:$BIN_PATH
21
7c673cae
FG
22dir=tmp.s3-tests.$$
23
24# clone and bootstrap
25mkdir $dir
26cd $dir
27git clone https://github.com/ceph/s3-tests
28cd s3-tests
29git checkout ceph-$branch
31f18b77 30VIRTUALENV_PYTHON=/usr/bin/python2 ./bootstrap
7c673cae
FG
31cd ../..
32
33# users
34akey1=access1
35skey1=secret1
36radosgw-admin user create --uid=s3test1 --display-name='tester1' \
37 --access-key=$akey1 --secret=$skey1 --email=tester1@ceph.com
38
39akey2=access2
40skey2=secret2
41radosgw-admin user create --uid=s3test2 --display-name='tester2' \
31f18b77 42 --access-key=$akey2 --secret=$skey2 --email=tester2@ceph.com
7c673cae
FG
43
44cat <<EOF > s3.conf
45[DEFAULT]
46## replace with e.g. "localhost" to run against local software
47host = 127.0.0.1
48## uncomment the port to use something other than 80
49port = $port
50## say "no" to disable TLS
51is_secure = no
52[fixtures]
53## all the buckets created will start with this prefix;
54## {random} will be filled with random characters to pad
55## the prefix to 30 characters long, and avoid collisions
56bucket prefix = s3testbucket-{random}-
57[s3 main]
58## the tests assume two accounts are defined, "main" and "alt".
59## user_id is a 64-character hexstring
60user_id = s3test1
61## display name typically looks more like a unix login, "jdoe" etc
62display_name = tester1
63## replace these with your access keys
64access_key = $akey1
65secret_key = $skey1
66email = tester1@ceph.com
67[s3 alt]
68## another user account, used for ACL-related tests
69user_id = s3test2
70display_name = tester2
71## the "alt" user needs to have email set, too
72email = tester2@ceph.com
73access_key = $akey2
74secret_key = $skey2
75EOF
76
77S3TEST_CONF=`pwd`/s3.conf $dir/s3-tests/virtualenv/bin/nosetests -a '!fails_on_rgw' -v
78
79rm -rf $dir
80
81echo OK.
82