From: Dobrica Pavlinusic Date: Mon, 26 Mar 2012 12:15:03 +0000 (+0200) Subject: test file_size with send to different shard X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=fb579a655e7d9d69e2f031c0c3f87e070eb0d81f;p=cloudstore.git test file_size with send to different shard --- diff --git a/t/Gearman.t b/t/Gearman.t index 9c03296..6983d67 100755 --- a/t/Gearman.t +++ b/t/Gearman.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 15; +use Test::More tests => 19; use Data::Dump qw(dump); use lib 'lib'; @@ -16,7 +16,7 @@ my $user = $ARGV[0] || 2001; sub gearman { my ( $function, $args ) = @_; - ok my $o = CloudStore::Gearman->gearman_do( @_ ), $_[0]; + ok my $o = CloudStore::Gearman->gearman_do( @_ ), join(' ',@_); diag dump $o; return $o; } @@ -43,6 +43,13 @@ cmp_ok gearman( file_size => '~u2001/foo.txt' ), '==', gearman( file_size => '~u2002/baz.txt' ), 'size_same'; +diag "test symlink to other shard"; +gearman send_file => '~u2001/foo.txt#~u2004/foo.txt'; +my $size_1 = gearman( file_size => '~u2001/foo.txt' ); +my $size_2 = gearman( file_size => '~u2004/foo.txt' ); + +cmp_ok $size_1, '==', $size_2, 'symlink size same'; + gearman delete => '~u2002/baz.txt'; ok ! CloudStore::Gearman->gearman_do( file_size => '~u2002/baz.txt' ), 'deleted file size';