summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2016-12-18 14:46:30 +0000
committerRichard Maw <richard.maw@gmail.com>2016-12-18 15:28:17 +0000
commitdacd657430f4b8107d97e52c9c32694fa548feb1 (patch)
tree6db6ae2738ba296888430b947951172da1f3c7de /testing
parent38cd3098959d12bb484dd4de4ff6817365140f33 (diff)
downloadgitano-dacd657430f4b8107d97e52c9c32694fa548feb1.tar.gz
testing: Split out current ssh key test
This was disabled because when accessing Gitano over HTTP there is no current key to display or prevent you from deleting. By splitting it out we can add an ASSUMING to conditionally activate it.
Diffstat (limited to 'testing')
-rw-r--r--testing/02-commands-sshkey.yarn37
-rw-r--r--testing/library.yarn3
2 files changed, 21 insertions, 19 deletions
diff --git a/testing/02-commands-sshkey.yarn b/testing/02-commands-sshkey.yarn
index 5b02bb0..028a32f 100644
--- a/testing/02-commands-sshkey.yarn
+++ b/testing/02-commands-sshkey.yarn
@@ -34,34 +34,33 @@ Verify the new keys are listed for the user.
THEN the output contains newkey
AND the output contains test-key_
-Now that we have multiple keys assigned to a user
-it is necessary for gitano to be able to tell us which key is being used.
+We can delete the old key and proceed with the new key in future.
+
+ WHEN testinstance newkey runs sshkey del adminkey
+ THEN the output contains SSH authorised key file updated
-<!--
-TODO: This section of the scenario only works in SSH mode
-This is done in the `whoami` and `sshkey list` commands
-by appending "[*]" to the entry for the key that is in use.
+When we interact with gitano through ssh it tracks which key was used,
+which is convenient when a user has multiple keys
+and it matters which key is being used.
+
+ SCENARIO gitano key awareness
+ ASSUMING gitano is being accessed over ssh
+ GIVEN a standard instance
+
+When using the `whoami` and `sshkey list` commands
+gitano appends "[*]" to the entry for the key that is in use.
WHEN testinstance adminkey runs sshkey list
THEN the output contains adminkey.*\[\*\]$
- WHEN testinstance newkey runs sshkey list
- THEN the output contains newkey.*\[\*\]$
-This new key can be used for everything the old key can,
-except for removing the new key,
-since it is not possible to remove the key that is being used to authenticate
+This is not just informational. Gitano uses this information
+to prevent you removing the key that is being used to authenticate
as a protection against accidentally locking yourself out.
WHEN testinstance adminkey, expecting failure, runs sshkey del adminkey
THEN stderr contains is in use
- WHEN testinstance newkey, expecting failure, runs sshkey del newkey
- THEN stderr contains is in use
-
--->
-
-We can delete the old key and proceed with the new key in future.
- WHEN testinstance newkey runs sshkey del adminkey
- THEN the output contains SSH authorised key file updated
+If it is necessary to remove a key,
+then a new key must be added first and the delete must be issued with that key.
diff --git a/testing/library.yarn b/testing/library.yarn
index 9f3160c..6e0b1c9 100644
--- a/testing/library.yarn
+++ b/testing/library.yarn
@@ -208,6 +208,9 @@ Generic utility methods
cat last-program
/bin/false
+ IMPLEMENTS ASSUMING gitano is being accessed over ([^ ]+)
+ test "$GTT_PROTO" = "$MATCH_1"
+
GPG Keyring related helpers
---------------------------