]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Tidy and fix up redis clust_node_fail test
authorNick Porter <nick@portercomputing.co.uk>
Tue, 31 Jan 2023 17:02:13 +0000 (17:02 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 1 Feb 2023 18:43:06 +0000 (18:43 +0000)
src/tests/modules/redis/cluster_node_fail.unlang

index 1d8b0b2e9811fe388ff98383ad23eac2d5ad6035..c54d338afdb50db49fa3e8701c58a968dbb667e1 100644 (file)
@@ -4,9 +4,7 @@
 $INCLUDE cluster_reset.inc
 
 #  Hashes to Redis cluster node master 1
-if ("%(redis:SET b 'boom')" == 'OK') {
-       test_pass
-} else {
+if (!("%(redis:SET b 'boom')" == 'OK')) {
        test_fail
 }
 
@@ -16,35 +14,25 @@ if ("%(redis:SET b 'boom')" == 'OK') {
 #  Cause one of the redis cluster nodes to SEGV
 if ("%(redis:@%(redis_node:b 0) DEBUG SEGFAULT)" != '') {
        test_fail
-} else {
-       test_pass
 }
 
 #  Forcefully failover the slave for that node
-if ("%(redis:@%(redis_node:b 1) CLUSTER FAILOVER TAKEOVER)" != 'OK') {
+if (!("%(redis:@%(redis_node:b 1) CLUSTER FAILOVER TAKEOVER)" == 'OK')) {
        test_fail
-} else {
-       test_pass
 }
 
-if ("%(redis:GET b)" == 'boom') {
-       test_pass
-} else {
+if (!("%(redis:GET b)" == 'boom')) {
        test_fail
 }
 
 #  Kill that one too
 if ("%(redis:@%(redis_node:b) DEBUG SEGFAULT)" != '') {
        test_fail
-} else {
-       test_pass
 }
 
 # No alternatives...
-if ("%(redis:GET b)" != 'boom') {
-       test_pass
-} else {
+if ("%(redis:GET b)" == 'boom') {
        test_fail
 }
 
-
+test_pass