Allow multiple services creation

Adding an option to create multiple services in one go.
Adding tests (present/absent/without_skip_host_check)

Copied from PR #1054

Signed-off-by: Denis Karpelevich <dkarpele@redhat.com>
This commit is contained in:
Denis Karpelevich
2023-03-03 22:01:57 +01:00
committed by Thomas Woerner
parent 180afd7586
commit 0d9873b81c
9 changed files with 555 additions and 56 deletions

25
tests/service/services.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash -eu
NUM=${1-1000}
FILE="services.json"
echo "{" > "$FILE"
echo " \"service_list\": [" >> "$FILE"
for i in $(seq 1 "$NUM"); do
{
echo " {"
echo " \"name\": \"HTTP/www.example$i.com\","
echo " \"principal\": \"host/test.example$i.com\""
} >> "$FILE"
if [ "$i" -lt "$NUM" ]; then
echo " }," >> "$FILE"
else
echo " }" >> "$FILE"
fi
done
echo " ]" >> "$FILE"
echo "}" >> "$FILE"