Add encryptionVersion to backups
this will identify the old style backups and warn user that a restore doesn't work anymore
This commit is contained in:
@@ -95,6 +95,7 @@ describe('backups', function () {
|
||||
describe('cleanup', function () {
|
||||
var BACKUP_0 = {
|
||||
id: 'backup-box-0',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_BOX,
|
||||
dependsOn: [ 'backup-app-00', 'backup-app-01' ],
|
||||
@@ -104,6 +105,7 @@ describe('backups', function () {
|
||||
|
||||
var BACKUP_0_APP_0 = {
|
||||
id: 'backup-app-00',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_APP,
|
||||
dependsOn: [],
|
||||
@@ -113,6 +115,7 @@ describe('backups', function () {
|
||||
|
||||
var BACKUP_0_APP_1 = {
|
||||
id: 'backup-app-01',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_APP,
|
||||
dependsOn: [],
|
||||
@@ -122,6 +125,7 @@ describe('backups', function () {
|
||||
|
||||
var BACKUP_1 = {
|
||||
id: 'backup-box-1',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_BOX,
|
||||
dependsOn: [ 'backup-app-10', 'backup-app-11' ],
|
||||
@@ -131,6 +135,7 @@ describe('backups', function () {
|
||||
|
||||
var BACKUP_1_APP_0 = {
|
||||
id: 'backup-app-10',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_APP,
|
||||
dependsOn: [],
|
||||
@@ -140,6 +145,7 @@ describe('backups', function () {
|
||||
|
||||
var BACKUP_1_APP_1 = {
|
||||
id: 'backup-app-11',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_APP,
|
||||
dependsOn: [],
|
||||
|
||||
@@ -1324,6 +1324,7 @@ describe('database', function () {
|
||||
it('add succeeds', function (done) {
|
||||
var backup = {
|
||||
id: 'backup-box',
|
||||
encryptionVersion: 2,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_BOX,
|
||||
dependsOn: [ 'dep1' ],
|
||||
@@ -1340,6 +1341,7 @@ describe('database', function () {
|
||||
it('get succeeds', function (done) {
|
||||
backupdb.get('backup-box', function (error, result) {
|
||||
expect(error).to.be(null);
|
||||
expect(result.encryptionVersion).to.be(2);
|
||||
expect(result.packageVersion).to.be('1.0.0');
|
||||
expect(result.type).to.be(backupdb.BACKUP_TYPE_BOX);
|
||||
expect(result.creationTime).to.be.a(Date);
|
||||
@@ -1365,6 +1367,7 @@ describe('database', function () {
|
||||
expect(results.length).to.be(1);
|
||||
|
||||
expect(results[0].id).to.be('backup-box');
|
||||
expect(results[0].encryptionVersion).to.be(2);
|
||||
expect(results[0].packageVersion).to.be('1.0.0');
|
||||
expect(results[0].dependsOn).to.eql(['dep1']);
|
||||
expect(results[0].manifest).to.eql(null);
|
||||
@@ -1390,6 +1393,7 @@ describe('database', function () {
|
||||
it('add app succeeds', function (done) {
|
||||
var backup = {
|
||||
id: 'app_appid_123',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_APP,
|
||||
dependsOn: [ ],
|
||||
@@ -1406,6 +1410,7 @@ describe('database', function () {
|
||||
it('get succeeds', function (done) {
|
||||
backupdb.get('app_appid_123', function (error, result) {
|
||||
expect(error).to.be(null);
|
||||
expect(result.encryptionVersion).to.be(null);
|
||||
expect(result.packageVersion).to.be('1.0.0');
|
||||
expect(result.type).to.be(backupdb.BACKUP_TYPE_APP);
|
||||
expect(result.creationTime).to.be.a(Date);
|
||||
@@ -1422,6 +1427,7 @@ describe('database', function () {
|
||||
expect(results.length).to.be(1);
|
||||
|
||||
expect(results[0].id).to.be('app_appid_123');
|
||||
expect(results[0].encryptionVersion).to.be(null);
|
||||
expect(results[0].packageVersion).to.be('1.0.0');
|
||||
expect(results[0].dependsOn).to.eql([]);
|
||||
expect(results[0].manifest).to.eql({ foo: 'bar' });
|
||||
|
||||
Reference in New Issue
Block a user