From 06e89c029f8b44a5aca0d3f3a7c737ccf58f6f0a Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 16 Aug 2018 21:10:47 +0200 Subject: [PATCH] Improve test script robustness Consistently exit with an error if the OS is not supported by the firewall manipulation commands. Previously, it would in some cases print an error but not exit. --- test/conntest.sh | 4 ++-- test/test.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/conntest.sh b/test/conntest.sh index 00316cb..e821338 100755 --- a/test/conntest.sh +++ b/test/conntest.sh @@ -9,7 +9,7 @@ fw_drop_port() { echo "block drop out proto tcp from any to 127.0.0.1 port $1" \ | sudo pfctl -a pgbouncer -f -;; *) - echo "Unknown OS";; + echo "Unknown OS"; exit 1;; esac } fw_reject_port() { @@ -21,7 +21,7 @@ fw_reject_port() { echo "block return-rst out proto tcp from any to 127.0.0.1 port $1" \ | sudo pfctl -a pgbouncer -f -;; *) - echo "Unknown OS";; + echo "Unknown OS"; exit 1;; esac } diff --git a/test/test.sh b/test/test.sh index 8e5537b..8d37296 100755 --- a/test/test.sh +++ b/test/test.sh @@ -116,7 +116,7 @@ fw_drop_port() { echo "block drop out proto tcp from any to 127.0.0.1 port $1" \ | sudo pfctl -a pgbouncer -f -;; *) - echo "Unknown OS";; + echo "Unknown OS"; exit 1;; esac } fw_reject_port() { @@ -127,7 +127,7 @@ fw_reject_port() { echo "block return-rst out proto tcp from any to 127.0.0.1 port $1" \ | sudo pfctl -a pgbouncer -f -;; *) - echo "Unknown OS";; + echo "Unknown OS"; exit 1;; esac } -- 2.40.0