mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
tests: Some more tests with local files and shares.
This commit is contained in:
parent
6827f9977c
commit
e71ce01f90
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user