tests: Fix t5: work with ownCloud 7 sharing.

This commit is contained in:
Klaas Freitag 2014-08-06 17:19:02 +02:00
parent e9c4635f6b
commit fe2e4d87c5
2 changed files with 25 additions and 9 deletions

View file

@ -609,13 +609,22 @@ sub md5OfFile( $ )
return $hash;
}
sub moveRemoteFile($$)
sub moveRemoteFile($$;$)
{
my ($from, $to) = @_;
my ($from, $to, $no_testdir) = @_;
$d->credentials( -url=> $owncloud, -realm=>"ownCloud",
-user=> $user,
-pass=> $passwd );
my $fromUrl = testDirUrl(). $from;
my $toUrl = testDirUrl() . $to;
if( $no_testdir ) {
$fromUrl = $from;
$toUrl = $to;
}
$d->move($fromUrl, $toUrl);
}

View file

@ -33,6 +33,9 @@ print "Hello, this is t5, a tester for syncing of files in Shares\n";
initTesting();
# Create empty test dirs.
csync();
my $share_dir = "share_source";
printInfo( "Create a share." );
@ -47,18 +50,22 @@ my $sharee = { user => configValue('share_user'),
# put a couple of files into the shared directory in the sharer account
glob_put( 'sharing/*', $share_dir, $sharee);
# now user kf has a new directory in shared.
# Move the shared dir remotely into the test dir, otherwise the script
# has a hard time to find it.
moveRemoteFile( server() . $share_dir, localDir(), 1 );
# call csync, sync local t1 to remote t1
printInfo("Initial sync, sync stuff down.");
csync( server()."Shared" );
assertLocalAndRemoteDir( 'Shared', 0, server() );
csync();
assertLocalAndRemoteDir( '', 0 );
# Local file to a read/write share should be synced up
printInfo("Put a file into the share.");
createLocalFile( localDir(). $share_dir . "/foobar.txt", 8094 );
csync( server()."Shared" );
assertLocalAndRemoteDir( 'Shared', 0, server() );
createLocalFile(localDir() . "$share_dir/foobar.txt", 8094 );
csync( );
assertLocalAndRemoteDir( '', 0 );
printInfo("Remove a Share.");