diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2014-01-08 16:18:59 +0400 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2014-01-08 16:19:28 +0400 |
commit | d931e0bcc29756dedac469f235aa15ee73b47bc0 (patch) | |
tree | 268c807f600ee076ed0c068a52332d3f050bac28 | |
parent | b8090a134dd4451cd6fece20465bd015697b698a (diff) |
Test that permissions are kept
(issue #820)
-rwxr-xr-x | tests/ownCloud/t4.pl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ownCloud/t4.pl b/tests/ownCloud/t4.pl index 2e54c5288..57159fe07 100755 --- a/tests/ownCloud/t4.pl +++ b/tests/ownCloud/t4.pl @@ -89,11 +89,28 @@ assertLocalAndRemoteDir( '', 1 ); printInfo("Remove a directory containing a local file\n"); remoteCleanup('test_stat'); + +#Add an executable file for next test +system( "echo echo hello >> " . localDir() . 'echo.sh' ); +chmod 0751, localDir() . 'echo.sh'; + csync(); assertLocalAndRemoteDir( '', 0 ); +open(my $fh, "<", localDir() . 'echo.sh'); +my $perm = (stat $fh)[2] & 07777; +assert( $perm eq 0751, "permissions not kept" ); + +printInfo("Modify a file in the remote and check its permission\n"); +system( "echo \"echo bonjour\" > /tmp/echo.sh" ); +put_to_dir( '/tmp/echo.sh', "" ); +csync(); +assertLocalAndRemoteDir( '', 0 ); +open(my $fh, "<", localDir() . 'echo.sh'); +my $perm = (stat $fh)[2] & 07777; +assert( $perm eq 0751, "permissions not kept" ); cleanup(); |