[Pkg-owncloud-commits] [owncloud-client] 313/333: More fine granular chunking test - improved t6.pl

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:17:09 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit ebf3c7823725b9e44c996364b3676ce9fd188fb4
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon Apr 7 16:30:02 2014 +0200

    More fine granular chunking test - improved t6.pl
---
 csync/tests/ownCloud/t6.pl | 54 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 38 insertions(+), 16 deletions(-)

diff --git a/csync/tests/ownCloud/t6.pl b/csync/tests/ownCloud/t6.pl
index e08d574..cff0d24 100755
--- a/csync/tests/ownCloud/t6.pl
+++ b/csync/tests/ownCloud/t6.pl
@@ -33,30 +33,52 @@ print "Hello, this is t6, a tester for csync with ownCloud.\n";
 
 initTesting();
 
-# Big file chunking
-printInfo( "Do a big file that is chunked");
-createLocalFile( localDir().'BIG.file', 22272592 );
-assert( -e localDir().'BIG.file' );
-my $bigMd5 = md5OfFile( localDir().'BIG.file' );
+sub chunkFileTest( $$ ) 
+{
+    my ($name, $size) = @_;
 
-csync();
-my $newMd5 = md5OfFile( localDir().'BIG.file' );
-assert( $newMd5 eq $bigMd5 );
+    # Big file chunking
+    createLocalFile( localDir().$name, $size );
+    assert( -e localDir().$name );
+    
+    my $bigMd5 = md5OfFile( localDir().$name );
 
-# download
-my $ctrlFile = "/tmp/file.download";
-getToFileCurl( 'BIG.file', $ctrlFile );
+    csync();
+    my $newMd5 = md5OfFile( localDir().$name );
+    assert( $newMd5 eq $bigMd5, "Different MD5 sums!" );
 
-assert( -e $ctrlFile, "File does not exist!" );
+    # download
+    my $ctrlFile = "/tmp/file.download";
+    getToFileCurl( $name, $ctrlFile );
 
-# assert files
-my $dlMd5 = md5OfFile( $ctrlFile );
-assert( $dlMd5 eq $newMd5 );
+    assert( -e $ctrlFile, "File does not exist!" );
 
+    # assert files
+    my $dlMd5 = md5OfFile( $ctrlFile );
+    assert( $dlMd5 eq $newMd5, "Different MD5 sums 2" );
+
+    unlink( $ctrlFile );
+}
+
+chunkFileTest( "BIG.file", 23251233 );
+
+ # Set a custom chunk size in environment.
+my $ChunkSize = 1*1024*1024;
+$ENV{'OWNCLOUD_CHUNK_SIZE'} = $ChunkSize;
+
+chunkFileTest( "oneChunkSize.bin", $ChunkSize);
+chunkFileTest( "oneChunkSizeminusone.bin", $ChunkSize-1);
+chunkFileTest( "oneChunkSizeplusone.bin", $ChunkSize+1);
+
+chunkFileTest( "twoChunkSize.bin", 2*$ChunkSize);
+chunkFileTest( "twoChunkSizeminusone.bin", 2*$ChunkSize-1);
+chunkFileTest( "twoChunkSizeplusone.bin", 2*$ChunkSize+1);
+
+printInfo("Big file exactly as big as one chunk size");
 
 # ==================================================================
 
 cleanup();
-unlink( $ctrlFile );
+
 
 # --

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list