test file_size with send to different shard
authorDobrica Pavlinusic <dpavlin@rsync1.maxxo.com>
Mon, 26 Mar 2012 12:15:03 +0000 (14:15 +0200)
committerDobrica Pavlinusic <dpavlin@rsync1.maxxo.com>
Mon, 26 Mar 2012 12:15:03 +0000 (14:15 +0200)
t/Gearman.t

index 9c03296..6983d67 100755 (executable)
@@ -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';