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

« back to all changes in this revision

Viewing changes to t/issue_41.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
#!/usr/bin/perl
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
use POSIX qw(ceil);
 
6
use Test::More tests => 691;
 
7
use FindBin qw($Bin);
 
8
use lib "$Bin/lib";
 
9
use MemcachedTest;
 
10
 
 
11
my $server = new_memcached();
 
12
my $sock = $server->sock;
 
13
 
 
14
my $factor = 2;
 
15
my $val = "x" x $factor;
 
16
my $key = '';
 
17
 
 
18
# SET items of diverse size to the daemon so it can attempt
 
19
# to return a large stats output for slabs
 
20
for (my $i=0; $i<69; $i++) {
 
21
    for (my $j=0; $j<10; $j++) {
 
22
        $key = "$i:$j";
 
23
        print $sock "set key$key 0 0 $factor\r\n$val\r\n";
 
24
        is (scalar <$sock>, "STORED\r\n", "stored key$key");
 
25
    }
 
26
    $factor *= 1.2;
 
27
    $factor = ceil($factor);
 
28
    $val = "x" x $factor;
 
29
}
 
30
 
 
31
# This request will kill the daemon if it has not allocated
 
32
# enough memory internally.
 
33
my $stats = mem_stats($sock, "slabs");
 
34
 
 
35
# Verify whether the daemon is still running or not by asking
 
36
# it for statistics.
 
37
print $sock "version\r\n";
 
38
my $v = scalar <$sock>;
 
39
ok(defined $v && length($v), "memcached didn't respond");