backuptarget: add default at provisioning time (again)
we clear the db in the tests. the tests run the setup again and again. so, it's easier to add default values in provision time instead of migration.
This commit is contained in:
@@ -5,6 +5,7 @@ exports = module.exports = {
|
||||
getPrimary,
|
||||
list,
|
||||
add,
|
||||
addDefault,
|
||||
del,
|
||||
|
||||
setConfig,
|
||||
@@ -516,6 +517,22 @@ async function add(data, auditSource) {
|
||||
return id;
|
||||
}
|
||||
|
||||
async function addDefault(auditSource) {
|
||||
assert.strictEqual(typeof auditSource, 'object');
|
||||
|
||||
debug('addDefault: adding default backup target');
|
||||
const defaultBackupTarget = {
|
||||
name: 'Default',
|
||||
provider: 'filesystem',
|
||||
config: { backupDir: paths.DEFAULT_BACKUP_DIR },
|
||||
retention: { keepWithinSecs: 2 * 24 * 60 * 60 },
|
||||
schedule: '00 00 23 * * *',
|
||||
format: 'tgz'
|
||||
};
|
||||
defaultBackupTarget.id = await add(defaultBackupTarget, auditSource);
|
||||
await setPrimary(defaultBackupTarget, auditSource);
|
||||
}
|
||||
|
||||
// creates a backup target object that is not in the database
|
||||
async function createPseudo(data) {
|
||||
assert.strictEqual(typeof data, 'object');
|
||||
|
||||
Reference in New Issue
Block a user