Changeset 17539
- Timestamp:
- May 6, 2008, 12:12:07 PM (18 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 5 edited
-
Changes (modified) (1 diff)
-
lib/Nebulous/Server.pm (modified) (5 diffs)
-
t/03_server_create_object.t (modified) (2 diffs)
-
t/04_server_replicate_object.t (modified) (2 diffs)
-
t/07_server_find_instances.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Changes
r17535 r17539 1 1 Revision history for Nebulous 2 2 3 0.09 4 - allow volume name arguments to be undef 5 3 6 0.08 Thu Apr 17 16:08:16 HST 2008 4 - allow Nebulous::Server::create_object() vol_name to be undef5 7 - set permissions on storage instance directories 6 8 -
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r17536 r17539 1 1 # Copyright (c) 2004-2008 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1.6 1 2008-05-06 02:51:20jhoblitt Exp $3 # $Id: Server.pm,v 1.62 2008-05-06 22:10:58 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 no warnings qw( uninitialized ); 9 10 10 11 our $VERSION = '0.08'; … … 151 152 callbacks => { 152 153 # check that the volume requested is valid 153 'is valid volume name' => sub { $self->_is_valid_volume_name($_[0]) }, 154 'is valid volume name' => sub { 155 return 1 if not defined $_[0]; 156 $self->_is_valid_volume_name($_[0]) 157 }, 154 158 }, 155 159 optional => 1, … … 317 321 }, 318 322 { 319 type => SCALAR ,323 type => SCALAR|UNDEF, 320 324 callbacks => { 321 325 # check that the volume name requested is valid 322 'is valid volume name' => sub { $self->_is_valid_volume_name($_[0]) }, 326 'is valid volume name' => sub { 327 return 1 if not defined $_[0]; 328 $self->_is_valid_volume_name($_[0]) 329 }, 323 330 }, 324 331 optional => 1, … … 910 917 }, 911 918 { 912 type => SCALAR ,919 type => SCALAR|UNDEF, 913 920 callbacks => { 914 921 # check that the volume name requested is valid 915 'is valid volume name' => sub { $self->_is_valid_volume_name($_[0]) }, 922 'is valid volume name' => sub { 923 return 1 if not defined $_[0]; 924 $self->_is_valid_volume_name($_[0]) 925 }, 916 926 }, 917 927 optional => 1, -
trunk/Nebulous-Server/t/03_server_create_object.t
r17072 r17539 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 03_server_create_object.t,v 1.2 5 2008-03-20 21:10:14jhoblitt Exp $5 # $Id: 03_server_create_object.t,v 1.26 2008-05-06 22:10:58 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 67;10 use Test::More tests => 70; 11 11 12 12 use lib qw( ./t ./lib ); … … 251 251 Test::Nebulous->setup; 252 252 253 { 254 # undef volume name 255 # OK because the undef is ignored 256 my $uri = $neb->create_object("neb://node01/foo", undef); 257 258 my ($scheme, $auth, $path, $query, $frag) = uri_split($uri); 259 ok(-e $path, "file exists"); 260 ok($neb->find_instances("foo"), 'object key exists'); 261 uri_scheme_ok($uri, 'file'); 262 } 263 264 Test::Nebulous->setup; 265 253 266 eval { 254 267 $neb->create_object("foo"); -
trunk/Nebulous-Server/t/04_server_replicate_object.t
r17072 r17539 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 04_server_replicate_object.t,v 1.1 2 2008-03-20 21:10:14jhoblitt Exp $5 # $Id: 04_server_replicate_object.t,v 1.13 2008-05-06 22:10:58 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 1 6;10 use Test::More tests => 19; 11 11 12 12 use lib qw( ./t ./lib ); … … 49 49 $neb->create_object("foo"); 50 50 my $uri = $neb->replicate_object("foo", "node01"); 51 52 my ($scheme, $auth, $path, $query, $frag) = uri_split($uri); 53 ok(-e $path, "file exists"); 54 uri_scheme_ok($uri, 'file'); 55 56 SKIP: { 57 skip "requires xattr support", 1 unless $test_xattr; 58 is(getfattr($path, 'user.nebulous_key'), 'foo', 'user.nebulous_key xattr'); 59 } 60 } 61 62 Test::Nebulous->setup; 63 64 { 65 # key, $volume is undef 66 $neb->create_object("foo"); 67 my $uri = $neb->replicate_object("foo", undef); 51 68 52 69 my ($scheme, $auth, $path, $query, $frag) = uri_split($uri); -
trunk/Nebulous-Server/t/07_server_find_instances.t
r17072 r17539 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 07_server_find_instances.t,v 1.1 0 2008-03-20 21:10:14jhoblitt Exp $5 # $Id: 07_server_find_instances.t,v 1.11 2008-05-06 22:10:58 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 1 5;10 use Test::More tests => 17; 11 11 12 12 use lib qw( ./t ./lib ); … … 55 55 56 56 my $locations = $neb->find_instances('foo', 'node01'); 57 58 uri_scheme_ok($locations->[0], 'file'); 59 is($uri, $locations->[0], "URIs match"); 60 } 61 62 Test::Nebulous->setup; 63 64 { 65 # key, volume 66 my $uri = $neb->create_object('foo', 'node01'); 67 68 my $locations = $neb->find_instances('foo', undef); 57 69 58 70 uri_scheme_ok($locations->[0], 'file');
Note:
See TracChangeset
for help on using the changeset viewer.
