[Pkg-owncloud-commits] [owncloud-client] 202/332: tests: do not use system any more to modify files, rather perl native.

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Aug 14 21:07:00 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit d5a86614803c734fa7c6968191358858ac959d32
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Jul 16 14:06:10 2014 +0200

    tests: do not use system any more to modify files, rather perl native.
---
 csync/tests/ownCloud/ownCloud/Test.pm | 6 +++++-
 csync/tests/ownCloud/t1.pl            | 6 ++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/csync/tests/ownCloud/ownCloud/Test.pm b/csync/tests/ownCloud/ownCloud/Test.pm
index 9540682..507b31b 100644
--- a/csync/tests/ownCloud/ownCloud/Test.pm
+++ b/csync/tests/ownCloud/ownCloud/Test.pm
@@ -572,7 +572,11 @@ sub createLocalFile( $$ )
   
   my $md5 = Digest::MD5->new;
 
-  open(FILE, ">", $fname) or die "Can't open $fname for writing ($!)";
+  if (-e $fname) {
+    open(FILE, ">>", $fname ) or die "Can not append to file ($!)";
+  } else {
+    open(FILE, ">", $fname) or die "Can't open $fname for writing ($!)";
+  }
   
   my $minimum = 32;
   my $range = 96;
diff --git a/csync/tests/ownCloud/t1.pl b/csync/tests/ownCloud/t1.pl
index 635e1f6..48e2759 100755
--- a/csync/tests/ownCloud/t1.pl
+++ b/csync/tests/ownCloud/t1.pl
@@ -123,10 +123,8 @@ assertLocalAndRemoteDir( '', 0);
 
 # The previous sync should have updated the etags, and this should NOT be a conflict
 printInfo( "Update the file again");
-my $cmd = "sleep 2 && echo more data >> ". localDir() . "remoteToLocal1/kernelcrash.txt";
-$cmd .= " && echo corruption >> " . localDir(). "remoteToLocal1/kraft_logo.gif";
-
-system($cmd);
+createLocalFile( localDir() . "remoteToLocal1/kernelcrash.txt", 2134 );
+createLocalFile( localDir() . "remoteToLocal1/kraft_logo.gif", 2332 );
 csync( );
 assertLocalAndRemoteDir( '', 0);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list