Changeset 25121 for trunk/Nebulous/t/72_neb-cull.t
- Timestamp:
- Aug 18, 2009, 5:02:45 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/t/72_neb-cull.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/t/72_neb-cull.t
r24996 r25121 17 17 18 18 use Apache::Test qw( -withtestmore ); 19 plan tests => 29;19 plan tests => 41; 20 20 21 21 use lib qw( ./lib ./t ); … … 71 71 is($? >> 8, 255, "exit code"); 72 72 like($test->stdout, qr/^$/, "stdout"); 73 like($test->stderr, qr/failed to cull Nebulous key/, "stderr"); 74 } 75 76 Test::Nebulous->setup; 77 78 { 79 my $key = 'foo'; 80 81 my $neb = Nebulous::Client->new( 82 proxy => $neb_url, 83 ); 84 $neb->create($key); 85 $neb->replicate($key); 86 87 $test->run(args => $key); 88 89 is($neb->stat($key)->[6], 1, "correct # of instances"); 90 is($? >> 8, 0, "exit code"); 91 like($test->stdout, qr/^$/, "stdout"); 92 like($test->stderr, qr/^$/, "stderr"); 93 } 94 95 Test::Nebulous->setup; 96 97 { 98 my $key = 'foo'; 99 100 my $neb = Nebulous::Client->new( 101 proxy => $neb_url, 102 ); 103 $neb->create($key); 104 $neb->replicate($key); 105 $neb->replicate($key); 106 107 $test->run(args => $key); 108 109 is($neb->stat($key)->[6], 2, "correct # of instances"); 110 is($? >> 8, 0, "exit code"); 111 like($test->stdout, qr/^$/, "stdout"); 112 like($test->stderr, qr/^$/, "stderr"); 113 } 114 115 Test::Nebulous->setup; 116 117 { 118 my $key = 'foo'; 119 120 my $neb = Nebulous::Client->new( 121 proxy => $neb_url, 122 ); 123 $neb->create($key); 124 125 $test->run(args => "--one_only " . $key); 126 127 is($neb->stat($key)->[6], 1, "correct # of instances"); 128 is($? >> 8, 255, "exit code"); 129 like($test->stdout, qr/^$/, "stdout"); 73 130 like($test->stderr, qr/not enough instances/, "stderr"); 74 131 } … … 85 142 $neb->replicate($key); 86 143 87 $test->run(args => $key);88 89 is($neb->stat($key)->[6], 1, "correct # of instances");90 is($? >> 8, 0, "exit code");91 like($test->stdout, qr/^$/, "stdout");92 like($test->stderr, qr/^$/, "stderr");93 }94 95 Test::Nebulous->setup;96 97 {98 my $key = 'foo';99 100 my $neb = Nebulous::Client->new(101 proxy => $neb_url,102 );103 $neb->create($key);104 $neb->replicate($key);105 $neb->replicate($key);106 107 $test->run(args => $key);108 109 is($neb->stat($key)->[6], 2, "correct # of instances");110 is($? >> 8, 0, "exit code");111 like($test->stdout, qr/^$/, "stdout");112 like($test->stderr, qr/^$/, "stderr");113 }114 115 Test::Nebulous->setup;116 117 {118 my $key = 'foo';119 120 my $neb = Nebulous::Client->new(121 proxy => $neb_url,122 );123 $neb->create($key);124 125 144 $test->run(args => "--one_only " . $key); 126 145 127 146 is($neb->stat($key)->[6], 1, "correct # of instances"); 128 is($? >> 8, 255, "exit code"); 147 is($? >> 8, 0, "exit code"); 148 like($test->stdout, qr/^$/, "stdout"); 149 like($test->stderr, qr/^$/, "stderr"); 150 } 151 152 Test::Nebulous->setup; 153 154 { 155 my $key = 'foo'; 156 157 my $neb = Nebulous::Client->new( 158 proxy => $neb_url, 159 ); 160 $neb->create($key); 161 $neb->replicate($key); 162 $neb->replicate($key); 163 164 $test->run(args => "--one_only " . $key); 165 166 is($neb->stat($key)->[6], 1, "correct # of instances"); 167 is($? >> 8, 0, "exit code"); 168 like($test->stdout, qr/^$/, "stdout"); 169 like($test->stderr, qr/^$/, "stderr"); 170 } 171 172 Test::Nebulous->setup; 173 174 { 175 my $key = 'foo'; 176 177 my $neb = Nebulous::Client->new( 178 proxy => $neb_url, 179 ); 180 $neb->create($key); 181 $neb->replicate($key); 182 183 $test->run(args => "--min_copies 1 " . $key); 184 185 is($neb->stat($key)->[6], 1, "correct # of instances"); 186 is($? >> 8, 0, "exit code"); 187 like($test->stdout, qr/^$/, "stdout"); 188 like($test->stderr, qr/^$/, "stderr"); 189 } 190 191 Test::Nebulous->setup; 192 193 { 194 my $key = 'foo'; 195 196 my $neb = Nebulous::Client->new( 197 proxy => $neb_url, 198 ); 199 $neb->create($key); 200 201 $test->run(args => "--min_copies 1 " . $key); 202 203 is($neb->stat($key)->[6], 1, "correct # of instances"); 204 is($? >> 8, 0, "exit code"); 129 205 like($test->stdout, qr/^$/, "stdout"); 130 206 like($test->stderr, qr/not enough instances/, "stderr"); … … 141 217 $neb->create($key); 142 218 $neb->replicate($key); 143 144 $test->run(args => "--one_only " . $key); 145 146 is($neb->stat($key)->[6], 1, "correct # of instances"); 147 is($? >> 8, 0, "exit code"); 148 like($test->stdout, qr/^$/, "stdout"); 149 like($test->stderr, qr/^$/, "stderr"); 150 } 151 152 Test::Nebulous->setup; 153 154 { 155 my $key = 'foo'; 156 157 my $neb = Nebulous::Client->new( 158 proxy => $neb_url, 159 ); 160 $neb->create($key); 161 $neb->replicate($key); 162 $neb->replicate($key); 163 164 $test->run(args => "--one_only " . $key); 219 $neb->replicate($key); 220 221 $test->run(args => "--min_copies 2 " . $key); 165 222 166 223 is($neb->stat($key)->[6], 1, "correct # of instances");
Note:
See TracChangeset
for help on using the changeset viewer.
