зеркало из https://github.com/nextcloud/desktop.git
Added t5.pl which does basic testing with a Shared directory.
This commit is contained in:
Родитель
70eb688e86
Коммит
384a8d0d72
|
@ -45,21 +45,26 @@ use open ':encoding(utf8)';
|
||||||
use vars qw( @ISA @EXPORT @EXPORT_OK $d %config);
|
use vars qw( @ISA @EXPORT @EXPORT_OK $d %config);
|
||||||
|
|
||||||
our $owncloud = "http://localhost/oc/remote.php/webdav/";
|
our $owncloud = "http://localhost/oc/remote.php/webdav/";
|
||||||
|
our $owncloud_plain; # the server url without the uniq testing dir
|
||||||
our $user = "joe";
|
our $user = "joe";
|
||||||
our $passwd = 'XXXXX'; # Mind to be secure.
|
our $passwd = 'XXXXX'; # Mind to be secure.
|
||||||
our $ld_libpath = "/home/joe/owncloud.com/buildcsync/modules";
|
our $ld_libpath = "/home/joe/owncloud.com/buildcsync/modules";
|
||||||
our $csync = "/home/joe/owncloud.com/buildcsync/client/ocsync";
|
our $csync = "/home/joe/owncloud.com/buildcsync/client/ocsync";
|
||||||
|
our $ocs_url;
|
||||||
|
our $share_user;
|
||||||
|
our $share_passwd;
|
||||||
our $remoteDir;
|
our $remoteDir;
|
||||||
our $localDir;
|
our $localDir;
|
||||||
our $infoCnt = 1;
|
our $infoCnt = 1;
|
||||||
|
our %config;
|
||||||
|
|
||||||
@ISA = qw(Exporter);
|
@ISA = qw(Exporter);
|
||||||
@EXPORT = qw( initTesting createRemoteDir createLocalDir cleanup csync
|
@EXPORT = qw( initTesting createRemoteDir createLocalDir cleanup csync
|
||||||
assertLocalDirs assertLocalAndRemoteDir glob_put put_to_dir
|
assertLocalDirs assertLocalAndRemoteDir glob_put put_to_dir
|
||||||
putToDirLWP localDir remoteDir localCleanup createLocalFile md5OfFile
|
putToDirLWP localDir remoteDir localCleanup createLocalFile md5OfFile
|
||||||
remoteCleanup server initLocalDir initRemoteDir moveRemoteFile
|
remoteCleanup server initLocalDir initRemoteDir moveRemoteFile
|
||||||
printInfo remoteFileId);
|
printInfo remoteFileId createShare
|
||||||
|
configValue testDirUrl);
|
||||||
|
|
||||||
sub server
|
sub server
|
||||||
{
|
{
|
||||||
|
@ -86,15 +91,19 @@ sub initTesting(;$)
|
||||||
$cfgFile = "/etc/ownCloud/t1.cfg" if( -r "/etc/ownCloud/t1.cfg" );
|
$cfgFile = "/etc/ownCloud/t1.cfg" if( -r "/etc/ownCloud/t1.cfg" );
|
||||||
|
|
||||||
if( -r "$cfgFile" ) {
|
if( -r "$cfgFile" ) {
|
||||||
my %config = do $cfgFile;
|
%config = do $cfgFile;
|
||||||
warn "Could not parse t1.cfg: $!\n" unless %config;
|
warn "Could not parse t1.cfg: $!\n" unless %config;
|
||||||
warn "Could not do t1.cfg: $@\n" if $@;
|
warn "Could not do t1.cfg: $@\n" if $@;
|
||||||
|
|
||||||
$user = $config{user} if( $config{user} );
|
$user = $config{user} if( $config{user} );
|
||||||
$passwd = $config{passwd} if( $config{passwd} );
|
$passwd = $config{passwd} if( $config{passwd} );
|
||||||
$owncloud = $config{url} if( $config{url} );
|
$owncloud = $config{url} if( $config{url} );
|
||||||
$ld_libpath = $config{ld_libpath} if( $config{ld_libpath} );
|
$ld_libpath = $config{ld_libpath} if( $config{ld_libpath} );
|
||||||
$csync = $config{csync} if( $config{csync} );
|
$csync = $config{csync} if( $config{csync} );
|
||||||
|
$ocs_url = $config{ocs_url} if( $config{ocs_url} );
|
||||||
|
$share_user = $config{share_user} if( $config{share_user} );
|
||||||
|
$share_passwd = $config{share_passwd} if( $config{share_passwd} );
|
||||||
|
|
||||||
print "Read config from $cfgFile: $config{url}\n";
|
print "Read config from $cfgFile: $config{url}\n";
|
||||||
} else {
|
} else {
|
||||||
print STDERR "Could not read a config file $cfgFile\n";
|
print STDERR "Could not read a config file $cfgFile\n";
|
||||||
|
@ -124,19 +133,38 @@ sub initTesting(;$)
|
||||||
printf( "Test directory name is %s\n", $dir );
|
printf( "Test directory name is %s\n", $dir );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub configValue($;$)
|
||||||
|
{
|
||||||
|
my ($configName, $default) = @_;
|
||||||
|
|
||||||
|
if( $config{$configName} ) {
|
||||||
|
return $config{$configName} ;
|
||||||
|
} else {
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Returns the full url to the testing dir, ie.
|
||||||
|
# http://localhost/owncloud/remote.php/webdav/t1-0543
|
||||||
|
sub testDirUrl()
|
||||||
|
{
|
||||||
|
print "WARN: Remote dir still empty, first call initRemoteDir!\n" unless($remoteDir);
|
||||||
|
return $owncloud . $remoteDir;
|
||||||
|
}
|
||||||
|
|
||||||
# Call this first to create the unique test dir stored in
|
# Call this first to create the unique test dir stored in
|
||||||
# the global var $remoteDir;
|
# the global var $remoteDir;
|
||||||
sub initRemoteDir
|
sub initRemoteDir
|
||||||
{
|
{
|
||||||
$d->open( $owncloud );
|
$d->open( $owncloud );
|
||||||
$owncloud .= $remoteDir;
|
my $url = testDirUrl();
|
||||||
|
|
||||||
my $re = $d->mkcol( $owncloud );
|
my $re = $d->mkcol( $url );
|
||||||
if( $re == 0 ) {
|
if( $re == 0 ) {
|
||||||
print "Failed to create test dir $owncloud\n";
|
print "Failed to create test dir $url\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
# $owncloud .= $remoteDir;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub initLocalDir
|
sub initLocalDir
|
||||||
|
@ -148,7 +176,7 @@ sub createRemoteDir(;$)
|
||||||
{
|
{
|
||||||
my ($dir) = @_;
|
my ($dir) = @_;
|
||||||
|
|
||||||
my $url = $owncloud . $dir;
|
my $url = testDirUrl() . $dir;
|
||||||
|
|
||||||
$d->open( $owncloud );
|
$d->open( $owncloud );
|
||||||
print $d->message . "\n";
|
print $d->message . "\n";
|
||||||
|
@ -159,6 +187,7 @@ sub createRemoteDir(;$)
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
$d->open( $url );
|
$d->open( $url );
|
||||||
|
|
||||||
return $re;
|
return $re;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -191,14 +220,15 @@ sub cleanup()
|
||||||
sub remoteCleanup($)
|
sub remoteCleanup($)
|
||||||
{
|
{
|
||||||
my ($dir) = @_;
|
my ($dir) = @_;
|
||||||
$d->open( -url => $owncloud . $dir );
|
my $url = testDirUrl().$dir;
|
||||||
|
$d->open( -url => $url );
|
||||||
|
|
||||||
print "Cleaning Remote!\n";
|
print "Cleaning Remote!\n";
|
||||||
|
|
||||||
my $re = $d->delete( $owncloud . $dir );
|
my $re = $d->delete( $url );
|
||||||
|
|
||||||
if( $re == 0 ) {
|
if( $re == 0 ) {
|
||||||
print "Failed to clenup directory <$owncloud $dir>\n";
|
print "Failed to cleanup directory <$url>\n";
|
||||||
}
|
}
|
||||||
return $re;
|
return $re;
|
||||||
}
|
}
|
||||||
|
@ -211,9 +241,15 @@ sub localCleanup($)
|
||||||
system( "rm -rf $dir" );
|
system( "rm -rf $dir" );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub csync( )
|
# parameter: An optional full url to the owncloud sync dir.
|
||||||
|
sub csync( ;$ )
|
||||||
{
|
{
|
||||||
my $url = $owncloud;
|
my ($aurl) = @_;
|
||||||
|
|
||||||
|
my $url = testDirUrl();
|
||||||
|
if( $aurl ) {
|
||||||
|
$url = $aurl;
|
||||||
|
}
|
||||||
$url =~ s#^http://##; # Remove the leading http://
|
$url =~ s#^http://##; # Remove the leading http://
|
||||||
$url = "owncloud://$user:$passwd@". $url;
|
$url = "owncloud://$user:$passwd@". $url;
|
||||||
print "CSync URL: $url\n";
|
print "CSync URL: $url\n";
|
||||||
|
@ -290,15 +326,23 @@ sub registerSeen($$)
|
||||||
$seenRef->{$file} = 1;
|
$seenRef->{$file} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub traverse( $$ )
|
sub traverse( $$;$ )
|
||||||
{
|
{
|
||||||
my ($remote, $acceptConflicts) = @_;
|
my ($remote, $acceptConflicts, $aurl) = @_;
|
||||||
$remote .= '/' unless $remote =~ /(^|\/)$/;
|
$remote .= '/' unless $remote =~ /(^|\/)$/;
|
||||||
printf("===============> $remote\n");
|
|
||||||
|
|
||||||
my $url = $owncloud . $remote;
|
my $url = testDirUrl() . $remote;
|
||||||
|
if( $aurl ) {
|
||||||
|
$url = $aurl . $remote;
|
||||||
|
}
|
||||||
|
printf("===============> $url\n");
|
||||||
my %seen;
|
my %seen;
|
||||||
|
|
||||||
|
|
||||||
|
$d->credentials( -url=> $owncloud, -realm=>"ownCloud",
|
||||||
|
-user=> $user,
|
||||||
|
-pass=> $passwd );
|
||||||
|
|
||||||
if( my $r = $d->propfind( -url => $url, -depth => 1 ) ) {
|
if( my $r = $d->propfind( -url => $url, -depth => 1 ) ) {
|
||||||
|
|
||||||
if( $r->get_resourcelist ) {
|
if( $r->get_resourcelist ) {
|
||||||
|
@ -309,12 +353,15 @@ sub traverse( $$ )
|
||||||
# print "Checking " . $res-> get_uri()->as_string ."\n";
|
# print "Checking " . $res-> get_uri()->as_string ."\n";
|
||||||
print "Traversing into directory: $filename\n";
|
print "Traversing into directory: $filename\n";
|
||||||
my $dirname = $remote . $filename;
|
my $dirname = $remote . $filename;
|
||||||
traverse( $dirname, $acceptConflicts );
|
traverse( $dirname, $acceptConflicts, $aurl );
|
||||||
registerSeen( \%seen, $localDir . $dirname );
|
my $localDirName = $localDir . $dirname;
|
||||||
|
$localDirName =~ s/Shared\///g;
|
||||||
|
registerSeen( \%seen, $localDirName); # . $dirname
|
||||||
} else {
|
} else {
|
||||||
# Check files here.
|
# Check files here.
|
||||||
print "Checking file: $remote$filename\n";
|
print "Checking file: $remote$filename\n";
|
||||||
my $localFile = $localDir . $remote . $filename;
|
my $localFile = $localDir . $remote . $filename;
|
||||||
|
$localFile =~ s/Shared\///g;
|
||||||
registerSeen( \%seen, $localFile );
|
registerSeen( \%seen, $localFile );
|
||||||
# $localFile =~ s/t1-\d+\//t1\//;
|
# $localFile =~ s/t1-\d+\//t1\//;
|
||||||
|
|
||||||
|
@ -329,7 +376,8 @@ sub traverse( $$ )
|
||||||
# Check the directory contents
|
# Check the directory contents
|
||||||
my $localpath = localDir();
|
my $localpath = localDir();
|
||||||
$localpath .= $remote if( $remote ne "/" );
|
$localpath .= $remote if( $remote ne "/" );
|
||||||
print "#### localpath = " . $localpath . "\n";
|
$localpath =~ s/Shared\///g;
|
||||||
|
print "#### localpath = " . $localpath . "\n";
|
||||||
opendir(my $dh, $localpath ) || die;
|
opendir(my $dh, $localpath ) || die;
|
||||||
# print Dumper( %seen );
|
# print Dumper( %seen );
|
||||||
while( readdir $dh ) {
|
while( readdir $dh ) {
|
||||||
|
@ -361,20 +409,19 @@ sub traverse( $$ )
|
||||||
closedir $dh;
|
closedir $dh;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub assertLocalAndRemoteDir( $$ )
|
sub assertLocalAndRemoteDir( $$;$ )
|
||||||
{
|
{
|
||||||
my ($remote, $acceptConflicts ) = @_;
|
my ($remote, $acceptConflicts, $aurl ) = @_;
|
||||||
# %seen = ();
|
traverse( $remote, $acceptConflicts, $aurl );
|
||||||
traverse( $remote, $acceptConflicts );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub glob_put( $$ )
|
#
|
||||||
|
# the third parameter is an optional hash ref that can contain
|
||||||
|
# the keys user, passwd and url for alternative connection settings
|
||||||
|
#
|
||||||
|
sub glob_put( $$;$ )
|
||||||
{
|
{
|
||||||
my( $globber, $target ) = @_;
|
my( $globber, $target, $optionsRef ) = @_;
|
||||||
|
|
||||||
# $target = $owncloud . $target;
|
|
||||||
|
|
||||||
$d->open( $target );
|
|
||||||
|
|
||||||
my @puts = bsd_glob( $globber );
|
my @puts = bsd_glob( $globber );
|
||||||
foreach my $llfile( @puts ) {
|
foreach my $llfile( @puts ) {
|
||||||
|
@ -389,7 +436,7 @@ sub glob_put( $$ )
|
||||||
$puturl = $target;
|
$puturl = $target;
|
||||||
print " *** Putting $lfile to $puturl\n";
|
print " *** Putting $lfile to $puturl\n";
|
||||||
# putToDirLWP( $lfile, $puturl );
|
# putToDirLWP( $lfile, $puturl );
|
||||||
put_to_dir($lfile, $puturl);
|
put_to_dir($lfile, $puturl, $optionsRef);
|
||||||
|
|
||||||
# if( ! $d->put( -local=>$lfile, -url=> $puturl ) ) {
|
# if( ! $d->put( -local=>$lfile, -url=> $puturl ) ) {
|
||||||
#print " ### FAILED to put: ". $d->message . '\n';
|
#print " ### FAILED to put: ". $d->message . '\n';
|
||||||
|
@ -400,16 +447,26 @@ sub glob_put( $$ )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub put_to_dir( $$ )
|
sub put_to_dir( $$;$ )
|
||||||
{
|
{
|
||||||
my ($file, $dir) = @_;
|
my ($file, $dir, $optionsRef) = @_;
|
||||||
|
|
||||||
$dir .="/" unless $dir =~ /\/$/;
|
$dir .="/" unless $dir =~ /\/$/;
|
||||||
|
my $targetUrl = testDirUrl();
|
||||||
|
|
||||||
|
if( $optionsRef && $optionsRef->{user} && $optionsRef->{passwd} ) {
|
||||||
|
$d->credentials( -url=> $owncloud, -realm=>"ownCloud",
|
||||||
|
-user=> $optionsRef->{user},
|
||||||
|
-pass=> $optionsRef->{passwd} );
|
||||||
|
if( $optionsRef->{url} ) {
|
||||||
|
$targetUrl = $optionsRef->{url};
|
||||||
|
}
|
||||||
|
}
|
||||||
$d->open($dir);
|
$d->open($dir);
|
||||||
|
|
||||||
my $filename = $file;
|
my $filename = $file;
|
||||||
$filename =~ s/^.*\///;
|
$filename =~ s/^.*\///;
|
||||||
my $puturl = $owncloud . $dir. $filename;
|
my $puturl = $targetUrl . $dir. $filename;
|
||||||
print "put_to_dir puts to $puturl\n";
|
print "put_to_dir puts to $puturl\n";
|
||||||
unless ($d->put( -local => $file, -url => $puturl )) {
|
unless ($d->put( -local => $file, -url => $puturl )) {
|
||||||
print " ### FAILED to put a single file!\n";
|
print " ### FAILED to put a single file!\n";
|
||||||
|
@ -429,7 +486,7 @@ sub putToDirLWP($$)
|
||||||
my $basename = basename $filename;
|
my $basename = basename $filename;
|
||||||
|
|
||||||
$dir =~ s/^\.\///;
|
$dir =~ s/^\.\///;
|
||||||
my $puturl = $owncloud . $dir. $basename;
|
my $puturl = testDirUrl() . $dir. $basename;
|
||||||
# print "putToDir LWP puts $filename to $puturl\n";
|
# print "putToDir LWP puts $filename to $puturl\n";
|
||||||
die("Could not open $filename: $!") unless( open FILE, "$filename" );
|
die("Could not open $filename: $!") unless( open FILE, "$filename" );
|
||||||
binmode FILE, ":utf8";;
|
binmode FILE, ":utf8";;
|
||||||
|
@ -494,8 +551,8 @@ sub moveRemoteFile($$)
|
||||||
{
|
{
|
||||||
my ($from, $to) = @_;
|
my ($from, $to) = @_;
|
||||||
|
|
||||||
my $fromUrl = $owncloud . $from;
|
my $fromUrl = testDirUrl(). $from;
|
||||||
my $toUrl = $owncloud . $to;
|
my $toUrl = testDirUrl() . $to;
|
||||||
|
|
||||||
$d->move($fromUrl, $toUrl);
|
$d->move($fromUrl, $toUrl);
|
||||||
|
|
||||||
|
@ -518,7 +575,7 @@ sub printInfo($)
|
||||||
sub remoteFileId($$)
|
sub remoteFileId($$)
|
||||||
{
|
{
|
||||||
my ($fromDir, $file) = @_;
|
my ($fromDir, $file) = @_;
|
||||||
my $fromUrl = $owncloud . $fromDir;
|
my $fromUrl = testDirUrl() . $fromDir;
|
||||||
my $id;
|
my $id;
|
||||||
|
|
||||||
if( my $r = $d->propfind( -url => $fromUrl, -depth => 1 ) ) {
|
if( my $r = $d->propfind( -url => $fromUrl, -depth => 1 ) ) {
|
||||||
|
@ -541,4 +598,47 @@ sub remoteFileId($$)
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Creates a read write share from the config file user 'share_user' to the
|
||||||
|
# config file user 'user'
|
||||||
|
# readWrite: permission flag. 31 for all permissions (read/write/create etc)
|
||||||
|
# and 1 for read only
|
||||||
|
sub createShare($$)
|
||||||
|
{
|
||||||
|
my ($dir, $readWrite) = @_;
|
||||||
|
|
||||||
|
my $dd = HTTP::DAV->new();
|
||||||
|
|
||||||
|
$dd->credentials( -url=> $owncloud, -realm=>"ownCloud",
|
||||||
|
-user=> $share_user,
|
||||||
|
-pass=> $share_passwd );
|
||||||
|
$dd->open( $owncloud);
|
||||||
|
|
||||||
|
# create a remote dir
|
||||||
|
my $url = $owncloud . $dir;
|
||||||
|
|
||||||
|
my $re = $dd->mkcol( $url );
|
||||||
|
if( $re == 0 ) {
|
||||||
|
print "Failed to create test dir $url\n";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
my $ua = LWP::UserAgent->new();
|
||||||
|
$ua->agent( "ownCloudTest_sharing");
|
||||||
|
# http://localhost/ocm/ocs/v1.php/apps/files_sharing/api/v1/shares
|
||||||
|
my $puturl = $ocs_url . "apps/files_sharing/api/v1/shares";
|
||||||
|
|
||||||
|
my $string = "path=$dir&shareType=0&shareWith=$user&publicUpload=false&permissions=$readWrite";
|
||||||
|
print ">>>>>>>>>> $string\n";
|
||||||
|
|
||||||
|
my $req = POST $puturl, Content => $string;
|
||||||
|
$req->authorization_basic($share_user, $share_passwd);
|
||||||
|
my $response = $ua->request($req);
|
||||||
|
|
||||||
|
if ($response->is_success()) {
|
||||||
|
# print "OK: ", $response->content;
|
||||||
|
} else {
|
||||||
|
die( "Create sharing failed: " . $response->as_string );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
user => "joe",
|
user => "joe",
|
||||||
passwd => "secret",
|
passwd => "secret",
|
||||||
url => "http://localhost/ocm/remote.php/webdav/",
|
url => "http://localhost/ocm/remote.php/webdav/",
|
||||||
ld_libpath => "/home/joe/owncloud/csync/csync-build/modules",
|
ld_libpath => "/home/joe/owncloud/csync/csync-build/modules",
|
||||||
csync => "/home/joe/owncloud/csync/csync-build/client/csync"
|
csync => "/home/joe/owncloud/csync/csync-build/client/csync",
|
||||||
|
ocs_url => "http://localhost/owncloud/ocs/v1.php/",
|
||||||
|
share_user => "jenny",
|
||||||
|
share_passwd => "also_secret"
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
# Test script for the ownCloud module of csync.
|
||||||
|
# This script requires a running ownCloud instance accessible via HTTP.
|
||||||
|
# It does quite some fancy tests and asserts the results.
|
||||||
|
#
|
||||||
|
# Copyright (C) by Klaas Freitag <freitag@owncloud.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
use lib ".";
|
||||||
|
|
||||||
|
use Carp::Assert;
|
||||||
|
use File::Copy;
|
||||||
|
use ownCloud::Test;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
print "Hello, this is t5, a tester for syncing of files in Shares\n";
|
||||||
|
# stat error occours on windsows when the file is busy for example
|
||||||
|
|
||||||
|
initTesting();
|
||||||
|
|
||||||
|
my $share_dir = "share_source";
|
||||||
|
|
||||||
|
printInfo( "Create a share." );
|
||||||
|
createShare( $share_dir, 31 );
|
||||||
|
|
||||||
|
# put a couple of files into the shared directory in the sharer account
|
||||||
|
glob_put( 'sharing/*', $share_dir, { user => configValue('share_user'),
|
||||||
|
passwd => configValue('share_passwd'),
|
||||||
|
url => server() });
|
||||||
|
|
||||||
|
# now user kf has a new directory in shared.
|
||||||
|
|
||||||
|
# call csync, sync local t1 to remote t1
|
||||||
|
printInfo("Initial sync, sync stuff down.");
|
||||||
|
csync( server()."Shared" );
|
||||||
|
assertLocalAndRemoteDir( 'Shared', 0, server() );
|
||||||
|
|
||||||
|
printInfo("Put a file into the share.");
|
||||||
|
createLocalFile( localDir(). $share_dir . "/foobar.txt", 8094 );
|
||||||
|
csync( server()."Shared" );
|
||||||
|
assertLocalAndRemoteDir( 'Shared', 0, server() );
|
||||||
|
|
||||||
|
cleanup();
|
||||||
|
|
||||||
|
# --
|
Загрузка…
Ссылка в новой задаче