Changeset 13180 for trunk/Nebulous/t
- Timestamp:
- May 2, 2007, 5:21:28 PM (19 years ago)
- Location:
- trunk/Nebulous/t
- Files:
-
- 2 edited
-
09_server_stat_object.t (modified) (6 diffs)
-
53_client_cull.t (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/t/09_server_stat_object.t
r13092 r13180 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 09_server_stat_object.t,v 1.1 0 2007-05-01 02:52:04jhoblitt Exp $5 # $Id: 09_server_stat_object.t,v 1.11 2007-05-03 03:21:28 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 1 1;10 use Test::More tests => 12; 11 11 12 12 use lib qw( ./t ./lib ); … … 23 23 24 24 Test::Nebulous->setup; 25 26 25 { 27 my $uri =$neb->create_object("foo");26 $neb->create_object("foo"); 28 27 29 28 my $info = $neb->stat_object("foo"); 30 29 31 is(scalar @$info, 6, "number of columns");30 is(scalar @$info, 7, "number of columns"); 32 31 } 33 32 … … 35 34 36 35 { 37 my $uri =$neb->create_object("foo", "node01");36 $neb->create_object("foo", "node01"); 38 37 39 38 my $info = $neb->stat_object("foo"); 40 39 41 is(scalar @$info, 6, "number of columns");40 is(scalar @$info, 7, "number of columns"); 42 41 is(@$info[0], 1, "so_id"); 43 42 is(@$info[1], "foo", "ext_id"); … … 46 45 like(@$info[4], qr/....-..-.. ..:..:../, "epoch"); 47 46 like(@$info[5], qr/....-..-.. ..:..:../, "mtime"); 47 is(@$info[6], 1, "instances"); 48 48 } 49 49 … … 53 53 $neb->stat_object("foo"); 54 54 }; 55 like($@, qr/ no storage object found/, "object does not exist");55 like($@, qr/is valid object key/, "object does not exist"); 56 56 57 57 Test::Nebulous->setup; … … 65 65 66 66 eval { 67 $neb->create_object("foo"); 67 68 $neb->stat_object("foo", 2); 68 69 }; -
trunk/Nebulous/t/53_client_cull.t
r13178 r13180 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 53_client_cull.t,v 1. 4 2007-05-03 01:53:20jhoblitt Exp $5 # $Id: 53_client_cull.t,v 1.5 2007-05-03 03:21:28 jhoblitt Exp $ 6 6 7 7 use strict; … … 14 14 use lib qw( ./t ./lib ); 15 15 16 use Nebulous::Client trace => 'debug';16 use Nebulous::Client; 17 17 use Nebulous::Util qw( :standard ); 18 18 use Test::Nebulous; … … 27 27 proxy => "http://$hostport/nebulous", 28 28 ); 29 $neb->create( "foo");30 $neb->replicate( "foo");29 $neb->create("foo"); 30 $neb->replicate("foo"); 31 31 32 my $uri = $neb->cull( "foo");32 my $uri = $neb->cull("foo"); 33 33 34 ok( $uri, "good cull");35 ok( ! -e _get_file_path( $uri ), "file doesn't exist");34 ok($uri, "good cull"); 35 ok(! -e _get_file_path($uri), "file doesn't exist"); 36 36 } 37 37 … … 39 39 40 40 { 41 42 41 # key, $volume 43 42 my $neb = Nebulous::Client->new( 44 43 proxy => "http://$hostport/nebulous", 45 44 ); 46 $neb->create( "foo");47 $neb->replicate( "foo", "node01");45 $neb->create("foo"); 46 $neb->replicate("foo", "node01"); 48 47 49 my $uri = $neb->cull( "foo", "node01");48 my $uri = $neb->cull("foo", "node01"); 50 49 51 ok( $uri, "good cull");52 ok( ! -e _get_file_path( $uri ), "file exists");50 ok($uri, "good cull"); 51 ok(! -e _get_file_path($uri), "file exists"); 53 52 } 54 53 … … 60 59 proxy => "http://$hostport/nebulous", 61 60 ); 62 $neb->create( "foo");61 $neb->create("foo"); 63 62 64 $neb->replicate( "foo", "node01");65 $neb->replicate( "foo", "node02");63 $neb->replicate("foo", "node01"); 64 $neb->replicate("foo", "node02"); 66 65 67 my $uri1 = $neb->cull( "foo");68 my $uri2 = $neb->cull( "foo");66 my $uri1 = $neb->cull("foo"); 67 my $uri2 = $neb->cull("foo"); 69 68 70 ok( $uri1, "good cull");71 ok( $uri2, "good cull");72 ok( ! -e _get_file_path( $uri1 ), "file exists");73 ok( ! -e _get_file_path( $uri2 ), "file exists");69 ok($uri1, "good cull"); 70 ok($uri2, "good cull"); 71 ok(! -e _get_file_path($uri1), "file exists"); 72 ok(! -e _get_file_path($uri2), "file exists"); 74 73 } 75 74
Note:
See TracChangeset
for help on using the changeset viewer.
