~ubuntu-branches/ubuntu/quantal/memcached/quantal

« back to all changes in this revision

Viewing changes to t/00-startup.t

  • Committer: Bazaar Package Importer
  • Author(s): David Martínez Moreno
  • Date: 2009-10-16 15:09:43 UTC
  • mfrom: (1.1.6 upstream) (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20091016150943-0rhh8x206ebgwzeu
Tags: 1.4.2-1
* New upstream release, primarily bugfixes, some of them critical, hence
  the urgency:
  - Reject keys larger than 250 bytes in the binary protocol.
  - Bounds checking on stats cachedump.
  - Binary protocol set+cas wasn't returning a new cas ID.
  - Binary quitq didn't actually close the connection
  - Slab boundary checking cleanup (bad logic in unreachable code)
  - Get hit memory optimizations
  - Disallow -t options that cause the server to not work
  - Killed off incomplete slab rebalance feature.
* debian/patches:
  - 01_init_script_compliant_with_LSB.patch: Remade as upstream applied a
    whitespace cleanup script that broke the patch.
  - 02_manpage_additions.patch: Added missing parameters to the memcached
    manpage.
* Removed TODO from debian/docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl
2
2
 
3
3
use strict;
4
 
use Test::More tests => 4;
 
4
use Test::More tests => 18;
5
5
use FindBin qw($Bin);
6
6
use lib "$Bin/lib";
7
7
use MemcachedTest;
21
21
    my $server = new_memcached("-l 127.0.0.1");
22
22
};
23
23
is($@,'', "-l 127.0.0.1 works");
 
24
 
 
25
eval {
 
26
    my $server = new_memcached('-C');
 
27
    my $stats = mem_stats($server->sock, 'settings');
 
28
    is('no', $stats->{'cas_enabled'});
 
29
};
 
30
is($@, '', "-C works");
 
31
 
 
32
eval {
 
33
    my $server = new_memcached('-b 8675');
 
34
    my $stats = mem_stats($server->sock, 'settings');
 
35
    is('8675', $stats->{'tcp_backlog'});
 
36
};
 
37
is($@, '', "-b works");
 
38
 
 
39
foreach my $val ('auto', 'ascii') {
 
40
    eval {
 
41
        my $server = new_memcached("-B $val");
 
42
        my $stats = mem_stats($server->sock, 'settings');
 
43
        ok($stats->{'binding_protocol'} =~ /$val/, "$val works");
 
44
    };
 
45
    is($@, '', "$val works");
 
46
}
 
47
 
 
48
# For the binary test, we just verify it starts since we don't have an easy bin client.
 
49
eval {
 
50
    my $server = new_memcached("-B binary");
 
51
};
 
52
is($@, '', "binary works");
 
53
 
 
54
eval {
 
55
    my $server = new_memcached("-vv -B auto");
 
56
};
 
57
is($@, '', "auto works");
 
58
 
 
59
eval {
 
60
    my $server = new_memcached("-vv -B ascii");
 
61
};
 
62
is($@, '', "ascii works");
 
63
 
 
64
 
 
65
# For the binary test, we just verify it starts since we don't have an easy bin client.
 
66
eval {
 
67
    my $server = new_memcached("-vv -B binary");
 
68
};
 
69
is($@, '', "binary works");
 
70
 
 
71
 
 
72
# Should blow up with something invalid.
 
73
eval {
 
74
    my $server = new_memcached("-B http");
 
75
};
 
76
ok($@, "Died with illegal -B arg.");
 
77
 
 
78
# Should not allow -t 0
 
79
eval {
 
80
    my $server = new_memcached("-t 0");
 
81
};
 
82
ok($@, "Died with illegal 0 thread count");