[Pkg-owncloud-commits] [ocsync] 03/29: Add test that directories are properly moved

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Dec 13 14:26:33 UTC 2013


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

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

commit 000f7d320e9d3681d0dfe3bc71f26a8d02da4d1d
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Dec 5 15:34:39 2013 +0100

    Add test that directories are properly moved
    
    Even when they just had been modified or added
---
 tests/ownCloud/t3.pl | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/tests/ownCloud/t3.pl b/tests/ownCloud/t3.pl
index b428b9a..5ab50e3 100755
--- a/tests/ownCloud/t3.pl
+++ b/tests/ownCloud/t3.pl
@@ -79,17 +79,32 @@ system( "echo \"super new\" >> " . localDir() . 'newdir/myfile.txt' );
 #Add some files for the next test.
 system( "echo \"un\" > " . localDir() . '1.txt' );
 system( "echo \"deux\" > " . localDir() . '2.txt' );
+mkdir( localDir() . 'newdir2' );
 
 csync();
 assertLocalAndRemoteDir( 'newdir', 0);
 
+
+printInfo("Rename a directory that was just changed");
+# newdir was changed so it's etag is not yet saved in the database,  but still it needs to be moved.
+my $newdirId = remoteFileId( localDir(), 'newdir' );
+my $newdir2Id = remoteFileId( localDir(), 'newdir2' );
+move(localDir() . 'newdir' , localDir() . 'newdir3');
+move(localDir() . 'newdir2' , localDir() . 'newdir4');
+
+
 # FIXME:  this test is currently failing
 #  see csync_update.c in _csyn_detect_update, the commen near the commented fs->inode != tmp->inode
 # unlink( localDir() . '1.txt' );
 # move( localDir() . '2.txt', localDir() . '1.txt' );
-#
-# csync();
-# assertLocalAndRemoteDir( '', 0);
+
+csync();
+assertLocalAndRemoteDir( '', 0);
+my $newdir3Id = remoteFileId( localDir(), 'newdir3' );
+my $newdir4Id = remoteFileId( localDir(), 'newdir4' );
+assert( $newdirId eq $newdir3Id, "newdir was not MOVE'd to newdir3?" );
+assert( $newdir2Id eq $newdir4Id, "newdir2 was not MOVE'd to newdir4?" );
+
 
 cleanup();
 

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



More information about the Pkg-owncloud-commits mailing list