summaryrefslogtreecommitdiff
path: root/tests/functional/features/steps/bitmask.py
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2017-07-20 13:46:01 +0200
committerAzul <azul@riseup.net>2017-07-20 13:46:01 +0200
commiteecf6ad13801b63c6b7664d8a2e98e905262aaa0 (patch)
treefadf7d8270106a628c31b1f7017f343a94f311f0 /tests/functional/features/steps/bitmask.py
parentc81b98df15e3d2006c991c9ca9d86500e3599e9b (diff)
parentd6abd906cb64ae68eed3348eba521bc44ebed7b2 (diff)
Merge branch 'functional_tests'
Diffstat (limited to 'tests/functional/features/steps/bitmask.py')
-rw-r--r--tests/functional/features/steps/bitmask.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/functional/features/steps/bitmask.py b/tests/functional/features/steps/bitmask.py
new file mode 100644
index 0000000..b5b4cf1
--- /dev/null
+++ b/tests/functional/features/steps/bitmask.py
@@ -0,0 +1,26 @@
+import commands
+import shutil
+import os
+import time
+from leap.common.config import get_path_prefix
+
+from behave import given
+
+
+@given('I start bitmask for the first time')
+def initial_run(context):
+ commands.getoutput('bitmaskctl stop')
+ # TODO: fix bitmaskctl to only exit once bitmaskd has stopped
+ time.sleep(2)
+ _initialize_home_path()
+ commands.getoutput('bitmaskctl start')
+ tokenpath = os.path.join(get_path_prefix(), 'leap', 'authtoken')
+ token = open(tokenpath).read().strip()
+ context.login_url = "http://localhost:7070/#%s" % token
+
+
+def _initialize_home_path():
+ home_path = '/tmp/bitmask-test'
+ shutil.rmtree(home_path, ignore_errors=True)
+ os.environ['HOME'] = home_path
+ os.makedirs(get_path_prefix())