aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-06-18 14:27:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-06-18 14:27:53 +0300
commitc018d3af9d543140ed3a6d49df650bee26c6dcfd (patch)
treefbe7cf3d9119f36e9bfd8bab180cba6876b69e21
parente6652c755f3db6ad9472a57f2fbc9b7b4f31b521 (diff)
Adapt to using env testscript builtin
-rw-r--r--tests/client.testscript12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/client.testscript b/tests/client.testscript
index 97872ad..10470d4 100644
--- a/tests/client.testscript
+++ b/tests/client.testscript
@@ -12,7 +12,7 @@ test.arguments += rsautl -sign -keyform engine -engine pkcs11
: no-sock
:
- env --unset=OPENSSL_AGENT_PKCS11_SOCK - $* -inkey 'pkcs11:' 2>>EOE != 0
+ env --unset=OPENSSL_AGENT_PKCS11_SOCK -- $* -inkey 'pkcs11:' 2>>EOE != 0
error: OPENSSL_AGENT_PKCS11_SOCK environment variable is not set
EOE
}
@@ -32,19 +32,19 @@ test.arguments += rsautl -sign -keyform engine -engine pkcs11
+sed -n -e 's/^OPENSSL_AGENT_PKCS11_PID=(.+);.+$/\1/p' <"$script" | set pid
+sed -n -e 's/^OPENSSL_AGENT_PKCS11_SOCK=(.+);.+;$/\1/p' <"$script" | set sock
- sign = env - OPENSSL_AGENT_PKCS11_SOCK="$sock" $*
+ vars = OPENSSL_AGENT_PKCS11_SOCK="$sock"
: sign
:
{
- $sign --simulate success -inkey 'pkcs11:' >'signature' : simulate-opt
- $sign -inkey 'pkcs11:' >'signature' : no-simulate-opt
+ env $vars -- $* --simulate success -inkey 'pkcs11:' >'signature' : simulate-opt
+ env $vars -- $* -inkey 'pkcs11:' >'signature' : no-simulate-opt
}
: failure
:
{
- $sign --simulate failure -inkey 'pkcs11:' 2>>EOE != 0
+ env $vars -- $* --simulate failure -inkey 'pkcs11:' 2>>EOE != 0
error: unable to sign using simulated private key
EOE
}
@@ -52,7 +52,7 @@ test.arguments += rsautl -sign -keyform engine -engine pkcs11
: wrong-key
:
{
- $sign --simulate success -inkey 'pkcs11:object=key' 2>>EOE != 0
+ env $vars -- $* --simulate success -inkey 'pkcs11:object=key' 2>>EOE != 0
error: private key doesn't match
EOE
}