summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--provider_base/common.json6
-rw-r--r--puppet/modules/site_config/manifests/files.pp8
-rwxr-xr-xtests/platform-ci/ci-build.sh3
-rw-r--r--tests/platform-ci/provider/common.json10
-rwxr-xr-xtests/server-tests/helpers/soledad_sync.py26
5 files changed, 33 insertions, 20 deletions
diff --git a/provider_base/common.json b/provider_base/common.json
index c6ab18d5..666fe923 100644
--- a/provider_base/common.json
+++ b/provider_base/common.json
@@ -71,11 +71,11 @@
"nickserver": {
"type": "git",
"source": "https://leap.se/git/nickserver",
- "revision": "origin/version/0.9"
+ "revision": "origin/master"
},
"platform": {
"apt": {
- "basic": "= 'http://deb.leap.se/' + Leap::Platform.major_version"
+ "basic": "http://deb.leap.se/experimental-platform"
}
},
"soledad": {
@@ -86,7 +86,7 @@
"webapp": {
"type": "git",
"source": "https://leap.se/git/leap_web",
- "revision": "origin/version/0.9"
+ "revision": "origin/master"
}
}
}
diff --git a/puppet/modules/site_config/manifests/files.pp b/puppet/modules/site_config/manifests/files.pp
index d2ef8a98..e74ad567 100644
--- a/puppet/modules/site_config/manifests/files.pp
+++ b/puppet/modules/site_config/manifests/files.pp
@@ -3,10 +3,10 @@ class site_config::files {
file {
'/srv/leap':
- ensure => directory,
- owner => 'root',
- group => 'root',
- mode => '0711';
+ ensure => directory,
+ owner => 'root',
+ group => 'root',
+ mode => '0711';
[ '/etc/leap', '/var/lib/leap']:
ensure => directory,
diff --git a/tests/platform-ci/ci-build.sh b/tests/platform-ci/ci-build.sh
index 85557b3f..0dfbb5c3 100755
--- a/tests/platform-ci/ci-build.sh
+++ b/tests/platform-ci/ci-build.sh
@@ -43,8 +43,7 @@ NAME="citest${CI_BUILD_ID}"
TAG='single'
SERVICES='couchdb,soledad,mx,webapp,tor,monitor'
-SEEDS='sources.platform.apt.basic:http://deb.leap.se/experimental-0.9 sources.webapp.revision:master sources.nickserver.revision:master'
-
+SEEDS=''
#
# Main
diff --git a/tests/platform-ci/provider/common.json b/tests/platform-ci/provider/common.json
index a13f8f75..2c63c085 100644
--- a/tests/platform-ci/provider/common.json
+++ b/tests/platform-ci/provider/common.json
@@ -1,12 +1,2 @@
{
- "sources": {
- "platform": {
- "apt": {
- "basic": "http://deb.leap.se/experimental-0.9"
- }
- },
- "nickserver": {
- "revision": "develop"
- }
- }
}
diff --git a/tests/server-tests/helpers/soledad_sync.py b/tests/server-tests/helpers/soledad_sync.py
index f4fc81ae..a92ec68f 100755
--- a/tests/server-tests/helpers/soledad_sync.py
+++ b/tests/server-tests/helpers/soledad_sync.py
@@ -27,6 +27,7 @@ os.environ['SKIP_TWISTED_SSL_CHECK'] = '1'
from twisted.internet import defer, reactor
from twisted.python import log
+from twisted.python.lockfile import FilesystemLock
from client_side_db import get_soledad_instance
from leap.common.events import flags
@@ -35,6 +36,7 @@ flags.set_events_enabled(False)
NUMDOCS = 1
USAGE = "Usage: %s uuid token server cert_file password" % sys.argv[0]
+SYNC_TIMEOUT = 60
def bail(msg, exitcode):
@@ -42,6 +44,13 @@ def bail(msg, exitcode):
sys.exit(exitcode)
+def obtain_lock():
+ scriptname = os.path.basename(__file__)
+ lockfile = os.path.join(tempfile.gettempdir(), scriptname + '.lock')
+ lock = FilesystemLock(lockfile)
+ return lock.lock()
+
+
def create_docs(soledad):
"""
Populates the soledad database with dummy messages, so we can exercise
@@ -64,16 +73,30 @@ if __name__ == '__main__':
if len(sys.argv) < 6:
bail(USAGE, 2)
+ if not obtain_lock():
+ bail("another instance is already running", 1)
+
uuid, token, server, cert_file, passphrase = sys.argv[1:]
s = get_soledad_instance(
uuid, passphrase, tempdir, server, cert_file, token)
+ def syncWithTimeout(_):
+ d = s.sync()
+ reactor.callLater(SYNC_TIMEOUT, d.cancel)
+ return d
+
def onSyncDone(sync_result):
print "SYNC_RESULT:", sync_result
s.close()
rm_tempdir()
reactor.stop()
+ def trap_cancel(f):
+ f.trap(defer.CancelledError)
+ log.err("sync timed out after %s seconds" % SYNC_TIMEOUT)
+ rm_tempdir()
+ reactor.stop()
+
def log_and_exit(f):
log.err(f)
rm_tempdir()
@@ -81,8 +104,9 @@ if __name__ == '__main__':
def start_sync():
d = create_docs(s)
- d.addCallback(lambda _: s.sync())
+ d.addCallback(syncWithTimeout)
d.addCallback(onSyncDone)
+ d.addErrback(trap_cancel)
d.addErrback(log_and_exit)
reactor.callWhenRunning(start_sync)