Changeset 13269 for trunk/Nebulous-Server
- Timestamp:
- May 4, 2007, 3:41:29 PM (19 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 3 edited
-
Build.PL (modified) (1 diff)
-
lib/Nebulous/Server.pm (modified) (3 diffs)
-
t/03_server_create_object.t (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Build.PL
r13257 r13269 92 92 'Net::Server::Daemonize'=> '0.05', 93 93 'Sys::Statistics::Linux::DiskUsage' => '0.02', 94 94 'File::ExtAttr' => '1.03', 95 95 }, 96 96 build_requires => { -
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r13251 r13269 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1.3 8 2007-05-04 23:36:46jhoblitt Exp $3 # $Id: Server.pm,v 1.39 2007-05-05 01:41:29 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 208 208 my $filename = $key; 209 209 # mange '/'s into ':' 210 $ key=~ s|/|:|g;211 my $uri = URI::file->new("$vol_path/$ key.$ins_id");210 $filename =~ s|/|:|g; 211 my $uri = URI::file->new("$vol_path/$filename.$ins_id"); 212 212 $log->debug("generated uri $uri"); 213 213 214 214 # TODO add some stuff here to retry if unsucessful 215 215 eval { 216 _create_empty_file($uri->file );216 _create_empty_file($uri->file, $key); 217 217 }; 218 218 if ($@) { … … 361 361 } 362 362 363 my $uri = URI::file->new("$vol_path/$key.$ins_id"); 363 my $filename = $key; 364 # mange '/'s into ':' 365 $filename =~ s|/|:|g; 366 my $uri = URI::file->new("$vol_path/$filename.$ins_id"); 364 367 $log->debug("generated uri $uri"); 365 368 366 369 # TODO add some stuff here to retry if unsucessful 367 370 eval { 368 _create_empty_file($uri->file );371 _create_empty_file($uri->file, $key); 369 372 }; 370 373 if ($@) { -
trunk/Nebulous-Server/t/03_server_create_object.t
r13206 r13269 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 03_server_create_object.t,v 1.1 7 2007-05-04 00:43:44jhoblitt Exp $5 # $Id: 03_server_create_object.t,v 1.18 2007-05-05 01:41:29 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 2 2;10 use Test::More tests => 28; 11 11 12 12 use lib qw( ./t ./lib ); … … 17 17 use Test::URI; 18 18 use URI::Split qw( uri_split ); 19 use File::ExtAttr qw( getfattr ); 19 20 20 21 my $neb = Nebulous::Server->new( … … 33 34 ok(-e $path, "file exists"); 34 35 uri_scheme_ok($uri, 'file'); 36 37 is(getfattr($path, 'nebulous_key'), 'foo', 'nebulous_key xattr'); 35 38 } 36 39 … … 44 47 ok(-e $path, "file exists"); 45 48 uri_scheme_ok($uri, 'file'); 49 50 is(getfattr($path, 'nebulous_key'), '/foo', 'nebulous_key xattr'); 46 51 } 47 52 … … 55 60 ok(-e $path, "file exists"); 56 61 uri_scheme_ok($uri, 'file'); 62 63 is(getfattr($path, 'nebulous_key'), '/foo/', 'nebulous_key xattr'); 57 64 } 58 65 … … 66 73 ok(-e $path, "file exists"); 67 74 uri_scheme_ok($uri, 'file'); 75 76 is(getfattr($path, 'nebulous_key'), 'foo/', 'nebulous_key xattr'); 68 77 } 69 78 … … 77 86 ok(-e $path, "file exists"); 78 87 uri_scheme_ok($uri, 'file'); 88 89 is(getfattr($path, 'nebulous_key'), 'foo/bar', 'nebulous_key xattr'); 79 90 } 80 91 … … 88 99 ok(-e $path, "file exists"); 89 100 uri_scheme_ok($uri, 'file'); 101 102 is(getfattr($path, 'nebulous_key'), '/foo/bar', 'nebulous_key xattr'); 90 103 } 91 104
Note:
See TracChangeset
for help on using the changeset viewer.
