- Timestamp:
- Oct 28, 2019, 4:26:42 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20191011/Nebulous/t/72_neb-cull.t
r25121 r40998 39 39 # NEB_SERVER env var not set 40 40 undef $ENV{'NEB_SERVER'} if defined $ENV{'NEB_SERVER'}; 41 Test::Nebulous->setup; 42 41 42 ## problem test 43 ## Test::Nebulous->setup; 44 ## { 45 ## $ENV{NEB_SERVER} = $neb_url; 46 ## 47 ## my $key = 'foo'; 48 ## 49 ## my $neb = Nebulous::Client->new( 50 ## proxy => $neb_url, 51 ## ); 52 ## $neb->create($key); 53 ## 54 ## $test->run(args => "--one_only " . $key); 55 ## 56 ## ## my $line1 = $test->stdout; 57 ## ## print "stdout: $line1\n"; 58 ## ## 59 ## ## my $line2 = $test->stderr; 60 ## ## print "stderr: $line2\n"; 61 ## 62 ## is($neb->stat($key)->[6], 1, "correct # of instances"); 63 ## is($? >> 8, 255, "exit code"); 64 ## like($test->stdout, qr/^$/, "stdout"); 65 ## like($test->stderr, qr/no instances/, "stderr"); 66 ## } 67 ## die "stop"; 68 69 ## Test::Nebulous->setup; 70 ## { 71 ## my $key = 'foo'; 72 ## 73 ## my $neb = Nebulous::Client->new( 74 ## proxy => $neb_url, 75 ## ); 76 ## $neb->create($key); 77 ## $neb->replicate($key); 78 ## 79 ## $test->run(args => "--server $neb_url $key"); 80 ## 81 ## my $line = $test->stderr; 82 ## print "stderr: $line\n"; 83 ## 84 ## is($neb->stat($key)->[6], 1, "correct # of instances"); 85 ## is($? >> 8, 0, "exit code"); 86 ## like($test->stdout, qr/^$/, "stdout"); 87 ## like($test->stderr, qr/^$/, "stderr"); 88 ## } 89 ## die "TEST"; 90 91 Test::Nebulous->setup; 43 92 { 44 93 $test->run(args => ''); … … 48 97 # NEB_SERVER set 49 98 Test::Nebulous->setup; 50 51 99 { 52 100 $ENV{NEB_SERVER} = $neb_url; … … 57 105 58 106 Test::Nebulous->setup; 59 60 { 61 my $key = 'foo'; 62 63 my $neb = Nebulous::Client->new( 64 proxy => $neb_url, 65 ); 66 $neb->create($key); 107 { 108 my $key = 'foo'; 109 110 my $neb = Nebulous::Client->new( 111 proxy => $neb_url, 112 ); 113 $neb->create($key); 114 115 $test->run(args => "--server $neb_url $key"); 116 # $test->run(args => $key); 117 118 is($neb->stat($key)->[6], 1, "correct # of instances"); 119 is($? >> 8, 255, "exit code"); 120 like($test->stdout, qr/^$/, "stdout"); 121 like($test->stderr, qr/failed to cull Nebulous key/, "stderr"); 122 } 123 124 Test::Nebulous->setup; 125 126 { 127 my $key = 'foo'; 128 129 my $neb = Nebulous::Client->new( 130 proxy => $neb_url, 131 ); 132 $neb->create($key); 133 $neb->replicate($key); 67 134 68 135 $test->run(args => $key); 69 136 137 my $line = $test->stderr; 138 139 is($neb->stat($key)->[6], 1, "correct # of instances"); 140 is($? >> 8, 0, "exit code"); 141 like($test->stdout, qr/^$/, "stdout"); 142 like($test->stderr, qr/^$/, "stderr"); 143 } 144 145 Test::Nebulous->setup; 146 147 { 148 my $key = 'foo'; 149 150 my $neb = Nebulous::Client->new( 151 proxy => $neb_url, 152 ); 153 $neb->create($key); 154 $neb->replicate($key); 155 $neb->replicate($key); 156 157 $test->run(args => $key); 158 159 is($neb->stat($key)->[6], 2, "correct # of instances"); 160 is($? >> 8, 0, "exit code"); 161 like($test->stdout, qr/^$/, "stdout"); 162 like($test->stderr, qr/^$/, "stderr"); 163 } 164 165 ## problem test 166 Test::Nebulous->setup; 167 168 { 169 my $key = 'foo'; 170 171 my $neb = Nebulous::Client->new( 172 proxy => $neb_url, 173 ); 174 $neb->create($key); 175 176 $test->run(args => "--one_only " . $key); 177 70 178 is($neb->stat($key)->[6], 1, "correct # of instances"); 71 179 is($? >> 8, 255, "exit code"); 72 180 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); 181 like($test->stderr, qr/no instances/, "stderr"); 182 } 183 184 Test::Nebulous->setup; 185 186 { 187 my $key = 'foo'; 188 189 my $neb = Nebulous::Client->new( 190 proxy => $neb_url, 191 ); 192 $neb->create($key); 193 $neb->replicate($key); 124 194 125 195 $test->run(args => "--one_only " . $key); 126 196 127 197 is($neb->stat($key)->[6], 1, "correct # of instances"); 128 is($? >> 8, 255, "exit code"); 129 like($test->stdout, qr/^$/, "stdout"); 130 like($test->stderr, qr/not enough instances/, "stderr"); 131 } 132 133 Test::Nebulous->setup; 134 135 { 136 my $key = 'foo'; 137 138 my $neb = Nebulous::Client->new( 139 proxy => $neb_url, 140 ); 141 $neb->create($key); 198 is($? >> 8, 0, "exit code"); 199 like($test->stdout, qr/^$/, "stdout"); 200 like($test->stderr, qr/^$/, "stderr"); 201 } 202 203 Test::Nebulous->setup; 204 205 { 206 my $key = 'foo'; 207 208 my $neb = Nebulous::Client->new( 209 proxy => $neb_url, 210 ); 211 $neb->create($key); 212 $neb->replicate($key); 142 213 $neb->replicate($key); 143 214 … … 160 231 $neb->create($key); 161 232 $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 233 183 234 $test->run(args => "--min_copies 1 " . $key); … … 198 249 ); 199 250 $neb->create($key); 251 my $statval1 = $neb->stat($key); 252 print "statval: @$statval1[6]\n"; 200 253 201 254 $test->run(args => "--min_copies 1 " . $key); 202 255 203 is($neb->stat($key)->[6], 1, "correct # of instances"); 256 my $statval2 = $neb->stat($key); 257 print "statval: @$statval2[6]\n"; 258 259 is($neb->stat($key)->[6], 1, "correct # of instances"); 260 204 261 is($? >> 8, 0, "exit code"); 205 262 like($test->stdout, qr/^$/, "stdout");
Note:
See TracChangeset
for help on using the changeset viewer.
