Add test harness to execute s3-tests

Also add Travis configuration.
pull/36/head
Andrew Gaul 2015-01-22 16:25:49 -08:00
rodzic 4d00e47023
commit 074c36baab
3 zmienionych plików z 85 dodań i 0 usunięć

Wyświetl plik

@ -1 +1,5 @@
language: java
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq python-pip python-virtualenv libevent-dev
after_script: src/test/resources/run-s3-tests.sh

Wyświetl plik

@ -0,0 +1,41 @@
#!/bin/bash
set -o errexit
set -o nounset
S3PROXY_BIN="${PWD}/target/s3proxy"
S3PROXY_PORT="8081"
export S3TEST_CONF="${PWD}/src/test/resources/s3-tests.conf"
# configure s3-tests
pushd s3-tests
./bootstrap
popd
# launch S3Proxy using HTTP and a fixed port
sed "s,^\(s3proxy.endpoint\)=.*,\1=http://127.0.0.1:${S3PROXY_PORT}," \
< src/test/resources/s3proxy.conf > target/s3proxy.conf
$S3PROXY_BIN --properties target/s3proxy.conf &
S3PROXY_PID=$!
# wait for S3Proxy to start
for i in $(seq 30);
do
if exec 3<>"/dev/tcp/localhost/${S3PROXY_PORT}";
then
exec 3<&- # Close for read
exec 3>&- # Close for write
break
fi
sleep 1
done
# execute s3-tests
pushd s3-tests
./virtualenv/bin/nosetests -a '!fails_on_s3proxy'
EXIT_CODE=$?
popd
# clean up and return s3-tests exit code
kill $S3PROXY_PID
exit $EXIT_CODE

Wyświetl plik

@ -0,0 +1,40 @@
[DEFAULT]
## this section is just used as default for all the "s3 *"
## sections, you can place these variables also directly there
## replace with e.g. "localhost" to run against local software
host = 127.0.0.1
## uncomment the port to use something other than 80
port = 8081
## say "no" to disable TLS
is_secure = no
[fixtures]
## all the buckets created will start with this prefix;
## {random} will be filled with random characters to pad
## the prefix to 30 characters long, and avoid collisions
bucket prefix = s3proxy-{random}-
[s3 main]
## the tests assume two accounts are defined, "main" and "alt".
## user_id is a 64-character hexstring
user_id = 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
## display name typically looks more like a unix login, "jdoe" etc
display_name = youruseridhere
## replace these with your access keys
access_key = local-identity
secret_key = local-credential
[s3 alt]
## another user account, used for ACL-related tests
user_id = 56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234
display_name = john.doe
## the "alt" user needs to have email set, too
email = john.doe@example.com
access_key = local-identity
secret_key = local-credential