qrgen: add script to check if qrgen deployment works
This commit is contained in:
28
verifier/qrverify.sh
Executable file
28
verifier/qrverify.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# EP should contain the hostname?
|
||||
# If passing it is impossible, maybe we should interrogate Ingress resource?
|
||||
#
|
||||
# uuidgen comes from util-linux, zbarimg from zbar
|
||||
|
||||
set -e
|
||||
|
||||
DATA=$(uuidgen)
|
||||
TMPFILE=$(mktemp --suffix .png)
|
||||
|
||||
echo "➡️ Checking ${EP} with data: ${DATA}"
|
||||
|
||||
curl --verbose "http://${EP}/render/?data=${DATA}" --output ${TMPFILE}
|
||||
|
||||
DECODED=$(zbarimg --quiet ${TMPFILE})
|
||||
|
||||
if [ "QR-Code:${DATA}" != "${DECODED}" ]; then
|
||||
echo "❌ Error, got ${DECODED}"
|
||||
exit 1
|
||||
else
|
||||
echo "✅ OK!"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user