From e71ce01f90f99ce70bb5bce04b05d59ceebb6456 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Thu, 7 Aug 2014 12:13:40 +0200 Subject: [PATCH] tests: Some more tests with local files and shares. --- csync/tests/ownCloud/t5.pl | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/csync/tests/ownCloud/t5.pl b/csync/tests/ownCloud/t5.pl index 4cb7e6c8c7..b764e6d796 100755 --- a/csync/tests/ownCloud/t5.pl +++ b/csync/tests/ownCloud/t5.pl @@ -44,9 +44,9 @@ print "Created share with id <$shareId>\n"; assert( $shareId > 0 ); -my $sharee = { user => configValue('share_user'), +my $sharee = { user => configValue('share_user'), passwd => configValue('share_passwd'), - url => server() }; + url => server() }; # put a couple of files into the shared directory in the sharer account glob_put( 'sharing/*', $share_dir, $sharee); @@ -67,6 +67,34 @@ createLocalFile(localDir() . "$share_dir/foobar.txt", 8094 ); csync( ); assertLocalAndRemoteDir( '', 0 ); +# now move the file locally and sync +printInfo("Move the file locally and sync."); +my $cmd = "mv " . localDir() . "$share_dir/foobar.txt ". localDir() . "$share_dir/moved_file.txt"; +system( $cmd ); +csync( ); +assertLocalAndRemoteDir( '', 0 ); + +# now create aother directory and redo +printInfo("Create another directory and file"); +my $cmd = "mkdir ". localDir() . "$share_dir/newDir"; +system( $cmd ); +createLocalFile( localDir() . "$share_dir/newDir/a_file.bin", 5321 ); +csync( ); +assertLocalAndRemoteDir( '', 0 ); + +# Remove the local file again +printInfo("Remove the local file again."); +unlink( localDir() . "$share_dir/newDir/a_file.bin" ); +csync( ); +assertLocalAndRemoteDir( '', 0 ); + +# Remove the local directory again +printInfo("Remove the local directory again."); +rmdir( localDir() . "$share_dir/newDir" ); +csync( ); +assertLocalAndRemoteDir( '', 0 ); + + printInfo("Remove a Share."); removeShare($shareId, $share_dir);