IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23934 for trunk/Nebulous/t


Ignore:
Timestamp:
Apr 20, 2009, 11:23:23 AM (17 years ago)
Author:
jhoblitt
Message:

merge neb_distrib_20081210

Location:
trunk/Nebulous
Files:
1 deleted
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/eam_branches/eam_branch_20090303/Nebulous23158-23228
      /branches/jhoblitt/Nebulous2785-12604
      /branches/pap/Nebulous23511-23685,​23690-23739
  • trunk/Nebulous/t

  • trunk/Nebulous/t/62_client_delete_instance.t

    r20988 r23934  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 62_client_delete_instance.t,v 1.3 2008-12-14 22:48:35 eugene Exp $
     5# $Id: 62_client_delete_instance.t,v 1.1.38.1 2008-12-14 22:03:08 eugene Exp $
    66
    77use strict;
     
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 9;
     12plan tests => 11;
    1313
    1414use lib qw( ./t ./lib );
     
    2626        proxy => "http://$hostport/nebulous",
    2727    );
    28     $neb->create( "foo" );
    2928
    30     my $locations = $neb->find_instances( "foo" );
     29    my $key = "foo";
     30    $neb->create($key);
    3131
    32     my $uri = $neb->delete_instance( @$locations[0] );
     32    my $locations = $neb->find_instances($key);
     33
     34    my $uri = $neb->delete_instance($key, @$locations[0]);
    3335
    3436    is( $uri, @$locations[0], "delete instance" );
     
    4345        proxy => "http://$hostport/nebulous",
    4446    );
    45     $neb->create( "foo" );
    46     $neb->replicate( "foo" );
     47    my $key = "foo";
     48    $neb->create($key);
     49    $neb->replicate($key);
    4750
    4851    my $uri1 = $neb->find_instances( "foo" )->[0];
    4952
    50     ok( $neb->delete_instance( $uri1 ), "delete instance" );
     53    ok( $neb->delete_instance($key, $uri1), "delete instance" );
    5154
    5255    my $uri2 = $neb->find_instances( "foo" )->[0];
     
    5457    isnt( $uri1, $uri2, "other instance remains" );
    5558
    56     ok( $neb->delete_instance( $uri2 ), "delete instance" );
     59    ok( $neb->delete_instance($key, $uri2), "delete instance" );
    5760
    5861    my $locations = $neb->find_instances( "foo" );
    5962
    60     is( $locations, undef, "no remaning instances" );
     63    is( $locations, undef, "no remaining instances" );
    6164}
     65
     66Test::Nebulous->setup;
    6267
    6368{
     
    6570        proxy => "http://$hostport/nebulous",
    6671    );
    67     my $uri = $neb->delete_instance( "file:/foo" );
     72    my $key = "foo";
     73    $neb->create($key);
     74    my $uri = $neb->delete_instance($key, "file:/foo" );
    6875
    6976    is( $uri, undef, "uri does not exist" );
     
    7683        proxy => "http://$hostport/nebulous",
    7784    );
    78     $neb->delete_instance();
     85    my $uri = $neb->delete_instance("foo", "file:/foo" );
    7986};
    80 like( $@, qr/1 was expected/, "no params" );
     87like( $@, qr/is valid object key/, "bad object key" );
    8188
    8289Test::Nebulous->setup;
     
    8693        proxy => "http://$hostport/nebulous",
    8794    );
    88     $neb->delete_instance( "foo", 2 );
     95    my $uri = $neb->delete_instance("foo");
    8996};
    90 like( $@, qr/1 was expected/, "too many params" );
     97like( $@, qr/2 were expected/, "missing second param" );
     98
     99Test::Nebulous->setup;
     100
     101eval {
     102    my $neb = Nebulous::Client->new(
     103        proxy => "http://$hostport/nebulous",
     104    );
     105    $neb->delete_instance();
     106};
     107like( $@, qr/2 were expected/, "no params" );
     108
     109Test::Nebulous->setup;
     110
     111eval {
     112    my $neb = Nebulous::Client->new(
     113        proxy => "http://$hostport/nebulous",
     114    );
     115    $neb->delete_instance("foo", 2, 3);
     116};
     117like( $@, qr/2 were expected/, "too many params" );
    91118
    92119Test::Nebulous->cleanup;
  • trunk/Nebulous/t/conf/startup.pl.in

    r16281 r23934  
    1212use Test::Nebulous;
    1313
     14#$Apache::DBI::DEBUG = 1;
    1415Apache::DBI->connect_on_init( $NEB_DB, $NEB_USER, $NEB_PASS );
    15 Nebulous::Server::SOAP->new_on_init(
     16Apache::DBI->setPingTimeOut($NEB_DB, 10);
     17
     18my $config = Nebulous::Server::Config->new(
     19    trace       => 'all',
     20);
     21$config->add_db(
     22    dbindex     => 0,
    1623    dsn         => $NEB_DB,
    1724    dbuser      => $NEB_USER,
    1825    dbpasswd    => $NEB_PASS,
    19     log_level   => 'all',
    2026);
     27#$config->add_db(
     28#    dbindex     => 1,
     29#    dsn         => 'DBI:mysql:database=nebulous1:host=localhost',
     30#    dbuser      => $dbuser,
     31#    dbpasswd    => $dbpasswd,
     32#);
     33
     34Nebulous::Server::SOAP->new_on_init($config);
    2135
    22361;
Note: See TracChangeset for help on using the changeset viewer.