summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-03-04 16:27:33 +0200
committerLars Wirzenius <liw@liw.fi>2017-03-04 16:27:33 +0200
commit0be7a9d091d9728d1b90c012bbe21b7f5320425d (patch)
treee3f31aa0fbcaaefe63d5669132f2ec670a918dfe
parent2135942e49989c10c73464b1bdfdf490e8edd24a (diff)
downloadgit.liw.fi-ruleset-tests-0be7a9d091d9728d1b90c012bbe21b7f5320425d.tar.gz
Delete test users at the end
-rw-r--r--000.yarn23
-rw-r--r--lib.py1
-rw-r--r--yarnhelper.py5
3 files changed, 26 insertions, 3 deletions
diff --git a/000.yarn b/000.yarn
index 7f72fc9..290375c 100644
--- a/000.yarn
+++ b/000.yarn
@@ -201,8 +201,6 @@ groups, and respositories.
WHEN we run gitano whoami
THEN we are in group gitano-admin
-<!--
-
WHEN we create user ian
AND we create user olive
AND we create user steven
@@ -210,6 +208,8 @@ groups, and respositories.
AND we create user tina
AND we create user ci
+<!--
+
WHEN we create group qvarndevs
AND we create group qvarnguests
AND we create group ops
@@ -273,6 +273,12 @@ Use case: Steven updates internal wiki.
-->
+ FINALLY remove user ian
+ AND remove user olive
+ AND remove user steven
+ AND remove user gabriella
+ AND remove user tina
+ AND remove user ci
# Scenario step implementations
@@ -284,3 +290,16 @@ Use case: Steven updates internal wiki.
IMPLEMENTS THEN we are in group gitano-admin
whoami = helper.get_variable('admin_whoami')
helper.assertIn('gitano-admin', whoami)
+
+ IMPLEMENTS WHEN we create user (\S+)
+ username = helper.get_next_match()
+ helper.gitano('user add {} user@example.com Test User'.format(username))
+
+ IMPLEMENTS FINALLY remove user (\S+)
+ username = helper.get_next_match()
+ output = helper.gitano('user del {}'.format(username))
+ print output
+ last_line = output.splitlines()[-1]
+ token = last_line.split()[-1]
+ output = helper.gitano('user del {} {}'.format(username, token))
+ print output
diff --git a/lib.py b/lib.py
index fe39735..5ce05fa 100644
--- a/lib.py
+++ b/lib.py
@@ -1,4 +1,5 @@
import os
+import sys
import cliapp
diff --git a/yarnhelper.py b/yarnhelper.py
index 5b087be..18467ed 100644
--- a/yarnhelper.py
+++ b/yarnhelper.py
@@ -132,7 +132,10 @@ class YarnHelper(object):
def gitano(self, args): # pragma: no cover
server = os.environ['GITANO_SERVER']
- return cliapp.ssh_runcmd('git@{}'.format(server), [args])
+ return cliapp.ssh_runcmd(
+ 'git@{}'.format(server),
+ args.split(),
+ stderr=subprocess.STDOUT)
class Error(Exception):