Changeset 41046
- Timestamp:
- Nov 5, 2019, 8:06:09 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20191011/Nebulous/t/53_client_cull.t
r25121 r41046 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 1 5;12 plan tests => 18; 13 13 14 14 use lib qw( ./t ./lib ); … … 21 21 22 22 Test::Nebulous->setup; 23 24 23 { 25 24 # key … … 37 36 38 37 Test::Nebulous->setup; 39 40 38 { 41 39 # key, $volume … … 43 41 proxy => "http://$hostport/nebulous", 44 42 ); 45 $neb->create("foo" );46 $neb->replicate("foo", "node0 1");47 48 my $uri = $neb->cull("foo", "node0 1");43 $neb->create("foo", "node01"); 44 $neb->replicate("foo", "node02"); 45 46 my $uri = $neb->cull("foo", "node02"); 49 47 50 48 ok($uri, "good cull"); 51 49 ok(! -e _get_file_path($uri), "file exists"); 50 } 51 52 Test::Nebulous->setup; 53 { 54 # key, $volume 55 my $neb = Nebulous::Client->new( 56 proxy => "http://$hostport/nebulous", 57 ); 58 $neb->create("foo", "node01"); 59 $neb->replicate("foo", "node02"); 60 61 # cull with soft volume should succeed even if node does not have instance 62 my $uri = $neb->cull("foo", "node03"); 63 64 ok($uri, "good cull"); 65 ok(! -e _get_file_path($uri), "file exists"); 66 } 67 68 Test::Nebulous->setup; 69 { 70 # key, $volume 71 my $neb = Nebulous::Client->new( 72 proxy => "http://$hostport/nebulous", 73 ); 74 $neb->create("foo", "node01"); 75 $neb->replicate("foo", "node02"); 76 77 # cull with hard volume should not succeed if node does not have instance 78 my $uri = $neb->cull("foo", "~node03"); 79 80 is($uri, undef, "nothing to cull on this node"); 52 81 } 53 82 … … 112 141 proxy => "http://$hostport/nebulous", 113 142 ); 114 $neb->cull(); 143 my $uri = $neb->cull(); 144 145 is ($uri, undef, "no params given to cull"); 115 146 }; 116 147 like( $@, qr/1 - 3 were expected/, "no params" ); … … 122 153 proxy => "http://$hostport/nebulous", 123 154 ); 124 $neb->cull( 1, 2, 3, 4 ); 155 my $uri = $neb->cull( 1, 2, 3, 4 ); 156 157 is ($uri, undef, "no params given to cull"); 125 158 }; 126 159 like( $@, qr/1 - 3 were expected/, "too many params" );
Note:
See TracChangeset
for help on using the changeset viewer.
