Skip to content
Snippets Groups Projects
Verified Commit a453c43d authored by Wiktor Kwapisiewicz's avatar Wiktor Kwapisiewicz
Browse files

Fix: Make integration tests more robust

This patch introduces a commented-out section which waits for the
NetHSM device to be operational before continuing. This makes the
venerable `sleep 2` call unnecessary and uses a more granular `sleep
1` call instead.

Fixes: #23


Signed-off-by: default avatarWiktor Kwapisiewicz <wiktor@metacode.biz>
parent d0600aea
No related branches found
No related tags found
1 merge request!31Fix: Make integration tests more robust
......@@ -146,7 +146,6 @@ test-readme project:
start_container() {
podman container start "$container_id" > /dev/null
sleep 2
}
stop_container() {
......
......@@ -60,6 +60,27 @@ printf 'my-very-unsafe-admin-passphrase' > "$NETHSM_PASSPHRASE_FILE"
nethsm env add credentials admin Administrator
```
<!--
```bash
set +x
counter=0
while ! nethsm health state; do
printf "NetHSM is not ready, waiting (try %d)...\n" "$counter"
sleep 1
counter=$(( counter + 1 ))
if (( counter > 30 )); then
printf "NetHSM is not up even after 30 tries. Aborting."
set -x
exit 2
fi
done
printf "NetHSM is ready for provisioning after %d seconds.\n" "$counter"
set -x
```
-->
### Provisioning
Before using a device for the first time, it must be provisioned.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment