aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests b/tests
index 0e7e1e7..f01c70b 100755
--- a/tests
+++ b/tests
@@ -22,6 +22,11 @@
oneTimeSetUp () {
set -e
+ # openssh tools require an at least existing $HOME and
+ # are probably sensitive to it, create an empty one
+ mkdir "${SHUNIT_TMPDIR}/home"
+ export HOME="${SHUNIT_TMPDIR}/home"
+
# prepare keys
( cd "$SHUNIT_TMPDIR"; ssh-keygen -q -t ed25519 -N '' -C key0 -f key0 )
( cd "$SHUNIT_TMPDIR"; ssh-keygen -q -t ed25519 -N '' -C key1 -f key1 )
@@ -38,7 +43,7 @@ oneTimeSetUp () {
}
oneTimeTearDown () {
- [ -z "$SSH_AGENT_PID" ] || kill "$SSH_AGENT_PID"
+ [ -z "$SSH_AGENT_PID" ] || { kill "$SSH_AGENT_PID"; unset SSH_AGENT_PID; }
}
with_saf_in_tmp () {
@@ -97,7 +102,8 @@ test_confirmation () {
EOT
chmod +x "$SHUNIT_TMPDIR/sap"
assertTrue 'export SSH_ASKPASS="$SHUNIT_TMPDIR/sap"; sign_key_with_key_filtered key0 key1 --comment-confirmed key1'
- assertSame "Something behind the ssh-agent-filter requested use of the key named 'key1'." "$(head -n1 "$SHUNIT_TMPDIR/sap_out")"
+ assertSame "Something behind the ssh-agent-filter requested use of the key named 'key1'." "$(sed 1!d "$SHUNIT_TMPDIR/sap_out")"
+ assertSame "The request is for a certificate signature on key " "$(sed '2!d;s/AAAA.*$//' "$SHUNIT_TMPDIR/sap_out")"
}
. shunit2