IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 2, 2007, 3:44:24 PM (19 years ago)
Author:
jhoblitt
Message:

better paramter checking
overhaul instance table
add ->_is_valid_object_key() method
change ->find_instances() to check it's params and only return instances on mounted & available volumes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/t/07_server_find_instances.t

    r12643 r13173  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 07_server_find_instances.t,v 1.7 2007-03-28 21:48:24 jhoblitt Exp $
     5# $Id: 07_server_find_instances.t,v 1.8 2007-05-03 01:44:24 jhoblitt Exp $
    66
    77use strict;
    88use warnings FATAL => qw( all );
    99
    10 use Test::More tests => 13;
     10use Test::More tests => 15;
    1111
    1212use lib qw( ./t ./lib );
     
    5353{
    5454    # key, volume
    55     my $uri = $neb->create_object("foo");
     55    my $uri = $neb->create_object('foo', 'node01');
    5656
    57     my $locations = $neb->find_instances("foo", "node01");
     57    my $locations = $neb->find_instances('foo', 'node01');
    5858
    5959    uri_scheme_ok($locations->[0], 'file');
     
    7575}
    7676
     77# object exists but instance is on a different volume
     78Test::Nebulous->setup;
     79
     80eval {
     81    # key, volume
     82    my $uri = $neb->create_object('foo', 'node01');
     83
     84    my $locations = $neb->find_instances('foo', 'node02');
     85};
     86like($@, qr/no instances on storage volume/, 'instances on a different volume');
     87
    7788
    7889Test::Nebulous->setup;
    7990
    8091eval {
    81     $neb->find_instances("foo");
     92    $neb->find_instances('foo');
    8293};
    83 like($@, qr/no instances found/, "storage object does not exist");
     94like($@, qr/is valid object key/, "storage object does not exist");
     95
     96Test::Nebulous->setup;
     97
     98eval {
     99    $neb->create_object('foo');
     100    $neb->find_instances('foo', 'bar');
     101};
     102like($@, qr/is valid volume name/, "storage volume does not exist");
    84103
    85104Test::Nebulous->setup;
     
    93112
    94113eval {
    95     $neb->find_instances("foo", 'read', 3);
     114    $neb->create_object('foo');
     115    $neb->find_instances('foo', 'node01', 3);
    96116};
    97117like($@, qr/1 - 2 were expected/, "too many params");
Note: See TracChangeset for help on using the changeset viewer.