]> granicus.if.org Git - pgbouncer/commitdiff
Improve test script robustness
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 16 Aug 2018 19:10:47 +0000 (21:10 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 16 Aug 2018 19:10:47 +0000 (21:10 +0200)
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
test/test.sh

index 00316cb2ff6d84f67bfbb040a1b933bcabf6596f..e82133863eace72f248e26885f123194cb0c9465 100755 (executable)
@@ -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
 }
 
index 8e5537bbeca0c6ac14d830129bc0b48f3b8a5860..8d37296a0268e4c1ee87cad3b3180882500bca99 100755 (executable)
@@ -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
 }