IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 27, 2019, 12:04:14 PM (7 years ago)
Author:
eugene
Message:

merging updates to Nebulous from EAM dev branch ipp-20191011

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/t/72_neb-cull.t

    r25121 r41172  
    3939# NEB_SERVER env var not set
    4040undef $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
     91Test::Nebulous->setup;
    4392{
    4493    $test->run(args => '');
     
    4897# NEB_SERVER set
    4998Test::Nebulous->setup;
    50 
    5199{
    52100    $ENV{NEB_SERVER} = $neb_url;
     
    57105
    58106Test::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
     124Test::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);
    67134
    68135    $test->run(args => $key);
    69136
    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
     146Test::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);
    85156    $neb->replicate($key);
    86157
    87158    $test->run(args => $key);
    88159
    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 
    109160    is($neb->stat($key)->[6], 2, "correct # of instances");
    110161    is($? >> 8, 0, "exit code");
     
    113164}
    114165
     166## problem test
    115167Test::Nebulous->setup;
    116168
     
    202254
    203255    is($neb->stat($key)->[6], 1, "correct # of instances");
    204     is($? >> 8, 0, "exit code");
     256
     257    is($? >> 8, 255, "exit code");
    205258    like($test->stdout, qr/^$/, "stdout");
    206259    like($test->stderr, qr/not enough instances/, "stderr");
     
    221274    $test->run(args => "--min_copies 2 " . $key);
    222275
    223     is($neb->stat($key)->[6], 1, "correct # of instances");
     276    is($neb->stat($key)->[6], 2, "correct # of instances");
    224277    is($? >> 8, 0, "exit code");
    225278    like($test->stdout, qr/^$/, "stdout");
Note: See TracChangeset for help on using the changeset viewer.