aboutsummaryrefslogtreecommitdiff
path: root/tests/agent-pkcs11.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-12-22 15:01:13 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-12-22 15:01:13 +0300
commit089405dfcd3920f60aebc1f0ddd7980f91ff5d42 (patch)
tree884c255821ed88e98b109b11056f2cc8556504c6 /tests/agent-pkcs11.testscript
parentcd5c1c00e8edadb5f1cc2747014b71971902325f (diff)
Make testscript to wait longer for openssl agent terminatng
Diffstat (limited to 'tests/agent-pkcs11.testscript')
-rw-r--r--tests/agent-pkcs11.testscript18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/agent-pkcs11.testscript b/tests/agent-pkcs11.testscript
index de7ecf2..31a4d9f 100644
--- a/tests/agent-pkcs11.testscript
+++ b/tests/agent-pkcs11.testscript
@@ -39,10 +39,20 @@
echo Agent pid $pid
EOO
- kill -0 "$pid"; # Make sure the agent is running.
- kill "$pid"; # Signal the agent to terminate.
- sleep 2; # Wait a bit while the agent is terminating.
- kill -0 "$pid" 2>! != 0 # Make sure the agent is not running.
+ kill -0 "$pid"; # Make sure the agent is running.
+ kill "$pid"; # Signal the agent to terminate.
+ sleep 2; # Wait a bit while the agent is terminating.
+
+ # Make sure the agent is not running.
+ #
+ # Normally two seconds should be enough for the agent to terminate. It can
+ # probably take longer in some rear cases, but not being able to terminate
+ # in ten seconds most likely indicates an issue.
+ #
+ if kill -0 "$pid" 2>!
+ sleep 8
+ kill -0 "$pid" 2>! != 0
+ end
}
}