From 40e652469140d7c69758c4bd42afb961b50ae093 Mon Sep 17 00:00:00 2001 From: Barry McCormick Date: Tue, 17 Oct 2023 14:29:44 -0700 Subject: [PATCH] test of nginx poud try 1 (#11) Co-authored-by: Barry McCormick --- www/nginx-poudriere/test.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 www/nginx-poudriere/test.sh diff --git a/www/nginx-poudriere/test.sh b/www/nginx-poudriere/test.sh new file mode 100644 index 0000000..e87a050 --- /dev/null +++ b/www/nginx-poudriere/test.sh @@ -0,0 +1,28 @@ +echo "starting test script" +cd ../../ +pwd +bastille template testrun www/nginx +echo "template applied" +bastille cmd testrun service nginx status +bastille rdr testrun tcp 80 80 +bastille rdr testrun list +ifconfig +response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:80) +echo "tested response" +echo "response is:" $response + +service_name="nginx" +jail_name="testrun" + +service_status=$(jexec testrun service $service_name status) + +# Check the service status and provide appropriate output +if echo "$service_status" | grep -q "is running"; then + echo "$service_name is running in jail $jail_name." +else + echo "$service_name is not running in jail $jail_name." + exit 1 +fi + + +