@itentialopensource/adapter-viptela 0.10.5 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/adapter.js +489 -0
- package/adapterBase.js +135 -59
- package/entities/Template/action.json +9 -173
- package/entities/Template/mockdatafiles/editVSmartTemplate-default.json +6 -0
- package/entities/Template/mockdatafiles/generateMasterTemplateList-default.json +5 -0
- package/entities/Template/schema.json +6 -14
- package/package.json +2 -2
- package/pronghorn.json +318 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +3 -3
- package/sampleProperties.json +35 -29
- package/test/integration/adapterTestIntegration.js +158 -0
- package/test/unit/adapterBaseTestUnit.js +5 -5
- package/test/unit/adapterTestUnit.js +157 -0
|
@@ -862,7 +862,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
862
862
|
});
|
|
863
863
|
it('should return no updated if no changes are provided', (done) => {
|
|
864
864
|
try {
|
|
865
|
-
a.iapUpdateAdapterConfiguration(null, null, null, null, null, (data, error) => {
|
|
865
|
+
a.iapUpdateAdapterConfiguration(null, null, null, null, null, null, (data, error) => {
|
|
866
866
|
try {
|
|
867
867
|
assert.equal('No configuration updates to make', data.response);
|
|
868
868
|
done();
|
|
@@ -878,7 +878,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
878
878
|
}).timeout(attemptTimeout);
|
|
879
879
|
it('should throw an error if missing configuration file', (done) => {
|
|
880
880
|
try {
|
|
881
|
-
a.iapUpdateAdapterConfiguration(null, { name: 'fakeChange' }, null, null, null, (data, error) => {
|
|
881
|
+
a.iapUpdateAdapterConfiguration(null, { name: 'fakeChange' }, null, null, null, null, (data, error) => {
|
|
882
882
|
try {
|
|
883
883
|
const displayE = 'configFile is required';
|
|
884
884
|
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
@@ -895,7 +895,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
895
895
|
}).timeout(attemptTimeout);
|
|
896
896
|
it('if not package.json, entity is required', (done) => {
|
|
897
897
|
try {
|
|
898
|
-
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, null, null, null, (data, error) => {
|
|
898
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, null, null, null, null, (data, error) => {
|
|
899
899
|
try {
|
|
900
900
|
const displayE = 'Unsupported Configuration Change or Missing Entity';
|
|
901
901
|
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
@@ -912,7 +912,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
912
912
|
}).timeout(attemptTimeout);
|
|
913
913
|
it('if not package.json, type is required', (done) => {
|
|
914
914
|
try {
|
|
915
|
-
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'entity', null, null, (data, error) => {
|
|
915
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'entity', null, null, null, (data, error) => {
|
|
916
916
|
try {
|
|
917
917
|
const displayE = 'type is required';
|
|
918
918
|
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
@@ -929,7 +929,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
929
929
|
}).timeout(attemptTimeout);
|
|
930
930
|
it('if not package.json, entity must be valid', (done) => {
|
|
931
931
|
try {
|
|
932
|
-
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'fakeEntity', 'fakeType', null, (data, error) => {
|
|
932
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'fakeEntity', 'fakeType', null, null, (data, error) => {
|
|
933
933
|
try {
|
|
934
934
|
const displayE = 'Incomplete Configuration Change: Invalid Entity - fakeEntity';
|
|
935
935
|
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
@@ -3380,6 +3380,163 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
3380
3380
|
}).timeout(attemptTimeout);
|
|
3381
3381
|
});
|
|
3382
3382
|
|
|
3383
|
+
describe('#generateMasterTemplateList - errors', () => {
|
|
3384
|
+
it('should have a generateMasterTemplateList function', (done) => {
|
|
3385
|
+
try {
|
|
3386
|
+
assert.equal(true, typeof a.generateMasterTemplateList === 'function');
|
|
3387
|
+
done();
|
|
3388
|
+
} catch (error) {
|
|
3389
|
+
log.error(`Test Failure: ${error}`);
|
|
3390
|
+
done(error);
|
|
3391
|
+
}
|
|
3392
|
+
}).timeout(attemptTimeout);
|
|
3393
|
+
it('should error if - missing feature', (done) => {
|
|
3394
|
+
try {
|
|
3395
|
+
a.generateMasterTemplateList(null, (data, error) => {
|
|
3396
|
+
try {
|
|
3397
|
+
const displayE = 'feature is required';
|
|
3398
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-generateMasterTemplateList', displayE);
|
|
3399
|
+
done();
|
|
3400
|
+
} catch (err) {
|
|
3401
|
+
log.error(`Test Failure: ${err}`);
|
|
3402
|
+
done(err);
|
|
3403
|
+
}
|
|
3404
|
+
});
|
|
3405
|
+
} catch (error) {
|
|
3406
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3407
|
+
done(error);
|
|
3408
|
+
}
|
|
3409
|
+
}).timeout(attemptTimeout);
|
|
3410
|
+
});
|
|
3411
|
+
|
|
3412
|
+
describe('#editMasterTemplate - errors', () => {
|
|
3413
|
+
it('should have a editMasterTemplate function', (done) => {
|
|
3414
|
+
try {
|
|
3415
|
+
assert.equal(true, typeof a.editMasterTemplate === 'function');
|
|
3416
|
+
done();
|
|
3417
|
+
} catch (error) {
|
|
3418
|
+
log.error(`Test Failure: ${error}`);
|
|
3419
|
+
done(error);
|
|
3420
|
+
}
|
|
3421
|
+
}).timeout(attemptTimeout);
|
|
3422
|
+
it('should error if - missing templateId', (done) => {
|
|
3423
|
+
try {
|
|
3424
|
+
a.editMasterTemplate(null, null, (data, error) => {
|
|
3425
|
+
try {
|
|
3426
|
+
const displayE = 'templateId is required';
|
|
3427
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-editMasterTemplate', displayE);
|
|
3428
|
+
done();
|
|
3429
|
+
} catch (err) {
|
|
3430
|
+
log.error(`Test Failure: ${err}`);
|
|
3431
|
+
done(err);
|
|
3432
|
+
}
|
|
3433
|
+
});
|
|
3434
|
+
} catch (error) {
|
|
3435
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3436
|
+
done(error);
|
|
3437
|
+
}
|
|
3438
|
+
}).timeout(attemptTimeout);
|
|
3439
|
+
});
|
|
3440
|
+
|
|
3441
|
+
describe('#createVSmartTemplate - errors', () => {
|
|
3442
|
+
it('should have a createVSmartTemplate function', (done) => {
|
|
3443
|
+
try {
|
|
3444
|
+
assert.equal(true, typeof a.createVSmartTemplate === 'function');
|
|
3445
|
+
done();
|
|
3446
|
+
} catch (error) {
|
|
3447
|
+
log.error(`Test Failure: ${error}`);
|
|
3448
|
+
done(error);
|
|
3449
|
+
}
|
|
3450
|
+
}).timeout(attemptTimeout);
|
|
3451
|
+
});
|
|
3452
|
+
|
|
3453
|
+
describe('#getTemplateByPolicyId - errors', () => {
|
|
3454
|
+
it('should have a getTemplateByPolicyId function', (done) => {
|
|
3455
|
+
try {
|
|
3456
|
+
assert.equal(true, typeof a.getTemplateByPolicyId === 'function');
|
|
3457
|
+
done();
|
|
3458
|
+
} catch (error) {
|
|
3459
|
+
log.error(`Test Failure: ${error}`);
|
|
3460
|
+
done(error);
|
|
3461
|
+
}
|
|
3462
|
+
}).timeout(attemptTimeout);
|
|
3463
|
+
it('should error if - missing policyId', (done) => {
|
|
3464
|
+
try {
|
|
3465
|
+
a.getTemplateByPolicyId(null, (data, error) => {
|
|
3466
|
+
try {
|
|
3467
|
+
const displayE = 'policyId is required';
|
|
3468
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getTemplateByPolicyId', displayE);
|
|
3469
|
+
done();
|
|
3470
|
+
} catch (err) {
|
|
3471
|
+
log.error(`Test Failure: ${err}`);
|
|
3472
|
+
done(err);
|
|
3473
|
+
}
|
|
3474
|
+
});
|
|
3475
|
+
} catch (error) {
|
|
3476
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3477
|
+
done(error);
|
|
3478
|
+
}
|
|
3479
|
+
}).timeout(attemptTimeout);
|
|
3480
|
+
});
|
|
3481
|
+
|
|
3482
|
+
describe('#editVSmartTemplate - errors', () => {
|
|
3483
|
+
it('should have a editVSmartTemplate function', (done) => {
|
|
3484
|
+
try {
|
|
3485
|
+
assert.equal(true, typeof a.editVSmartTemplate === 'function');
|
|
3486
|
+
done();
|
|
3487
|
+
} catch (error) {
|
|
3488
|
+
log.error(`Test Failure: ${error}`);
|
|
3489
|
+
done(error);
|
|
3490
|
+
}
|
|
3491
|
+
}).timeout(attemptTimeout);
|
|
3492
|
+
it('should error if - missing policyId', (done) => {
|
|
3493
|
+
try {
|
|
3494
|
+
a.editVSmartTemplate(null, null, (data, error) => {
|
|
3495
|
+
try {
|
|
3496
|
+
const displayE = 'policyId is required';
|
|
3497
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-editVSmartTemplate', displayE);
|
|
3498
|
+
done();
|
|
3499
|
+
} catch (err) {
|
|
3500
|
+
log.error(`Test Failure: ${err}`);
|
|
3501
|
+
done(err);
|
|
3502
|
+
}
|
|
3503
|
+
});
|
|
3504
|
+
} catch (error) {
|
|
3505
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3506
|
+
done(error);
|
|
3507
|
+
}
|
|
3508
|
+
}).timeout(attemptTimeout);
|
|
3509
|
+
});
|
|
3510
|
+
|
|
3511
|
+
describe('#deleteVSmartTemplate - errors', () => {
|
|
3512
|
+
it('should have a deleteVSmartTemplate function', (done) => {
|
|
3513
|
+
try {
|
|
3514
|
+
assert.equal(true, typeof a.deleteVSmartTemplate === 'function');
|
|
3515
|
+
done();
|
|
3516
|
+
} catch (error) {
|
|
3517
|
+
log.error(`Test Failure: ${error}`);
|
|
3518
|
+
done(error);
|
|
3519
|
+
}
|
|
3520
|
+
}).timeout(attemptTimeout);
|
|
3521
|
+
it('should error if - missing policyId', (done) => {
|
|
3522
|
+
try {
|
|
3523
|
+
a.deleteVSmartTemplate(null, (data, error) => {
|
|
3524
|
+
try {
|
|
3525
|
+
const displayE = 'policyId is required';
|
|
3526
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-deleteVSmartTemplate', displayE);
|
|
3527
|
+
done();
|
|
3528
|
+
} catch (err) {
|
|
3529
|
+
log.error(`Test Failure: ${err}`);
|
|
3530
|
+
done(err);
|
|
3531
|
+
}
|
|
3532
|
+
});
|
|
3533
|
+
} catch (error) {
|
|
3534
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3535
|
+
done(error);
|
|
3536
|
+
}
|
|
3537
|
+
}).timeout(attemptTimeout);
|
|
3538
|
+
});
|
|
3539
|
+
|
|
3383
3540
|
describe('#getRunningConfig - errors', () => {
|
|
3384
3541
|
it('should have a getRunningConfig function', (done) => {
|
|
3385
3542
|
try {
|