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