~john-koepi/ubuntu/trusty/memcached/default

« back to all changes in this revision

Viewing changes to t/issue_183.t

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2011-10-05 13:27:39 UTC
  • mfrom: (1.1.8 upstream) (3.3.4 sid)
  • Revision ID: james.westby@ubuntu.com-20111005132739-ntsnlj16fcze221i
Tags: 1.4.7-0.1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Run as 'memcache' user instead of nobody (LP #599461)
  - Depend on adduser for preinst/postrm
  - Create user in postinst

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use strict;
 
4
use Test::More tests => 5;
 
5
use FindBin qw($Bin);
 
6
use lib "$Bin/lib";
 
7
use MemcachedTest;
 
8
 
 
9
my $server = new_memcached();
 
10
my $sock = $server->sock;
 
11
print $sock "set key 0 0 1\r\n1\r\n";
 
12
is (scalar <$sock>, "STORED\r\n", "stored key");
 
13
my $s1  = mem_stats($sock);
 
14
my $r1 = $s1->{"reclaimed"};
 
15
is ($r1, "0", "Objects should not be reclaimed");
 
16
sleep(2);
 
17
print $sock "flush_all\r\n";
 
18
is (scalar <$sock>, "OK\r\n", "Cache flushed");
 
19
print $sock "set key 0 0 1\r\n1\r\n";
 
20
is (scalar <$sock>, "STORED\r\n", "stored key");
 
21
my $s2  = mem_stats($sock);
 
22
my $r2 = $s2->{"reclaimed"};
 
23
is ($r2, "1", "Objects should be reclaimed");