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:
@@ -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