From 0514978eeed0e4db41fe13b3352ab55ccf299ef1 Mon Sep 17 00:00:00 2001 From: drebs Date: Fri, 22 Jul 2016 20:14:26 +0200 Subject: [test] fail gracefully on cert delete --- scripts/docker/files/bin/setup-test-env.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts/docker/files') diff --git a/scripts/docker/files/bin/setup-test-env.py b/scripts/docker/files/bin/setup-test-env.py index 0f3ea6f4..c0487e8f 100755 --- a/scripts/docker/files/bin/setup-test-env.py +++ b/scripts/docker/files/bin/setup-test-env.py @@ -389,8 +389,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 # -- cgit v1.2.3 From 23fe0be50c7c9408eab47e8286e19b16a77f66ad Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 25 Jul 2016 08:06:39 -0300 Subject: [test] remove ddocs param from docker setup script --- scripts/docker/files/bin/setup-test-env.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts/docker/files') diff --git a/scripts/docker/files/bin/setup-test-env.py b/scripts/docker/files/bin/setup-test-env.py index c0487e8f..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', -- cgit v1.2.3 From 8d08016b6e5985569ca5d04ef3e2690e78809f54 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 25 Jul 2016 11:38:19 -0300 Subject: [test] use tox and couchdb image to run tests --- scripts/docker/files/bin/run-tox.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/docker/files/bin/run-tox.sh (limited to 'scripts/docker/files') diff --git a/scripts/docker/files/bin/run-tox.sh b/scripts/docker/files/bin/run-tox.sh new file mode 100755 index 00000000..793ce6e1 --- /dev/null +++ b/scripts/docker/files/bin/run-tox.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +REPO=/builds/leap/soledad/testing + +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 -- -v --durations 0 --couch-url http://couchdb:5984) -- cgit v1.2.3 From 76acb8f39a32b6b61f00af571bae9bd48c0a5d62 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 25 Jul 2016 21:51:45 -0300 Subject: [test] use random name for couchdb container in docker perf test --- scripts/docker/files/bin/run-perf.sh | 20 ++++++++++++++++++++ scripts/docker/files/bin/run-tox.sh | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 scripts/docker/files/bin/run-perf.sh (limited to 'scripts/docker/files') diff --git a/scripts/docker/files/bin/run-perf.sh b/scripts/docker/files/bin/run-perf.sh new file mode 100755 index 00000000..35c7f006 --- /dev/null +++ b/scripts/docker/files/bin/run-perf.sh @@ -0,0 +1,20 @@ +#!/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 perf -- \ + --durations 0 \ + --couch-url ${COUCH_URL} \ + --twisted diff --git a/scripts/docker/files/bin/run-tox.sh b/scripts/docker/files/bin/run-tox.sh index 793ce6e1..74fde182 100755 --- a/scripts/docker/files/bin/run-tox.sh +++ b/scripts/docker/files/bin/run-tox.sh @@ -1,6 +1,7 @@ #!/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} @@ -11,4 +12,6 @@ if [ ! -z "${SOLEDAD_BRANCH}" ]; then git -C ${REPO} checkout ${SOLEDAD_BRANCH} fi -(cd ${REPO}; tox -- -v --durations 0 --couch-url http://couchdb:5984) +cd ${REPO} + +tox -- --couch-url ${COUCH_URL} -- cgit v1.2.3 From de5cd462cc3f04275e22d9267ecb8e6c2b23dfda Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 25 Jul 2016 21:34:23 -0300 Subject: [test] allow passing number of docs on command line on perf tests --- scripts/docker/files/bin/run-perf.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/docker/files') diff --git a/scripts/docker/files/bin/run-perf.sh b/scripts/docker/files/bin/run-perf.sh index 35c7f006..72060230 100755 --- a/scripts/docker/files/bin/run-perf.sh +++ b/scripts/docker/files/bin/run-perf.sh @@ -2,6 +2,7 @@ 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} @@ -17,4 +18,5 @@ cd ${REPO} tox perf -- \ --durations 0 \ --couch-url ${COUCH_URL} \ - --twisted + --twisted \ + --num-docs ${SOLEDAD_PRELOAD_NUM} -- cgit v1.2.3