1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Combine chmod commands in tests for efficiency.

This commit is contained in:
David Steele 2016-02-11 21:40:43 -05:00
parent f360d5072e
commit 17cbab524a
2 changed files with 12 additions and 30 deletions

View File

@ -1194,8 +1194,7 @@ sub BackRestTestBackup_BackupCompare
# Change mode on the backup path so it can be read
if ($bRemote)
{
executeTest('chmod 750 ' . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
executeTest('chmod 750 ' . BackRestTestCommon_RepoPathGet(), {bRemote => true});
}
my %oActualManifest;
@ -1221,8 +1220,7 @@ sub BackRestTestBackup_BackupCompare
# Change mode on the backup path back before unit tests continue
if ($bRemote)
{
executeTest('chmod 700 ' . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
executeTest('chmod 700 ' . BackRestTestCommon_RepoPathGet(), {bRemote => true});
}
$oFile->remove(PATH_ABSOLUTE, "${strTestPath}/expected.manifest");
@ -1256,9 +1254,8 @@ sub BackRestTestBackup_ManifestMunge
# Change mode on the backup path so it can be read/written
if ($bRemote)
{
executeTest('chmod 750 ' . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
executeTest('chmod 770 ' . $oFile->pathGet(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST,
executeTest('chmod 750 ' . BackRestTestCommon_RepoPathGet() .
' && chmod 770 ' . $oFile->pathGet(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST,
{bRemote => true});
}
@ -1306,9 +1303,8 @@ sub BackRestTestBackup_ManifestMunge
# Change mode on the backup path back before unit tests continue
if ($bRemote)
{
executeTest('chmod 750 ' . $oFile->pathGet(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST,
{bRemote => true});
executeTest('chmod 700 ' . BackRestTestCommon_RepoPathGet(),
executeTest('chmod 750 ' . $oFile->pathGet(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST .
' && chmod 700 ' . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
}
}

View File

@ -516,20 +516,14 @@ sub BackRestTestCommon_manifestSave
if ($bRemote)
{
executeTest("chmod g+x " . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
executeTest("chmod g+w " . $strFileName,
{bRemote => true});
executeTest('chmod g+x ' . BackRestTestCommon_RepoPathGet() . ' && chmod g+w ' . dirname($strFileName), {bRemote => true});
}
$oManifest->save();
if ($bRemote)
{
executeTest("chmod g-w " . $strFileName,
{bRemote => true});
executeTest("chmod g-x " . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
executeTest('chmod g-w ' . dirname($strFileName) . ' && chmod g-x ' . BackRestTestCommon_RepoPathGet(), {bRemote => true});
}
}
@ -547,16 +541,14 @@ sub BackRestTestCommon_iniLoad
if ($bRemote)
{
executeTest("chmod g+x " . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
executeTest("chmod g+x " . BackRestTestCommon_RepoPathGet(), {bRemote => true});
}
iniLoad($strFileName, $oIniRef);
if ($bRemote)
{
executeTest("chmod g-x " . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
executeTest("chmod g-x " . BackRestTestCommon_RepoPathGet(), {bRemote => true});
}
}
@ -575,10 +567,7 @@ sub BackRestTestCommon_iniSave
if ($bRemote)
{
executeTest("chmod g+x " . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
executeTest("chmod g+w " . $strFileName,
{bRemote => true});
executeTest('chmod g+x ' . BackRestTestCommon_RepoPathGet() . ' && chmod g+w ' . $strFileName, {bRemote => true});
}
# Calculate a new checksum if requested
@ -597,10 +586,7 @@ sub BackRestTestCommon_iniSave
if ($bRemote)
{
executeTest("chmod g-w " . $strFileName,
{bRemote => true});
executeTest("chmod g-x " . BackRestTestCommon_RepoPathGet(),
{bRemote => true});
executeTest("chmod g-w " . $strFileName . ' && chmod g-x ' . BackRestTestCommon_RepoPathGet(), {bRemote => true});
}
}