diff options
author | Dustin Sallings <dustin@spy.net> | 2009-05-13 14:08:18 -0700 |
---|---|---|
committer | Trond Norbye <Trond.Norbye@sun.com> | 2009-05-14 00:41:48 +0200 |
commit | a155b04415a97b87a2fa66250f8ad1bb2c75ce5b (patch) | |
tree | 3a35d7a4d7e6220bcb310530892d77a1364d7e1d /t/00-startup.t | |
parent | fcc2c98f5f96ad30afe2e34be2322fc2008139c8 (diff) | |
download | memcached-a155b04415a97b87a2fa66250f8ad1bb2c75ce5b.tar.gz |
Allow the binding protocol to be specified.
Instead of always binding as autonegotiate, allow the user to specify
which protocol the server will run.
Diffstat (limited to 't/00-startup.t')
-rwxr-xr-x | t/00-startup.t | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/t/00-startup.t b/t/00-startup.t index 9a55563..0d30ac0 100755 --- a/t/00-startup.t +++ b/t/00-startup.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use strict; -use Test::More tests => 8; +use Test::More tests => 14; use FindBin qw($Bin); use lib "$Bin/lib"; use MemcachedTest; @@ -35,3 +35,24 @@ eval { is('8675', $stats->{'tcp_backlog'}); }; is($@, '', "-b works"); + +foreach my $val ('auto', 'ascii') { + eval { + my $server = new_memcached("-B $val"); + my $stats = mem_stats($server->sock, 'settings'); + ok($stats->{'binding_protocol'} =~ /$val/, "$val works"); + }; + is($@, '', "$val works"); +} + +# For the binary test, we just verify it starts since we don't have an easy bin client. +eval { + my $server = new_memcached("-B binary"); +}; +is($@, '', "binary works"); + +# Should blow up with something invalid. +eval { + my $server = new_memcached("-B http"); +}; +ok($@, "Died with illegal -B arg."); |