backups: use a real targetId
This commit is contained in:
+17
-1
@@ -173,6 +173,8 @@ exports = module.exports = {
|
||||
checkMails,
|
||||
clearMailQueue,
|
||||
|
||||
getDefaultBackupTarget,
|
||||
|
||||
mockApiServerOrigin: 'http://localhost:6060',
|
||||
dashboardDomain: domain.domain,
|
||||
dashboardFqdn: `my.${domain.domain}`,
|
||||
@@ -218,7 +220,16 @@ async function databaseSetup() {
|
||||
await database._clear();
|
||||
await appstore._setApiServerOrigin(exports.mockApiServerOrigin);
|
||||
await dashboard._setLocation(constants.DASHBOARD_SUBDOMAIN, exports.dashboardDomain);
|
||||
await backupTargets._addDefault();
|
||||
|
||||
// duplicated here since we clear the database
|
||||
await backupTargets.add({
|
||||
provider: 'filesystem',
|
||||
label: '',
|
||||
config: { backupFolder: '/tmp/boxtest' },
|
||||
format: 'tgz',
|
||||
retention: { keepWithinSecs: 2 * 24 * 60 * 60 },
|
||||
schedule: '00 00 23 * * *'
|
||||
});
|
||||
}
|
||||
|
||||
async function domainSetup() {
|
||||
@@ -263,3 +274,8 @@ async function checkMails(number) {
|
||||
// return for further investigation
|
||||
return emails;
|
||||
}
|
||||
|
||||
async function getDefaultBackupTarget() {
|
||||
const result = await backupTargets.list(1, 1);
|
||||
return result[0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user