Files
labca/patches/entrypoint.patch
2023-06-13 18:46:42 +02:00

30 lines
1.1 KiB
Diff

diff --git a/test/entrypoint.sh b/test/entrypoint.sh
index 5ca9929..f18e1d8 100755
--- a/test/entrypoint.sh
+++ b/test/entrypoint.sh
@@ -13,12 +13,21 @@
# make sure we can reach the mysqldb.
./test/wait-for-it.sh boulder-mysql 3306
-# make sure we can reach the proxysql.
-./test/wait-for-it.sh bproxysql 6032
-
# create the database
MYSQL_CONTAINER=1 $DIR/create_db.sh
+fl=$(pwd)/labca/setup_complete
+while [ ! -f $fl ]; do
+ echo "Waiting for $fl to appear..."
+ sleep 30
+done
+
+#softhsm2-util --show-slots
+softhsm2-util --init-token --slot 0 --label "intermediate signing key (rsa)" --pin 1234 --so-pin 5678 | /bin/true
+[ -e labca/test-ca.p8 ] && softhsm2-util --import labca/test-ca.p8 --id 333333 --force --token "intermediate signing key (rsa)" --pin 1234 --so-pin 5678 --label 'intermediate_key'
+softhsm2-util --init-token --slot 1 --label "root signing key (rsa)" --pin 1234 --so-pin 5678 | /bin/true
+[ -e labca/test-root.p8 ] && softhsm2-util --import labca/test-root.p8 --id 777777 --force --token "root signing key (rsa)" --pin 1234 --so-pin 5678 --label 'root_key'
+
if [[ $# -eq 0 ]]; then
exec python3 ./start.py
fi