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/70_neb-ls.t

    r24560 r41172  
    2323use Test::Cmd;
    2424use Nebulous::Client;
     25use Nebulous::Util qw( :standard );
    2526use Test::Nebulous;
    2627
     
    2829my $neb_url  = "http://$hostport/nebulous";
    2930
    30 
    3131my $cmd = 'bin/neb-ls';
    3232
    33 # last ditch effort to make sure dsget is executable
     33# last ditch effort to make sure neb-ls is executable
    3434chmod 0755, 'bin/neb-ls';
    3535
     
    3737isa_ok($test, 'Test::Cmd');
    3838
    39 # NEB_SERVER env var not set
     39# test if NEB_SERVER env var not set
    4040undef $ENV{'NEB_SERVER'} if defined $ENV{'NEB_SERVER'};
    4141Test::Nebulous->setup;
    42 
    4342{
    4443    $test->run(args => '');
     
    4645}
    4746
    48 # NEB_SERVER set
    49 Test::Nebulous->setup;
    50 
     47# NEB_SERVER set (and used in the following tests)
     48Test::Nebulous->setup;
    5149{
    5250    $ENV{NEB_SERVER} = $neb_url;
     
    5755
    5856Test::Nebulous->setup;
    59 
    60 {
    61     my $neb = Nebulous::Client->new(
    62         proxy => $neb_url,
    63     );
    64     $neb->create('foo');
    65 
    66     $test->run(args => '');
    67 
     57{
     58    my $neb = Nebulous::Client->new(
     59        proxy => $neb_url,
     60    );
     61    $neb->create('foo');
     62
     63    $test->run(args => '');
    6864    is($? >> 8, 0, "exit code");
    6965    like($test->stdout, qr/^foo$/,      "stdout");
     
    7268
    7369Test::Nebulous->setup;
    74 
    7570{
    7671    my $neb = Nebulous::Client->new(
     
    8378
    8479    is($? >> 8, 0, "exit code");
    85     like($test->stdout, qr/^bar\nfoo$/,  "stdout");
     80    like($test->stdout, qr/^bar\s+foo$/,  "stdout");
    8681    like($test->stderr, qr/^$/,         "stderr");
    8782}
    8883
    8984Test::Nebulous->setup;
    90 
     85{
     86    my $neb = Nebulous::Client->new(
     87        proxy => $neb_url,
     88    );
     89    $neb->create('foo');
     90
     91    my $locations = $neb->find_instances( "foo" );
     92    my $diskfile = _get_file_path( @$locations[0] );
     93    my $filestats = `ls -l $diskfile`;
     94
     95    $test->run(args => '-l');
     96
     97    is($? >> 8, 0, "exit code");
     98    like($test->stdout, qr/^$filestats$/,  "stdout");
     99    like($test->stderr, qr/^$/,         "stderr");
     100}
     101
     102Test::Nebulous->setup;
    91103{
    92104    my $neb = Nebulous::Client->new(
     
    96108    $neb->create('bar');
    97109
    98     $test->run(args => '-l');
     110    $test->run(args => '-c');
    99111
    100112    is($? >> 8, 0, "exit code");
     
    109121        proxy => $neb_url,
    110122    );
    111     $neb->create('foo');
    112     $neb->create('bar');
    113 
    114     $test->run(args => '-1');
    115 
    116     is($? >> 8, 0, "exit code");
    117     like($test->stdout, qr/^bar\nfoo\n$/,   "stdout");
    118     like($test->stderr, qr/^$/,             "stderr");
    119 }
    120 
    121 Test::Nebulous->setup;
    122 
    123 {
    124     my $neb = Nebulous::Client->new(
    125         proxy => $neb_url,
    126     );
    127     $neb->create('a/foo');
    128 
    129     $test->run(args => '');
    130 
    131     is($? >> 8, 0, "exit code");
    132     like($test->stdout, qr||,               "stdout");
     123    $neb->create('a/foo');
     124
     125    $test->run(args => '');
     126
     127    is($? >> 8, 0, "exit code");
     128    like($test->stdout, qr|^a/$|,           "stdout");
    133129    like($test->stderr, qr/^$/,             "stderr");
    134130}
     
    161157
    162158    is($? >> 8, 0, "exit code");
    163     like($test->stdout, qr|^a/bar\na/foo$|,  "stdout");
     159    like($test->stdout, qr|^a/bar\s+a/foo$|,  "stdout");
    164160    like($test->stderr, qr/^$/,             "stderr");
    165161}
     
    193189
    194190    is($? >> 8, 0, "exit code");
    195     like($test->stdout, qr|^a/b/\na/foo$|,        "stdout");
     191    like($test->stdout, qr|^a/b/\s+a/foo$|,        "stdout");
    196192    like($test->stderr, qr/^$/,             "stderr");
    197193}
Note: See TracChangeset for help on using the changeset viewer.