Changeset 41172 for trunk/Nebulous/t/72_neb-cull.t
- Timestamp:
- Nov 27, 2019, 12:04:14 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/t/72_neb-cull.t (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/t/72_neb-cull.t
r25121 r41172 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 70 is($neb->stat($key)->[6], 1, "correct # of instances"); 71 is($? >> 8, 255, "exit code"); 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); 137 my $line = $test->stderr; 138 139 # the default min_copies is 2: 140 is($neb->stat($key)->[6], 2, "correct # of instances"); 141 is($? >> 8, 255, "exit code"); 142 like($test->stdout, qr/^$/, "stdout"); 143 like($test->stderr, qr/not enough instances/, "stderr"); 144 } 145 146 Test::Nebulous->setup; 147 148 { 149 my $key = 'foo'; 150 151 my $neb = Nebulous::Client->new( 152 proxy => $neb_url, 153 ); 154 $neb->create($key); 155 $neb->replicate($key); 85 156 $neb->replicate($key); 86 157 87 158 $test->run(args => $key); 88 159 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 160 is($neb->stat($key)->[6], 2, "correct # of instances"); 110 161 is($? >> 8, 0, "exit code"); … … 113 164 } 114 165 166 ## problem test 115 167 Test::Nebulous->setup; 116 168 … … 202 254 203 255 is($neb->stat($key)->[6], 1, "correct # of instances"); 204 is($? >> 8, 0, "exit code"); 256 257 is($? >> 8, 255, "exit code"); 205 258 like($test->stdout, qr/^$/, "stdout"); 206 259 like($test->stderr, qr/not enough instances/, "stderr"); … … 221 274 $test->run(args => "--min_copies 2 " . $key); 222 275 223 is($neb->stat($key)->[6], 1, "correct # of instances");276 is($neb->stat($key)->[6], 2, "correct # of instances"); 224 277 is($? >> 8, 0, "exit code"); 225 278 like($test->stdout, qr/^$/, "stdout");
Note:
See TracChangeset
for help on using the changeset viewer.
