IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2009, 1:59:32 PM (17 years ago)
Author:
beaumont
Message:

merged with trunk

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
2 deleted
43 edited
25 copied

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/Nebulous

  • branches/cnb_branches/cnb_branch_20090301/Nebulous/Build.PL

    r23352 r24244  
    9595        'Nebulous::Server::SOAP'    => 0,
    9696        'Test::Nebulous'            => 0,
     97        'Test::Cmd'                 => '1.05',
    9798        'Apache2::SOAP'             => 0,
    9899        'Apache::DBI'               => '1.05',
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/MANIFEST

    r23352 r24244  
    9898t/66_client_xattr.t
    9999t/67_client_swap.t
     100t/70_neb-ls.t
    100101t/90_nebclient.t
    101102t/TEST.PL
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/bin

  • branches/cnb_branches/cnb_branch_20090301/Nebulous/bin/neb-ls

    r18092 r24244  
    11#!/usr/bin/env perl
    22
    3 # Copyright (C) 2007-2008  Joshua Hoblitt
    4 #
    5 # $Id: neb-ls,v 1.7 2008-06-12 20:03:37 jhoblitt Exp $
     3# Copyright (C) 2007-2009  Joshua Hoblitt
    64
    75use strict;
     
    97
    108use vars qw( $VERSION );
    11 $VERSION = '0.02';
     9$VERSION = '0.03';
    1210
    1311use Nebulous::Client;
     
    1614use Pod::Usage qw( pod2usage );
    1715
    18 my ($server, $long, $recursive);
     16my (
     17    $server,
     18    $long,
     19#    $recursive,
     20);
    1921
    2022$server = $ENV{'NEB_SERVER'} unless $server;
     
    2224GetOptions(
    2325    'server|s=s'    => \$server,
    24     'recursive|r'   => \$recursive,
     26#    'recursive|r'   => \$recursive,
    2527    'l|1'           => \$long,
    2628) || pod2usage( 2 );
     
    3941    unless defined $neb;
    4042
    41 # default to listing everything (bad idea?)
    42 $pattern ||= ".*";
     43# default to listing root
     44$pattern ||= "/";
    4345
    44 if ($recursive) {
    45     $pattern = "^" . $pattern . ".*";
    46 } else {
    47     $pattern = "^" . $pattern . "\$";
    48 }
     46#if ($recursive) {
     47#    $pattern = "^" . $pattern . ".*";
     48#} else {
     49#    $pattern = "^" . $pattern . "\$";
     50#}
    4951
    5052my $keys = $neb->find_objects($pattern);
     
    8688Optional
    8789
    88 =item * --recursive|-r
    89 
    90 By default C<neb-ls> will only try to match the exact string provided to it.
    91 With this option set all keys which match C<<pattern>> as a REGEX or substring
    92 will be returned.
    93 
    94 Optional
    95 
     90=cut
     91#=item * --recursive|-r
     92#
     93#By default C<neb-ls> will only try to match the exact string provided to it.
     94#With this option set all keys which match C<<pattern>> as a REGEX or substring
     95#will be returned.
     96#
     97#Optional
     98#
    9699=item * --server|-s <URL>
    97100
     
    130133=head1 COPYRIGHT
    131134
    132 Copyright (C) 2007-2008  Joshua Hoblitt.  All rights reserved.
     135Copyright (C) 2007-2009  Joshua Hoblitt.  All rights reserved.
    133136
    134137This program is free software; you can redistribute it and/or modify it under
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/bin/neb-replicate

    r18390 r24244  
    2525    'volume|v=s'    => \$volume,
    2626    'copies|c=i'    => \$copies,
     27    'set_copies=i'  => \$set_copies,
    2728) || pod2usage( 2 );
    2829
     
    4445    unless defined $neb;
    4546
    46 for (my $i = 0; $i < $copies; $i++) {
    47     if (defined $volume) {
    48         $neb->replicate($key, $volume)
    49             or die "failed to replicate Nebulous key: $key";
    50     } else {
    51         $neb->replicate($key)
    52             or die "failed to replicate Nebulous key: $key";
     47# if replicate fails, we should still set user.copies (if requested)
     48my $replication_problem;
     49eval {
     50    for (my $i = 0; $i < $copies; $i++) {
     51        if (defined $volume) {
     52            $neb->replicate($key, $volume)
     53                or die "failed to replicate Nebulous key: $key";
     54        } else {
     55            $neb->replicate($key)
     56                or die "failed to replicate Nebulous key: $key";
     57        }
    5358    }
     59};
     60if ($@) {
     61    warn $@;
     62    $replication_problem = 1;
    5463}
    5564
     65if ($set_copies) {
     66    $neb->setxattr($key, "user.copies", $copies, "replace")
     67        or die $neb->err;
     68}
     69
     70exit(32) if defined $replication_problem;
    5671
    5772__END__
     
    6681
    6782    neb-replicate [--server <URL>] [--volume <volume name>]
    68                   [--copies <n>] <key>
     83                  [--copies <n>] [--set_copies <n>] <key>
    6984
    7085=head1 DESCRIPTION
     
    93108The number of new replications to create.
    94109
    95 Optional.  Defaults to 0.
     110Optional.  Defaults to 1.
     111
     112=item * --set_copies|c <n>
     113
     114Set the C<user.copies> xattr for this storage object to C<<n>>.
     115
     116Optional.
    96117
    97118=back
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/examples

  • branches/cnb_branches/cnb_branch_20090301/Nebulous/lib

  • branches/cnb_branches/cnb_branch_20090301/Nebulous/lib/Nebulous/Client.pm

    r20988 r24244  
    243243        # if the copy failed we now have a zero length instances floating
    244244        # around that must be removed
    245         unless ($self->delete_instance("$uri")) {
     245        unless ($self->delete_instance($key, "$uri")) {
    246246            $log->logdie( "can not copy instance $uri AND FAILED TO CLEANUP EMPTY INSTANCE" );
    247247        }
     
    256256
    257257    unless ($src_md5 eq $dst_md5) {
    258         $self->delete_instance("$uri");
     258        $self->delete_instance($key, "$uri");
    259259        $log->logdie( "md5sum mismatch" );
    260260    }
     
    327327    }
    328328
    329     my $uri = $self->delete_instance( @$locations[0] );
     329    my $uri = $self->delete_instance($key, @$locations[0]);
    330330
    331331    $log->debug("leaving");
     
    615615            return;
    616616        }
     617        if ($response->faultstring =~ /does not match any key or directory/) {
     618            $log->debug( "leaving" );
     619            return;
     620        }
    617621
    618622        $log->logdie("unhandled fault - ", $self->err);
     
    813817    # a lock is implicitly removed when the last storage object is deleted
    814818    foreach my $uri ( @$locations ) {
    815         $self->delete_instance( $uri ) or return undef;
     819        $self->delete_instance($key, $uri) or return undef;
    816820    }
    817821
     
    944948    my $self = shift;
    945949
    946     my ($uri) = validate_pos(@_,
     950    my ($key, $uri) = validate_pos(@_,
     951        {
     952            type => SCALAR,
     953        },
    947954        {
    948955            type => SCALAR,
     
    961968    $log->logdie( $@ ) if $@;
    962969
    963     my $response = $self->{ 'server' }->delete_instance( $uri );
     970    my $response = $self->{ 'server' }->delete_instance($key, $uri);
    964971    if ( $response->fault ) {
    965972        $self->set_err($response->faultstring);
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/lib/Nebulous/Util.pm

    r18463 r24244  
    4545
    4646
     47# XXX replace the unlink with a 'move to trash' operation
     48# empty the trash with a daemon on the NSF server
    4749sub _nuke_file {
    4850    my $path = shift;
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient

  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/nebulous.wsdl

    r20988 r24244  
    125125
    126126    <message name="delete_instanceRequest">
     127        <part name="key" type="xsd:string" />
    127128        <part name="uri" type="xsd:string" />
    128129    </message>
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/src/nebclient.c

    r21461 r24244  
    253253    }
    254254
    255     if (!nebDeleteInstance(server, locations->URI[0])) {
     255    if (!nebDeleteInstance(server, key, locations->URI[0])) {
    256256        nebObjectInstancesFree(locations);
    257257
     
    633633
    634634    for (int i = 0; i < locations->n; i++) {
    635         if (!nebDeleteInstance(server, locations->URI[i])) {
     635      if (!nebDeleteInstance(server, key, locations->URI[i])) {
    636636            nebSetErr(server, "can not delete instance");
    637637            nebObjectInstancesFree(locations);
     
    749749}
    750750
    751 bool nebDeleteInstance(nebServer *server, const char *URI)
     751bool nebDeleteInstance(nebServer *server, const char *key, const char *URI)
    752752{
    753753    int             response;
     
    770770
    771771    if (soap_call_ns1__delete_USCOREinstance(server->soap, server->endpoint,
    772             NULL, (char *)URI, &response) != SOAP_OK) {
     772        NULL, (char *)key, (char *)URI, &response) != SOAP_OK) {
    773773        nebFree(filename);
    774774
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/src/nebclient.h

    r21462 r24244  
    282282bool nebDeleteInstance(
    283283    nebServer *server,                  ///< nebServer object
     284    const char *key,                    ///< storage object key (name)
    284285    const char *URI                     ///< URL of instance to remove
    285286);
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/src/nebulous.h

    r23352 r24244  
    11/* src/nebulous.h
    22   Generated by wsdl2h 1.2.12 from nebulous.wsdl and typemap.dat
    3    2009-03-05 21:11:05 GMT
     3   2009-04-20 22:15:21 GMT
    44   Copyright (C) 2001-2008 Robert van Engelen, Genivia Inc. All Rights Reserved.
    55   This part of the software is released under one of the following licenses:
     
    808808    NULL, // char *action = NULL selects default action for this operation
    809809    // request parameters:
     810    char*                               key,
    810811    char*                               uri,
    811812    // response parameters:
     
    819820    struct soap *soap,
    820821    // request parameters:
     822    char*                               key,
    821823    char*                               uri,
    822824    // response parameters:
     
    831833//gsoap ns1  service method-action:     delete_USCOREinstance urn:Nebulous/Server/SOAP#delete_instance
    832834int ns1__delete_USCOREinstance(
     835    char*                               key,    ///< Request parameter
    833836    char*                               uri,    ///< Request parameter
    834837    int                                *result  ///< Response parameter
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/src/soapC.c

    r23352 r24244  
    1212#endif
    1313
    14 SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-03-05 21:11:05 GMT")
     14SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-04-20 22:15:22 GMT")
    1515
    1616
     
    13441344{
    13451345        (void)soap; (void)a; /* appease -Wall -Werror */
     1346        soap_default_string(soap, &a->key);
    13461347        soap_default_string(soap, &a->uri);
    13471348}
     
    13501351{
    13511352        (void)soap; (void)a; /* appease -Wall -Werror */
     1353        soap_serialize_string(soap, &a->key);
    13521354        soap_serialize_string(soap, &a->uri);
    13531355}
     
    13651367        if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__delete_USCOREinstance), type))
    13661368                return soap->error;
     1369        if (soap_out_string(soap, "key", -1, &a->key, ""))
     1370                return soap->error;
    13671371        if (soap_out_string(soap, "uri", -1, &a->uri, ""))
    13681372                return soap->error;
     
    13801384SOAP_FMAC3 struct ns1__delete_USCOREinstance * SOAP_FMAC4 soap_in_ns1__delete_USCOREinstance(struct soap *soap, const char *tag, struct ns1__delete_USCOREinstance *a, const char *type)
    13811385{
     1386        size_t soap_flag_key = 1;
    13821387        size_t soap_flag_uri = 1;
    13831388        if (soap_element_begin_in(soap, tag, 0, type))
     
    13911396                for (;;)
    13921397                {       soap->error = SOAP_TAG_MISMATCH;
     1398                        if (soap_flag_key && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
     1399                                if (soap_in_string(soap, "key", &a->key, "xsd:string"))
     1400                                {       soap_flag_key--;
     1401                                        continue;
     1402                                }
    13931403                        if (soap_flag_uri && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
    13941404                                if (soap_in_string(soap, "uri", &a->uri, "xsd:string"))
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/src/soapClient.c

    r23352 r24244  
    1010#endif
    1111
    12 SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-03-05 21:11:05 GMT")
     12SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-04-20 22:15:21 GMT")
    1313
    1414
     
    700700}
    701701
    702 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__delete_USCOREinstance(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *uri, int *result)
     702SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__delete_USCOREinstance(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, char *uri, int *result)
    703703{       struct ns1__delete_USCOREinstance soap_tmp_ns1__delete_USCOREinstance;
    704704        struct ns1__delete_USCOREinstanceResponse *soap_tmp_ns1__delete_USCOREinstanceResponse;
     
    708708                soap_action = "urn:Nebulous/Server/SOAP#delete_instance";
    709709        soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/";
     710        soap_tmp_ns1__delete_USCOREinstance.key = key;
    710711        soap_tmp_ns1__delete_USCOREinstance.uri = uri;
    711712        soap_begin(soap);
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/src/soapServer.c

    r23352 r24244  
    1010#endif
    1111
    12 SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-03-05 21:11:05 GMT")
     12SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-04-20 22:15:21 GMT")
    1313
    1414
     
    643643         || soap_end_recv(soap))
    644644                return soap->error;
    645         soap->error = ns1__delete_USCOREinstance(soap, soap_tmp_ns1__delete_USCOREinstance.uri, &soap_tmp_int);
     645        soap->error = ns1__delete_USCOREinstance(soap, soap_tmp_ns1__delete_USCOREinstance.key, soap_tmp_ns1__delete_USCOREinstance.uri, &soap_tmp_int);
    646646        if (soap->error)
    647647                return soap->error;
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/src/soapStub.h

    r23352 r24244  
    283283struct ns1__delete_USCOREinstance
    284284{
     285        char *key;      /* optional element of type xsd:string */
    285286        char *uri;      /* optional element of type xsd:string */
    286287};
     
    432433SOAP_FMAC5 int SOAP_FMAC6 ns1__find_USCOREinstances(struct soap*, char *key, char *volume, struct ns1__find_USCOREinstancesResponse *_param_3);
    433434
    434 SOAP_FMAC5 int SOAP_FMAC6 ns1__delete_USCOREinstance(struct soap*, char *uri, int *result);
     435SOAP_FMAC5 int SOAP_FMAC6 ns1__delete_USCOREinstance(struct soap*, char *key, char *uri, int *result);
    435436
    436437SOAP_FMAC5 int SOAP_FMAC6 ns1__stat_USCOREobject(struct soap*, char *key, struct ns1__stat_USCOREobjectResponse *_param_4);
     
    467468SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__find_USCOREinstances(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, char *volume, struct ns1__find_USCOREinstancesResponse *_param_3);
    468469
    469 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__delete_USCOREinstance(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *uri, int *result);
     470SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__delete_USCOREinstance(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, char *uri, int *result);
    470471
    471472SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__stat_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, struct ns1__stat_USCOREobjectResponse *_param_4);
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests

    • Property svn:ignore set to
      Makefile
      Makefile.in
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/diag

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/fail

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/ok

    • Property svn:ignore set to
      Makefile
      Makefile.in
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/ok/ok

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/ok/ok-hash

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/ok/ok-numeric

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/pass

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/plan

    • Property svn:ignore set to
      Makefile
      Makefile.in
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/plan/no-tests

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/plan/no_plan

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/plan/not-enough-tests

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/plan/sane

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/plan/skip_all

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/plan/too-many-plans

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/plan/too-many-tests

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/skip

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/nebclient/tests/tap/tests/todo

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/scripts/ptest.pl

    r23352 r24244  
    1818$| = 1;
    1919
     20my $prog_file = shift;
    2021my $key = shift || 'foobar';
    2122my $kids = shift || 1;
    2223
     24require $prog_file;
    2325$key = "/tmp/" . $key;
    2426
     
    7274    }
    7375
    74 #    select $sock;
    75 #    $| = 1;
    76 
    77     # child
    7876    my $fname = "${key}_$id";
    7977
    8078    my $neb = Nebulous::Client::Bench->new(
    8179#    proxy   => 'http://localhost:80/nebulous'
    82         proxy   => 'http://alala:80/nebulous',
    83 #        sock    => \*STDOUT,
     80        proxy   => 'http://ipp008:80/nebulous'
     81#        proxy   => 'http://alala:80/nebulous',
    8482    );
    8583
    86 
    87     while (1) {
    88 #    print $sock "$$ : i'm a little tea pot using key: $fname\n";
    89         my $fh = $neb->open_create( $fname )
    90             or child_die($sock, "can't create file $fname");
    91         close $fh;
    92 
    93         $fh = $neb->open( $fname, 'read' )
    94             or child_die("can't open file");
    95         close $fh;
    96 
    97         $neb->lock( $fname, 'read' );
    98         $neb->unlock( $fname, 'read' );
    99         $neb->replicate( $fname );
    100         $neb->cull( $fname );
    101         $neb->find( $fname );
    102         $neb->copy( $fname, $fname . "_copy" );
    103         $neb->move( $fname, $fname . "_move" );
    104         $neb->delete( $fname . "_copy" );
    105         $neb->delete( $fname . "_move" );
    106 
    107 #    print $sock "$$ : all done!\n";
    108     }
    109 
    110     return 1;
     84    test_prog($neb, $fname);
    11185}
    11286
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/scripts/stats.pl

    r23594 r24244  
    1717foreach my $line (split(/\n/, $data)) {
    1818    my ($time, $method, $duration) = split(/\s+/, $line);
     19
     20    unless (defined $time and defined $method and defined $duration) {
     21        warn "bad line: $line\n";
     22        next;
     23    }
    1924
    2025    push @{$methods{$method}->{time}}, $time;
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/t

  • branches/cnb_branches/cnb_branch_20090301/Nebulous/t/62_client_delete_instance.t

    r20988 r24244  
    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;
  • branches/cnb_branches/cnb_branch_20090301/Nebulous/t/conf/startup.pl.in

    r16281 r24244  
    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.