summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2013-12-19 23:52:54 -0800
committerdormando <dormando@rydia.net>2013-12-19 23:52:54 -0800
commit8d5c5d0c6a2b63054e46d75ccefb7318557ddd0c (patch)
tree6c63171d99c81beacf1645579a5dfe4c0cea6b1b
parenta2f5ca50a28cb2348ec39ee2b3c202b57ffc94f3 (diff)
downloadmemcached-8d5c5d0c6a2b63054e46d75ccefb7318557ddd0c.tar.gz
add tests for -F option
-rwxr-xr-xt/flush-all.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/flush-all.t b/t/flush-all.t
index b803bb7..4f14389 100755
--- a/t/flush-all.t
+++ b/t/flush-all.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More tests => 21;
+use Test::More tests => 25;
use FindBin qw($Bin);
use lib "$Bin/lib";
use MemcachedTest;
@@ -54,3 +54,16 @@ print $sock "set foo2 0 0 5\r\n54321\r\n";
is(scalar <$sock>, "STORED\r\n", "stored foo2 = '54321'");
mem_get_is($sock, "foo", '12345');
mem_get_is($sock, "foo2", '54321');
+
+# Test -F option which disables flush_all
+$server = new_memcached('-F');
+$sock = $server->sock;
+
+print $sock "set foo 0 0 7\r\nfooval2\r\n";
+is(scalar <$sock>, "STORED\r\n", "stored foo");
+
+mem_get_is($sock, "foo", "fooval2");
+print $sock "flush_all\r\n";
+is(scalar <$sock>, "CLIENT_ERROR flush_all not allowed\r\n", "flush_all was not allowed");
+mem_get_is($sock, "foo", "fooval2");
+