mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
t7.pl: Test that deleting a directory restores it and all its sub directories
This commit is contained in:
parent
62d0e670dc
commit
9066ad5790
1 changed files with 16 additions and 0 deletions
|
@ -46,6 +46,7 @@ printInfo( "Init" );
|
|||
#create some files localy
|
||||
my $tmpdir = "/tmp/t7/";
|
||||
mkdir($tmpdir);
|
||||
createLocalFile( $tmpdir . "normalFile_PERM_WVND_.data", 100 );
|
||||
createLocalFile( $tmpdir . "cannotBeRemoved_PERM_WVN_.data", 101 );
|
||||
createLocalFile( $tmpdir . "canBeRemoved_PERM_D_.data", 102 );
|
||||
my $md5CanotBeModified = createLocalFile( $tmpdir . "canotBeModified_PERM_DVN_.data", 103 );
|
||||
|
@ -56,6 +57,10 @@ createRemoteDir( "normalDirectory_PERM_CKDNV_" );
|
|||
glob_put( "$tmpdir/*", "normalDirectory_PERM_CKDNV_" );
|
||||
createRemoteDir( "readonlyDirectory_PERM_M_" );
|
||||
glob_put( "$tmpdir/*", "readonlyDirectory_PERM_M_" );
|
||||
createRemoteDir( "readonlyDirectory_PERM_M_/subdir_PERM_CKDNV_" );
|
||||
createRemoteDir( "readonlyDirectory_PERM_M_/subdir_PERM_CKDNV_/subsubdir_PERM_CKDNV_" );
|
||||
glob_put( "$tmpdir/normalFile_PERM_WVND_.data", "readonlyDirectory_PERM_M_/subdir_PERM_CKDNV_/subsubdir_PERM_CKDNV_" );
|
||||
|
||||
|
||||
csync();
|
||||
assertLocalAndRemoteDir( '', 0);
|
||||
|
@ -139,6 +144,17 @@ assertLocalAndRemoteDir( '', 0);
|
|||
|
||||
|
||||
|
||||
#######################################################################
|
||||
printInfo( "remove the read only directory" );
|
||||
# -> It must be recovered
|
||||
system("rm -r " . localDir().'readonlyDirectory_PERM_M_' );
|
||||
csync();
|
||||
assert( -e localDir(). 'readonlyDirectory_PERM_M_/cannotBeRemoved_PERM_WVN_.data' );
|
||||
assert( -e localDir(). 'readonlyDirectory_PERM_M_/subdir_PERM_CKDNV_/subsubdir_PERM_CKDNV_/normalFile_PERM_WVND_.data' );
|
||||
assertLocalAndRemoteDir( '', 0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue