IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 5, 2019, 8:06:09 AM (7 years ago)
Author:
eugene
Message:

add tests for soft volume, missing instances on hard volume

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20191011/Nebulous/t/53_client_cull.t

    r25121 r41046  
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 15;
     12plan tests => 18;
    1313
    1414use lib qw( ./t ./lib );
     
    2121
    2222Test::Nebulous->setup;
    23 
    2423{
    2524    # key
     
    3736
    3837Test::Nebulous->setup;
    39 
    4038{
    4139    # key, $volume
     
    4341        proxy => "http://$hostport/nebulous",
    4442    );
    45     $neb->create("foo");
    46     $neb->replicate("foo", "node01");
    47 
    48     my $uri = $neb->cull("foo", "node01");
     43    $neb->create("foo", "node01");
     44    $neb->replicate("foo", "node02");
     45   
     46    my $uri = $neb->cull("foo", "node02");
    4947
    5048    ok($uri, "good cull");
    5149    ok(! -e _get_file_path($uri), "file exists");
     50}
     51
     52Test::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
     68Test::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");
    5281}
    5382
     
    112141        proxy => "http://$hostport/nebulous",
    113142    );
    114     $neb->cull();
     143    my $uri = $neb->cull();
     144
     145    is ($uri, undef, "no params given to cull");
    115146};
    116147like( $@, qr/1 - 3 were expected/, "no params" );
     
    122153        proxy => "http://$hostport/nebulous",
    123154    );
    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");
    125158};
    126159like( $@, qr/1 - 3 were expected/, "too many params" );
Note: See TracChangeset for help on using the changeset viewer.