summaryrefslogtreecommitdiff
path: root/scripts/docker/files/bin
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2016-11-17 10:12:38 -0200
committerdrebs <drebs@leap.se>2016-11-17 10:12:38 -0200
commit3183e473748390927ea466ce72277465b28b4430 (patch)
treeca0f58801653801c5cb30f27b0404377d42fa72a /scripts/docker/files/bin
parentd77c3868bd02bbd59965498d6d1a0b59f0512338 (diff)
parent0fd7e9f018b02161a844c11332ffced56b256010 (diff)
Merge tag '0.9.0' into debian/platform-0.9
Tag version 0.9.0
Diffstat (limited to 'scripts/docker/files/bin')
-rwxr-xr-xscripts/docker/files/bin/run-perf.sh22
-rwxr-xr-xscripts/docker/files/bin/run-tox.sh17
-rwxr-xr-xscripts/docker/files/bin/setup-test-env.py16
3 files changed, 50 insertions, 5 deletions
diff --git a/scripts/docker/files/bin/run-perf.sh b/scripts/docker/files/bin/run-perf.sh
new file mode 100755
index 00000000..72060230
--- /dev/null
+++ b/scripts/docker/files/bin/run-perf.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+REPO=/builds/leap/soledad/testing
+COUCH_URL="${COUCH_URL:-http://127.0.0.1:5984}"
+SOLEDAD_PRELOAD_NUM="${SOLEDAD_PRELOAD_NUM:-100}"
+
+if [ ! -z "${SOLEDAD_REMOTE}" ]; then
+ git -C ${REPO} remote set-url origin ${SOLEDAD_REMOTE}
+ git -C ${REPO} fetch origin
+fi
+
+if [ ! -z "${SOLEDAD_BRANCH}" ]; then
+ git -C ${REPO} checkout ${SOLEDAD_BRANCH}
+fi
+
+cd ${REPO}
+
+tox perf -- \
+ --durations 0 \
+ --couch-url ${COUCH_URL} \
+ --twisted \
+ --num-docs ${SOLEDAD_PRELOAD_NUM}
diff --git a/scripts/docker/files/bin/run-tox.sh b/scripts/docker/files/bin/run-tox.sh
new file mode 100755
index 00000000..74fde182
--- /dev/null
+++ b/scripts/docker/files/bin/run-tox.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+REPO=/builds/leap/soledad/testing
+COUCH_URL="${COUCH_URL:-http://127.0.0.1:5984}"
+
+if [ ! -z "${SOLEDAD_REMOTE}" ]; then
+ git -C ${REPO} remote set-url origin ${SOLEDAD_REMOTE}
+ git -C ${REPO} fetch origin
+fi
+
+if [ ! -z "${SOLEDAD_BRANCH}" ]; then
+ git -C ${REPO} checkout ${SOLEDAD_BRANCH}
+fi
+
+cd ${REPO}
+
+tox -- --couch-url ${COUCH_URL}
diff --git a/scripts/docker/files/bin/setup-test-env.py b/scripts/docker/files/bin/setup-test-env.py
index 0f3ea6f4..4868fd56 100755
--- a/scripts/docker/files/bin/setup-test-env.py
+++ b/scripts/docker/files/bin/setup-test-env.py
@@ -194,12 +194,12 @@ def user_db_create(args):
url = 'http://localhost:%d/user-%s' % (args.port, args.uuid)
try:
CouchDatabase.open_database(
- url=url, create=False, replica_uid=None, ensure_ddocs=True)
+ url=url, create=False, replica_uid=None)
print '[*] error: database "user-%s" already exists' % args.uuid
exit(1)
except DatabaseDoesNotExist:
CouchDatabase.open_database(
- url=url, create=True, replica_uid=None, ensure_ddocs=True)
+ url=url, create=True, replica_uid=None)
print '[+] database created: user-%s' % args.uuid
@@ -372,7 +372,10 @@ CERT_CONFIG_FILE = os.path.join(
def cert_create(args):
private_key = os.path.join(args.basedir, args.private_key)
cert_key = os.path.join(args.basedir, args.cert_key)
- os.mkdir(args.basedir)
+ try:
+ os.mkdir(args.basedir)
+ except OSError:
+ pass
call([
'openssl',
'req',
@@ -389,8 +392,11 @@ def cert_create(args):
def cert_delete(args):
private_key = os.path.join(args.basedir, args.private_key)
cert_key = os.path.join(args.basedir, args.cert_key)
- os.unlink(private_key)
- os.unlink(cert_key)
+ try:
+ os.unlink(private_key)
+ os.unlink(cert_key)
+ except OSError:
+ pass
#