mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 06:55:59 +03:00
Fix perl tests for sync journal db name
This commit is contained in:
parent
49f8143f00
commit
276985f6c3
4 changed files with 8 additions and 7 deletions
|
@ -457,6 +457,7 @@ sub traverse( $$;$ )
|
||||||
|
|
||||||
$isHere = 1 if( $acceptConflicts && !$isHere && $f =~ /_conflict/ );
|
$isHere = 1 if( $acceptConflicts && !$isHere && $f =~ /_conflict/ );
|
||||||
$isHere = 1 if( $f =~ /\.csync/ );
|
$isHere = 1 if( $f =~ /\.csync/ );
|
||||||
|
$isHere = 1 if( $f =~ /\._sync_/ );
|
||||||
assert( $isHere, "Filename local, but not remote: $f" );
|
assert( $isHere, "Filename local, but not remote: $f" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ assertLocalAndRemoteDir( 'remoteToLocal1', 1);
|
||||||
|
|
||||||
printInfo("simulate a owncloud 5 update by removing all the fileid");
|
printInfo("simulate a owncloud 5 update by removing all the fileid");
|
||||||
## simulate a owncloud 5 update by removing all the fileid
|
## simulate a owncloud 5 update by removing all the fileid
|
||||||
system( "sqlite3 " . localDir() . ".csync_journal.db \"UPDATE metadata SET fileid='';\"");
|
system( "sqlite3 " . localDir() . "._sync_*.db \"UPDATE metadata SET fileid='';\"");
|
||||||
#refresh the ids
|
#refresh the ids
|
||||||
csync();
|
csync();
|
||||||
assertLocalAndRemoteDir( 'remoteToLocal1', 1);
|
assertLocalAndRemoteDir( 'remoteToLocal1', 1);
|
||||||
|
|
|
@ -61,7 +61,7 @@ sub getETagFromJournal($$)
|
||||||
{
|
{
|
||||||
my ($name,$num) = @_;
|
my ($name,$num) = @_;
|
||||||
|
|
||||||
my $sql = "sqlite3 " . localDir() . ".csync_journal.db \"SELECT md5 FROM metadata WHERE path='$name';\"";
|
my $sql = "sqlite3 " . localDir() . "._sync_*.db \"SELECT md5 FROM metadata WHERE path='$name';\"";
|
||||||
open(my $fh, '-|', $sql) or die $!;
|
open(my $fh, '-|', $sql) or die $!;
|
||||||
my $etag = <$fh>;
|
my $etag = <$fh>;
|
||||||
close $fh;
|
close $fh;
|
||||||
|
|
|
@ -37,8 +37,8 @@ sub assertCsyncJournalOk {
|
||||||
my $path = $_[0];
|
my $path = $_[0];
|
||||||
|
|
||||||
# FIXME: should test also remoteperm but it's not working with owncloud6
|
# FIXME: should test also remoteperm but it's not working with owncloud6
|
||||||
# my $cmd = 'sqlite3 ' . $path . '.csync_journal.db "SELECT count(*) from metadata where length(remotePerm) == 0 or length(fileId) == 0"';
|
# my $cmd = 'sqlite3 ' . $path . '._sync_*.db "SELECT count(*) from metadata where length(remotePerm) == 0 or length(fileId) == 0"';
|
||||||
my $cmd = 'sqlite3 ' . $path . '.csync_journal.db "SELECT count(*) from metadata where length(fileId) == 0"';
|
my $cmd = 'sqlite3 ' . $path . '._sync_*.db "SELECT count(*) from metadata where length(fileId) == 0"';
|
||||||
my $result = `$cmd`;
|
my $result = `$cmd`;
|
||||||
assert($result == "0");
|
assert($result == "0");
|
||||||
}
|
}
|
||||||
|
@ -170,14 +170,14 @@ assertLocalAndRemoteDir( '', 0);
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
printInfo( "move a directory in a outside read only folder" );
|
printInfo( "move a directory in a outside read only folder" );
|
||||||
system("sqlite3 " . localDir().'.csync_journal.db .dump');
|
system("sqlite3 " . localDir().'._sync_*.db .dump');
|
||||||
|
|
||||||
#Missing directory should be restored
|
#Missing directory should be restored
|
||||||
#new directory should be uploaded
|
#new directory should be uploaded
|
||||||
system("mv " . localDir().'readonlyDirectory_PERM_M_/subdir_PERM_CK_ ' . localDir().'normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_' );
|
system("mv " . localDir().'readonlyDirectory_PERM_M_/subdir_PERM_CK_ ' . localDir().'normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_' );
|
||||||
|
|
||||||
csync();
|
csync();
|
||||||
system("sqlite3 " . localDir().'.csync_journal.db .dump');
|
system("sqlite3 " . localDir().'._sync_*.db .dump');
|
||||||
assertCsyncJournalOk(localDir());
|
assertCsyncJournalOk(localDir());
|
||||||
|
|
||||||
# old name restored
|
# old name restored
|
||||||
|
@ -229,7 +229,7 @@ system("rm -r " . localDir(). "readonlyDirectory_PERM_M_/moved_PERM_CK_");
|
||||||
|
|
||||||
assertLocalAndRemoteDir( '', 0);
|
assertLocalAndRemoteDir( '', 0);
|
||||||
|
|
||||||
system("sqlite3 " . localDir().'.csync_journal.db .dump');
|
system("sqlite3 " . localDir().'._sync_*.db .dump');
|
||||||
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
Loading…
Reference in a new issue