From c018d3af9d543140ed3a6d49df650bee26c6dcfd Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 18 Jun 2020 14:27:53 +0300 Subject: Adapt to using env testscript builtin --- tests/client.testscript | 12 ++++++------ 1 file 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 } -- cgit v1.1