summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGraeme Fowler <graemef@exim.org>2018-03-06 15:38:31 +0000
committerGraeme Fowler <graemef@exim.org>2018-03-06 15:38:31 +0000
commite369af6cf2409f820337a7d7ffbbfe90d5ad0efb (patch)
tree4933e3cd647c0468b6f06a70633a069ae7aa3a2c /test
parent3bbf85f29be41a56c82ff8b435289c40e40f7afa (diff)
Test suite case for redis cluster MOVED response
Diffstat (limited to 'test')
-rw-r--r--test/confs/270111
-rw-r--r--test/scripts/2701-redis-cluster/270145
-rw-r--r--test/scripts/2701-redis-cluster/REQUIRES2
-rw-r--r--test/stdout/27017
4 files changed, 65 insertions, 0 deletions
diff --git a/test/confs/2701 b/test/confs/2701
new file mode 100644
index 000000000..2c06c03f8
--- /dev/null
+++ b/test/confs/2701
@@ -0,0 +1,11 @@
+# Exim test configuration 2701
+
+.include DIR/aux-var/std_conf_prefix
+
+primary_hostname = myhost.test.ex
+
+# ----- Main settings -----
+
+redis_servers = 127.0.0.1::6379// : 127.0.0.1::6380//
+
+# End
diff --git a/test/scripts/2701-redis-cluster/2701 b/test/scripts/2701-redis-cluster/2701
new file mode 100644
index 000000000..821d2c39e
--- /dev/null
+++ b/test/scripts/2701-redis-cluster/2701
@@ -0,0 +1,45 @@
+# Redis lookups and quoting in cluster mode
+#
+#
+echo Setting up 2-node cluster...
+sudo rm -fr DIR/node1 DIR/node2
+mkdir -p DIR/node1 DIR/node2
+#
+echo Starting node1
+background
+redis-server --bind 127.0.0.1 --port 6379 --cluster-enabled yes --cluster-config-file node1.conf --dir DIR/node1 --logfile /dev/null
+****
+sleep 5
+echo Starting node2
+background
+redis-server --bind 127.0.0.1 --port 6380 --cluster-enabled yes --cluster-config-file node2.conf --dir DIR/node2 --logfile /dev/null
+****
+#
+sleep 5
+echo Creating slots, node1
+perl
+system 'for x in {0..8191}; do echo "CLUSTER ADDSLOTS $x" | redis-cli -p 6379 | egrep -v OK; done';
+****
+sleep 5
+echo Creating slots, node2
+perl
+system 'for x in {8192..16383}; do echo "CLUSTER ADDSLOTS $x" | redis-cli -p 6380 | egrep -v OK; done';
+****
+sleep 5
+echo Sending CLUSTER MEET
+perl
+system 'echo "CLUSTER MEET 127.0.0.1 6380" | redis-cli -p 6379 -c';
+****
+sleep 5
+exim -be -d-all+expand+lookup
+${lookup redis{set ${quote_redis:KEY_100_1001 ABCDEF} ${quote_redis:objvalue plus}}}
+${lookup redis{set ${quote_redis:01t67it} ${quote_redis:bfhdkbflks}}}
+****
+sleep 2
+exim -be -d-all+expand+lookup
+${lookup redis{get ${quote_redis:KEY_100_1001 ABCDEF}}}
+${lookup redis{get ${quote_redis:01t67it}}}
+****
+#
+killdaemon
+no_stderr_check
diff --git a/test/scripts/2701-redis-cluster/REQUIRES b/test/scripts/2701-redis-cluster/REQUIRES
new file mode 100644
index 000000000..55fbcfdcc
--- /dev/null
+++ b/test/scripts/2701-redis-cluster/REQUIRES
@@ -0,0 +1,2 @@
+lookup redis
+running redis
diff --git a/test/stdout/2701 b/test/stdout/2701
new file mode 100644
index 000000000..67555c52a
--- /dev/null
+++ b/test/stdout/2701
@@ -0,0 +1,7 @@
+OK
+> OK
+> OK
+>
+> objvalue plus
+> bfhdkbflks
+>