@itentialopensource/adapter-viptela 0.7.0 → 0.9.0
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/.eslintignore +1 -0
- package/CHANGELOG.md +32 -0
- package/README.md +182 -24
- package/adapter.js +7374 -666
- package/adapterBase.js +285 -7
- package/entities/.generic/action.json +109 -0
- package/entities/.generic/schema.json +23 -0
- package/entities/.system/action.json +5 -4
- package/entities/.system/schemaTokenReq.json +2 -2
- package/entities/.system/schemaTokenResp.json +12 -0
- package/entities/MonitoringDeviceDetails/action.json +4 -2
- package/entities/Statistic/action.json +24 -0
- package/entities/Statistic/schema.json +19 -0
- package/entities/System/action.json +311 -0
- package/entities/System/schema.json +33 -0
- package/entities/Template/action.json +1417 -1
- package/entities/Template/schema.json +71 -2
- package/error.json +6 -0
- package/package.json +40 -19
- package/pronghorn.json +3509 -560
- package/propertiesSchema.json +51 -4
- package/refs?service=git-upload-pack +0 -0
- package/report/updateReport1612559221344.json +95 -0
- package/report/updateReport1642735010496.json +95 -0
- package/sampleProperties.json +21 -5
- package/test/integration/adapterTestBasicGet.js +85 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +1690 -7
- package/test/unit/adapterBaseTestUnit.js +944 -0
- package/test/unit/adapterTestUnit.js +2007 -12
- package/utils/addAuth.js +94 -0
- package/utils/basicGet.js +50 -0
- package/utils/checkMigrate.js +63 -0
- package/utils/entitiesToDB.js +224 -0
- package/utils/findPath.js +74 -0
- package/utils/modify.js +154 -0
- package/utils/packModificationScript.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/removeHooks.js +20 -0
- package/utils/tbScript.js +169 -0
- package/utils/tbUtils.js +451 -0
- package/utils/troubleshootingAdapter.js +190 -0
|
@@ -23,7 +23,7 @@ const anything = td.matchers.anything();
|
|
|
23
23
|
let logLevel = 'none';
|
|
24
24
|
const stub = true;
|
|
25
25
|
const isRapidFail = false;
|
|
26
|
-
const attemptTimeout =
|
|
26
|
+
const attemptTimeout = 600000;
|
|
27
27
|
|
|
28
28
|
// these variables can be changed to run in integrated mode so easier to set them here
|
|
29
29
|
// always check these in with bogus data!!!
|
|
@@ -64,11 +64,16 @@ global.pronghornProps = {
|
|
|
64
64
|
token_cache: 'local',
|
|
65
65
|
invalid_token_error: 401,
|
|
66
66
|
auth_field: 'header.headers.Authorization',
|
|
67
|
-
auth_field_format: 'Basic {b64}{username}:{password}{/b64}'
|
|
67
|
+
auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
|
|
68
|
+
auth_logging: false,
|
|
69
|
+
client_id: '',
|
|
70
|
+
client_secret: '',
|
|
71
|
+
grant_type: ''
|
|
68
72
|
},
|
|
69
73
|
healthcheck: {
|
|
70
74
|
type: 'startup',
|
|
71
|
-
frequency: 60000
|
|
75
|
+
frequency: 60000,
|
|
76
|
+
query_object: {}
|
|
72
77
|
},
|
|
73
78
|
throttle: {
|
|
74
79
|
throttle_enabled: false,
|
|
@@ -99,13 +104,16 @@ global.pronghornProps = {
|
|
|
99
104
|
},
|
|
100
105
|
healthcheck_on_timeout: false,
|
|
101
106
|
return_raw: true,
|
|
102
|
-
archiving: false
|
|
107
|
+
archiving: false,
|
|
108
|
+
return_request: false
|
|
103
109
|
},
|
|
104
110
|
proxy: {
|
|
105
111
|
enabled: false,
|
|
106
112
|
host: '',
|
|
107
113
|
port: 1,
|
|
108
|
-
protocol: 'http'
|
|
114
|
+
protocol: 'http',
|
|
115
|
+
username: '',
|
|
116
|
+
password: ''
|
|
109
117
|
},
|
|
110
118
|
ssl: {
|
|
111
119
|
ecdhCurve: '',
|
|
@@ -193,7 +201,7 @@ function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
|
193
201
|
}
|
|
194
202
|
|
|
195
203
|
// require the adapter that we are going to be using
|
|
196
|
-
const Viptela = require('../../adapter
|
|
204
|
+
const Viptela = require('../../adapter');
|
|
197
205
|
|
|
198
206
|
// delete the .DS_Store directory in entities -- otherwise this will cause errors
|
|
199
207
|
const dirPath = path.join(__dirname, '../../entities/.DS_Store');
|
|
@@ -235,6 +243,8 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
235
243
|
try {
|
|
236
244
|
assert.notEqual(null, a);
|
|
237
245
|
assert.notEqual(undefined, a);
|
|
246
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
247
|
+
assert.equal(checkId, a.id);
|
|
238
248
|
assert.notEqual(null, a.allProps);
|
|
239
249
|
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
240
250
|
assert.equal(check, a.healthcheckType);
|
|
@@ -264,7 +274,7 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
264
274
|
describe('#getWorkflowFunctions', () => {
|
|
265
275
|
it('should retrieve workflow functions', (done) => {
|
|
266
276
|
try {
|
|
267
|
-
wffunctions = a.getWorkflowFunctions();
|
|
277
|
+
wffunctions = a.getWorkflowFunctions([]);
|
|
268
278
|
|
|
269
279
|
try {
|
|
270
280
|
assert.notEqual(0, wffunctions.length);
|
|
@@ -316,13 +326,103 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
316
326
|
done(error);
|
|
317
327
|
}
|
|
318
328
|
});
|
|
319
|
-
it('package.json should be customized', (done) => {
|
|
329
|
+
it('package.json standard fields should be customized', (done) => {
|
|
320
330
|
try {
|
|
321
331
|
const packageDotJson = require('../../package.json');
|
|
322
332
|
assert.notEqual(-1, packageDotJson.name.indexOf('viptela'));
|
|
323
333
|
assert.notEqual(undefined, packageDotJson.version);
|
|
324
334
|
assert.notEqual(null, packageDotJson.version);
|
|
325
335
|
assert.notEqual('', packageDotJson.version);
|
|
336
|
+
assert.notEqual(undefined, packageDotJson.description);
|
|
337
|
+
assert.notEqual(null, packageDotJson.description);
|
|
338
|
+
assert.notEqual('', packageDotJson.description);
|
|
339
|
+
assert.equal('adapter.js', packageDotJson.main);
|
|
340
|
+
assert.notEqual(undefined, packageDotJson.wizardVersion);
|
|
341
|
+
assert.notEqual(null, packageDotJson.wizardVersion);
|
|
342
|
+
assert.notEqual('', packageDotJson.wizardVersion);
|
|
343
|
+
assert.notEqual(undefined, packageDotJson.engineVersion);
|
|
344
|
+
assert.notEqual(null, packageDotJson.engineVersion);
|
|
345
|
+
assert.notEqual('', packageDotJson.engineVersion);
|
|
346
|
+
assert.equal('http', packageDotJson.adapterType);
|
|
347
|
+
done();
|
|
348
|
+
} catch (error) {
|
|
349
|
+
log.error(`Test Failure: ${error}`);
|
|
350
|
+
done(error);
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
it('package.json proper scripts should be provided', (done) => {
|
|
354
|
+
try {
|
|
355
|
+
const packageDotJson = require('../../package.json');
|
|
356
|
+
assert.notEqual(undefined, packageDotJson.scripts);
|
|
357
|
+
assert.notEqual(null, packageDotJson.scripts);
|
|
358
|
+
assert.notEqual('', packageDotJson.scripts);
|
|
359
|
+
assert.equal('node utils/setup.js && npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions', packageDotJson.scripts.preinstall);
|
|
360
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
|
|
361
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
|
|
362
|
+
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
|
|
363
|
+
assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
|
|
364
|
+
assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
|
|
365
|
+
assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
|
|
366
|
+
assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
|
|
367
|
+
assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
|
|
368
|
+
assert.equal('npm run deploy', packageDotJson.scripts.build);
|
|
369
|
+
done();
|
|
370
|
+
} catch (error) {
|
|
371
|
+
log.error(`Test Failure: ${error}`);
|
|
372
|
+
done(error);
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
it('package.json proper directories should be provided', (done) => {
|
|
376
|
+
try {
|
|
377
|
+
const packageDotJson = require('../../package.json');
|
|
378
|
+
assert.notEqual(undefined, packageDotJson.repository);
|
|
379
|
+
assert.notEqual(null, packageDotJson.repository);
|
|
380
|
+
assert.notEqual('', packageDotJson.repository);
|
|
381
|
+
assert.equal('git', packageDotJson.repository.type);
|
|
382
|
+
assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
|
|
383
|
+
assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
|
|
384
|
+
done();
|
|
385
|
+
} catch (error) {
|
|
386
|
+
log.error(`Test Failure: ${error}`);
|
|
387
|
+
done(error);
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
it('package.json proper dependencies should be provided', (done) => {
|
|
391
|
+
try {
|
|
392
|
+
const packageDotJson = require('../../package.json');
|
|
393
|
+
assert.notEqual(undefined, packageDotJson.dependencies);
|
|
394
|
+
assert.notEqual(null, packageDotJson.dependencies);
|
|
395
|
+
assert.notEqual('', packageDotJson.dependencies);
|
|
396
|
+
assert.equal('^6.12.0', packageDotJson.dependencies.ajv);
|
|
397
|
+
assert.equal('^0.21.0', packageDotJson.dependencies.axios);
|
|
398
|
+
assert.equal('^2.20.0', packageDotJson.dependencies.commander);
|
|
399
|
+
assert.equal('^8.1.0', packageDotJson.dependencies['fs-extra']);
|
|
400
|
+
assert.equal('^9.0.1', packageDotJson.dependencies.mocha);
|
|
401
|
+
assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
|
|
402
|
+
assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
|
|
403
|
+
assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
|
|
404
|
+
assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
|
|
405
|
+
assert.equal('^7.3.2', packageDotJson.dependencies.semver);
|
|
406
|
+
assert.equal('^3.3.3', packageDotJson.dependencies.winston);
|
|
407
|
+
done();
|
|
408
|
+
} catch (error) {
|
|
409
|
+
log.error(`Test Failure: ${error}`);
|
|
410
|
+
done(error);
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
it('package.json proper dev dependencies should be provided', (done) => {
|
|
414
|
+
try {
|
|
415
|
+
const packageDotJson = require('../../package.json');
|
|
416
|
+
assert.notEqual(undefined, packageDotJson.devDependencies);
|
|
417
|
+
assert.notEqual(null, packageDotJson.devDependencies);
|
|
418
|
+
assert.notEqual('', packageDotJson.devDependencies);
|
|
419
|
+
assert.equal('^4.3.4', packageDotJson.devDependencies.chai);
|
|
420
|
+
assert.equal('^7.29.0', packageDotJson.devDependencies.eslint);
|
|
421
|
+
assert.equal('^14.2.1', packageDotJson.devDependencies['eslint-config-airbnb-base']);
|
|
422
|
+
assert.equal('^2.23.4', packageDotJson.devDependencies['eslint-plugin-import']);
|
|
423
|
+
assert.equal('^3.0.0', packageDotJson.devDependencies['eslint-plugin-json']);
|
|
424
|
+
assert.equal('^0.6.3', packageDotJson.devDependencies['package-json-validator']);
|
|
425
|
+
assert.equal('^3.16.1', packageDotJson.devDependencies.testdouble);
|
|
326
426
|
done();
|
|
327
427
|
} catch (error) {
|
|
328
428
|
log.error(`Test Failure: ${error}`);
|
|
@@ -347,8 +447,34 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
347
447
|
try {
|
|
348
448
|
const pronghornDotJson = require('../../pronghorn.json');
|
|
349
449
|
assert.notEqual(-1, pronghornDotJson.id.indexOf('viptela'));
|
|
450
|
+
assert.equal('Adapter', pronghornDotJson.type);
|
|
350
451
|
assert.equal('Viptela', pronghornDotJson.export);
|
|
351
452
|
assert.equal('Viptela', pronghornDotJson.title);
|
|
453
|
+
assert.equal('adapter.js', pronghornDotJson.src);
|
|
454
|
+
done();
|
|
455
|
+
} catch (error) {
|
|
456
|
+
log.error(`Test Failure: ${error}`);
|
|
457
|
+
done(error);
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
it('pronghorn.json should contain generic adapter methods', (done) => {
|
|
461
|
+
try {
|
|
462
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
463
|
+
assert.notEqual(undefined, pronghornDotJson.methods);
|
|
464
|
+
assert.notEqual(null, pronghornDotJson.methods);
|
|
465
|
+
assert.notEqual('', pronghornDotJson.methods);
|
|
466
|
+
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
467
|
+
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
468
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'updateAdapterConfiguration'));
|
|
469
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'findPath'));
|
|
470
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'troubleshoot'));
|
|
471
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'runHealthcheck'));
|
|
472
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'runConnectivity'));
|
|
473
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'runBasicGet'));
|
|
474
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'suspend'));
|
|
475
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'unsuspend'));
|
|
476
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getQueue'));
|
|
477
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
352
478
|
done();
|
|
353
479
|
} catch (error) {
|
|
354
480
|
log.error(`Test Failure: ${error}`);
|
|
@@ -370,7 +496,7 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
370
496
|
let wfparams = [];
|
|
371
497
|
|
|
372
498
|
if (methLine && methLine.indexOf('(') >= 0 && methLine.indexOf(')') >= 0) {
|
|
373
|
-
const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.
|
|
499
|
+
const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.lastIndexOf(')'));
|
|
374
500
|
wfparams = temp.split(',');
|
|
375
501
|
|
|
376
502
|
for (let t = 0; t < wfparams.length; t += 1) {
|
|
@@ -487,6 +613,117 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
487
613
|
try {
|
|
488
614
|
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
489
615
|
assert.equal('adapter-viptela', propertiesDotJson.$id);
|
|
616
|
+
assert.equal('object', propertiesDotJson.type);
|
|
617
|
+
assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
|
|
618
|
+
done();
|
|
619
|
+
} catch (error) {
|
|
620
|
+
log.error(`Test Failure: ${error}`);
|
|
621
|
+
done(error);
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
it('propertiesSchema.json should contain generic adapter properties', (done) => {
|
|
625
|
+
try {
|
|
626
|
+
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
627
|
+
assert.notEqual(undefined, propertiesDotJson.properties);
|
|
628
|
+
assert.notEqual(null, propertiesDotJson.properties);
|
|
629
|
+
assert.notEqual('', propertiesDotJson.properties);
|
|
630
|
+
assert.equal('string', propertiesDotJson.properties.host.type);
|
|
631
|
+
assert.equal('integer', propertiesDotJson.properties.port.type);
|
|
632
|
+
assert.equal('boolean', propertiesDotJson.properties.stub.type);
|
|
633
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
|
|
634
|
+
assert.notEqual(null, propertiesDotJson.definitions.authentication);
|
|
635
|
+
assert.notEqual('', propertiesDotJson.definitions.authentication);
|
|
636
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
|
|
637
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
|
|
638
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
|
|
639
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
|
|
640
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
|
|
641
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
|
|
642
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
|
|
643
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
|
|
644
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
|
|
645
|
+
assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
|
|
646
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
|
|
647
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
|
|
648
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
|
|
649
|
+
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
650
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
651
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
652
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
|
|
653
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
|
|
654
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
|
|
655
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
|
|
656
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
|
|
657
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
|
|
658
|
+
assert.equal('string', propertiesDotJson.properties.base_path.type);
|
|
659
|
+
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
660
|
+
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
661
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
662
|
+
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
663
|
+
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
664
|
+
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
665
|
+
assert.notEqual(null, propertiesDotJson.definitions);
|
|
666
|
+
assert.notEqual('', propertiesDotJson.definitions);
|
|
667
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
|
|
668
|
+
assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
|
|
669
|
+
assert.notEqual('', propertiesDotJson.definitions.healthcheck);
|
|
670
|
+
assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
|
|
671
|
+
assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
|
|
672
|
+
assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
|
|
673
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
|
|
674
|
+
assert.notEqual(null, propertiesDotJson.definitions.throttle);
|
|
675
|
+
assert.notEqual('', propertiesDotJson.definitions.throttle);
|
|
676
|
+
assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
|
|
677
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
|
|
678
|
+
assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
|
|
679
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
|
|
680
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
|
|
681
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
|
|
682
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
|
|
683
|
+
assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
|
|
684
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.request);
|
|
685
|
+
assert.notEqual(null, propertiesDotJson.definitions.request);
|
|
686
|
+
assert.notEqual('', propertiesDotJson.definitions.request);
|
|
687
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
|
|
688
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
|
|
689
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
|
|
690
|
+
assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
|
|
691
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
|
|
692
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
|
|
693
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
|
|
694
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
|
|
695
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
|
|
696
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
|
|
697
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
|
|
698
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
|
|
699
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
|
|
700
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
|
|
701
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
|
|
702
|
+
assert.notEqual(null, propertiesDotJson.definitions.proxy);
|
|
703
|
+
assert.notEqual('', propertiesDotJson.definitions.proxy);
|
|
704
|
+
assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
|
|
705
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
|
|
706
|
+
assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
|
|
707
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
|
|
708
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
|
|
709
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
|
|
710
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
711
|
+
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
712
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
|
|
713
|
+
assert.notEqual(null, propertiesDotJson.definitions.mongo);
|
|
714
|
+
assert.notEqual('', propertiesDotJson.definitions.mongo);
|
|
715
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
|
|
716
|
+
assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
|
|
717
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
|
|
718
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
|
|
719
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
|
|
720
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
|
|
721
|
+
assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
|
|
722
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
|
|
723
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
|
|
724
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
|
|
725
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
|
|
726
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
|
|
490
727
|
done();
|
|
491
728
|
} catch (error) {
|
|
492
729
|
log.error(`Test Failure: ${error}`);
|
|
@@ -507,6 +744,50 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
507
744
|
done(error);
|
|
508
745
|
}
|
|
509
746
|
});
|
|
747
|
+
it('error.json should have standard adapter errors', (done) => {
|
|
748
|
+
try {
|
|
749
|
+
const errorDotJson = require('../../error.json');
|
|
750
|
+
assert.notEqual(undefined, errorDotJson.errors);
|
|
751
|
+
assert.notEqual(null, errorDotJson.errors);
|
|
752
|
+
assert.notEqual('', errorDotJson.errors);
|
|
753
|
+
assert.equal(true, Array.isArray(errorDotJson.errors));
|
|
754
|
+
assert.notEqual(0, errorDotJson.errors.length);
|
|
755
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
|
|
756
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
|
|
757
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
|
|
758
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
|
|
759
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
|
|
760
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
|
|
761
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
|
|
762
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
|
|
763
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
|
|
764
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
|
|
765
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
|
|
766
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
|
|
767
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
|
|
768
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
|
|
769
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
|
|
770
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
|
|
771
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
|
|
772
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
|
|
773
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
|
|
774
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
|
|
775
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
|
|
776
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
|
|
777
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
|
|
778
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
|
|
779
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
|
|
780
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
|
|
781
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
|
|
782
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
|
|
783
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
|
|
784
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
|
|
785
|
+
done();
|
|
786
|
+
} catch (error) {
|
|
787
|
+
log.error(`Test Failure: ${error}`);
|
|
788
|
+
done(error);
|
|
789
|
+
}
|
|
790
|
+
});
|
|
510
791
|
});
|
|
511
792
|
|
|
512
793
|
describe('sampleProperties.json', () => {
|
|
@@ -521,6 +802,119 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
521
802
|
done(error);
|
|
522
803
|
}
|
|
523
804
|
});
|
|
805
|
+
it('sampleProperties.json should contain generic adapter properties', (done) => {
|
|
806
|
+
try {
|
|
807
|
+
const sampleDotJson = require('../../sampleProperties.json');
|
|
808
|
+
assert.notEqual(-1, sampleDotJson.id.indexOf('viptela'));
|
|
809
|
+
assert.equal('Viptela', sampleDotJson.type);
|
|
810
|
+
assert.notEqual(undefined, sampleDotJson.properties);
|
|
811
|
+
assert.notEqual(null, sampleDotJson.properties);
|
|
812
|
+
assert.notEqual('', sampleDotJson.properties);
|
|
813
|
+
assert.notEqual(undefined, sampleDotJson.properties.host);
|
|
814
|
+
assert.notEqual(undefined, sampleDotJson.properties.port);
|
|
815
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
816
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication);
|
|
817
|
+
assert.notEqual(null, sampleDotJson.properties.authentication);
|
|
818
|
+
assert.notEqual('', sampleDotJson.properties.authentication);
|
|
819
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
|
|
820
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
|
|
821
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
|
|
822
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
|
|
823
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
|
|
824
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
|
|
825
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
|
|
826
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
|
|
827
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
|
|
828
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
|
|
829
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
|
|
830
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
|
|
831
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
|
|
832
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl);
|
|
833
|
+
assert.notEqual(null, sampleDotJson.properties.ssl);
|
|
834
|
+
assert.notEqual('', sampleDotJson.properties.ssl);
|
|
835
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
|
|
836
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
|
|
837
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
|
|
838
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
|
|
839
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
|
|
840
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
841
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
842
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
843
|
+
|
|
844
|
+
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
845
|
+
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
846
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
847
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
848
|
+
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
849
|
+
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
850
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
851
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
852
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
853
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
854
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
855
|
+
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
856
|
+
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
857
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
|
|
858
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
|
|
859
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
|
|
860
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle);
|
|
861
|
+
assert.notEqual(null, sampleDotJson.properties.throttle);
|
|
862
|
+
assert.notEqual('', sampleDotJson.properties.throttle);
|
|
863
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
|
|
864
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
|
|
865
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
|
|
866
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
|
|
867
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
|
|
868
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
|
|
869
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
|
|
870
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
|
|
871
|
+
assert.notEqual(undefined, sampleDotJson.properties.request);
|
|
872
|
+
assert.notEqual(null, sampleDotJson.properties.request);
|
|
873
|
+
assert.notEqual('', sampleDotJson.properties.request);
|
|
874
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
|
|
875
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
|
|
876
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
|
|
877
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
|
|
878
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
|
|
879
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
|
|
880
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
|
|
881
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
|
|
882
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
|
|
883
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
|
|
884
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
|
|
885
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
|
|
886
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
|
|
887
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
|
|
888
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy);
|
|
889
|
+
assert.notEqual(null, sampleDotJson.properties.proxy);
|
|
890
|
+
assert.notEqual('', sampleDotJson.properties.proxy);
|
|
891
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
|
|
892
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
|
|
893
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
|
|
894
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
|
|
895
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
|
|
896
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
|
|
897
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo);
|
|
898
|
+
assert.notEqual(null, sampleDotJson.properties.mongo);
|
|
899
|
+
assert.notEqual('', sampleDotJson.properties.mongo);
|
|
900
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
|
|
901
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
|
|
902
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
|
|
903
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
|
|
904
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
|
|
905
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
|
|
906
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
|
|
907
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
|
|
908
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
|
|
909
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
910
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
911
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
|
|
912
|
+
done();
|
|
913
|
+
} catch (error) {
|
|
914
|
+
log.error(`Test Failure: ${error}`);
|
|
915
|
+
done(error);
|
|
916
|
+
}
|
|
917
|
+
});
|
|
524
918
|
});
|
|
525
919
|
|
|
526
920
|
describe('#checkProperties', () => {
|
|
@@ -608,6 +1002,148 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
608
1002
|
});
|
|
609
1003
|
});
|
|
610
1004
|
|
|
1005
|
+
describe('#updateAdapterConfiguration', () => {
|
|
1006
|
+
it('should have a updateAdapterConfiguration function', (done) => {
|
|
1007
|
+
try {
|
|
1008
|
+
assert.equal(true, typeof a.updateAdapterConfiguration === 'function');
|
|
1009
|
+
done();
|
|
1010
|
+
} catch (error) {
|
|
1011
|
+
log.error(`Test Failure: ${error}`);
|
|
1012
|
+
done(error);
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1015
|
+
});
|
|
1016
|
+
|
|
1017
|
+
describe('#findPath', () => {
|
|
1018
|
+
it('should have a findPath function', (done) => {
|
|
1019
|
+
try {
|
|
1020
|
+
assert.equal(true, typeof a.findPath === 'function');
|
|
1021
|
+
done();
|
|
1022
|
+
} catch (error) {
|
|
1023
|
+
log.error(`Test Failure: ${error}`);
|
|
1024
|
+
done(error);
|
|
1025
|
+
}
|
|
1026
|
+
});
|
|
1027
|
+
it('findPath should find atleast one path that matches', (done) => {
|
|
1028
|
+
try {
|
|
1029
|
+
a.findPath('{base_path}/{version}', (data, error) => {
|
|
1030
|
+
try {
|
|
1031
|
+
assert.equal(undefined, error);
|
|
1032
|
+
assert.notEqual(undefined, data);
|
|
1033
|
+
assert.notEqual(null, data);
|
|
1034
|
+
assert.equal(true, data.found);
|
|
1035
|
+
assert.notEqual(undefined, data.foundIn);
|
|
1036
|
+
assert.notEqual(null, data.foundIn);
|
|
1037
|
+
assert.notEqual(0, data.foundIn.length);
|
|
1038
|
+
done();
|
|
1039
|
+
} catch (err) {
|
|
1040
|
+
log.error(`Test Failure: ${err}`);
|
|
1041
|
+
done(err);
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
} catch (error) {
|
|
1045
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1046
|
+
done(error);
|
|
1047
|
+
}
|
|
1048
|
+
}).timeout(attemptTimeout);
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
describe('#suspend', () => {
|
|
1052
|
+
it('should have a suspend function', (done) => {
|
|
1053
|
+
try {
|
|
1054
|
+
assert.equal(true, typeof a.suspend === 'function');
|
|
1055
|
+
done();
|
|
1056
|
+
} catch (error) {
|
|
1057
|
+
log.error(`Test Failure: ${error}`);
|
|
1058
|
+
done(error);
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
});
|
|
1062
|
+
|
|
1063
|
+
describe('#unsuspend', () => {
|
|
1064
|
+
it('should have a unsuspend function', (done) => {
|
|
1065
|
+
try {
|
|
1066
|
+
assert.equal(true, typeof a.unsuspend === 'function');
|
|
1067
|
+
done();
|
|
1068
|
+
} catch (error) {
|
|
1069
|
+
log.error(`Test Failure: ${error}`);
|
|
1070
|
+
done(error);
|
|
1071
|
+
}
|
|
1072
|
+
});
|
|
1073
|
+
});
|
|
1074
|
+
|
|
1075
|
+
describe('#getQueue', () => {
|
|
1076
|
+
it('should have a getQueue function', (done) => {
|
|
1077
|
+
try {
|
|
1078
|
+
assert.equal(true, typeof a.getQueue === 'function');
|
|
1079
|
+
done();
|
|
1080
|
+
} catch (error) {
|
|
1081
|
+
log.error(`Test Failure: ${error}`);
|
|
1082
|
+
done(error);
|
|
1083
|
+
}
|
|
1084
|
+
});
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
describe('#troubleshoot', () => {
|
|
1088
|
+
it('should have a troubleshoot function', (done) => {
|
|
1089
|
+
try {
|
|
1090
|
+
assert.equal(true, typeof a.troubleshoot === 'function');
|
|
1091
|
+
done();
|
|
1092
|
+
} catch (error) {
|
|
1093
|
+
log.error(`Test Failure: ${error}`);
|
|
1094
|
+
done(error);
|
|
1095
|
+
}
|
|
1096
|
+
});
|
|
1097
|
+
});
|
|
1098
|
+
|
|
1099
|
+
describe('#runHealthcheck', () => {
|
|
1100
|
+
it('should have a runHealthcheck function', (done) => {
|
|
1101
|
+
try {
|
|
1102
|
+
assert.equal(true, typeof a.runHealthcheck === 'function');
|
|
1103
|
+
done();
|
|
1104
|
+
} catch (error) {
|
|
1105
|
+
log.error(`Test Failure: ${error}`);
|
|
1106
|
+
done(error);
|
|
1107
|
+
}
|
|
1108
|
+
});
|
|
1109
|
+
});
|
|
1110
|
+
|
|
1111
|
+
describe('#runConnectivity', () => {
|
|
1112
|
+
it('should have a runConnectivity function', (done) => {
|
|
1113
|
+
try {
|
|
1114
|
+
assert.equal(true, typeof a.runConnectivity === 'function');
|
|
1115
|
+
done();
|
|
1116
|
+
} catch (error) {
|
|
1117
|
+
log.error(`Test Failure: ${error}`);
|
|
1118
|
+
done(error);
|
|
1119
|
+
}
|
|
1120
|
+
});
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
describe('#runBasicGet', () => {
|
|
1124
|
+
it('should have a runBasicGet function', (done) => {
|
|
1125
|
+
try {
|
|
1126
|
+
assert.equal(true, typeof a.runBasicGet === 'function');
|
|
1127
|
+
done();
|
|
1128
|
+
} catch (error) {
|
|
1129
|
+
log.error(`Test Failure: ${error}`);
|
|
1130
|
+
done(error);
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
});
|
|
1134
|
+
|
|
1135
|
+
describe('#moveEntitiesToDB', () => {
|
|
1136
|
+
it('should have a moveEntitiesToDB function', (done) => {
|
|
1137
|
+
try {
|
|
1138
|
+
assert.equal(true, typeof a.moveEntitiesToDB === 'function');
|
|
1139
|
+
done();
|
|
1140
|
+
} catch (error) {
|
|
1141
|
+
log.error(`Test Failure: ${error}`);
|
|
1142
|
+
done(error);
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
});
|
|
1146
|
+
|
|
611
1147
|
describe('#checkActionFiles', () => {
|
|
612
1148
|
it('should have a checkActionFiles function', (done) => {
|
|
613
1149
|
try {
|
|
@@ -737,6 +1273,90 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
737
1273
|
// }).timeout(attemptTimeout);
|
|
738
1274
|
// });
|
|
739
1275
|
|
|
1276
|
+
describe('#hasEntities', () => {
|
|
1277
|
+
it('should have a hasEntities function', (done) => {
|
|
1278
|
+
try {
|
|
1279
|
+
assert.equal(true, typeof a.hasEntities === 'function');
|
|
1280
|
+
done();
|
|
1281
|
+
} catch (error) {
|
|
1282
|
+
log.error(`Test Failure: ${error}`);
|
|
1283
|
+
done(error);
|
|
1284
|
+
}
|
|
1285
|
+
});
|
|
1286
|
+
});
|
|
1287
|
+
|
|
1288
|
+
describe('#hasDevices', () => {
|
|
1289
|
+
it('should have a hasDevices function', (done) => {
|
|
1290
|
+
try {
|
|
1291
|
+
assert.equal(true, typeof a.hasDevices === 'function');
|
|
1292
|
+
done();
|
|
1293
|
+
} catch (error) {
|
|
1294
|
+
log.error(`Test Failure: ${error}`);
|
|
1295
|
+
done(error);
|
|
1296
|
+
}
|
|
1297
|
+
});
|
|
1298
|
+
});
|
|
1299
|
+
|
|
1300
|
+
describe('#getDevice', () => {
|
|
1301
|
+
it('should have a getDevice function', (done) => {
|
|
1302
|
+
try {
|
|
1303
|
+
assert.equal(true, typeof a.getDevice === 'function');
|
|
1304
|
+
done();
|
|
1305
|
+
} catch (error) {
|
|
1306
|
+
log.error(`Test Failure: ${error}`);
|
|
1307
|
+
done(error);
|
|
1308
|
+
}
|
|
1309
|
+
});
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1312
|
+
describe('#getDevicesFiltered', () => {
|
|
1313
|
+
it('should have a getDevicesFiltered function', (done) => {
|
|
1314
|
+
try {
|
|
1315
|
+
assert.equal(true, typeof a.getDevicesFiltered === 'function');
|
|
1316
|
+
done();
|
|
1317
|
+
} catch (error) {
|
|
1318
|
+
log.error(`Test Failure: ${error}`);
|
|
1319
|
+
done(error);
|
|
1320
|
+
}
|
|
1321
|
+
});
|
|
1322
|
+
});
|
|
1323
|
+
|
|
1324
|
+
describe('#isAlive', () => {
|
|
1325
|
+
it('should have a isAlive function', (done) => {
|
|
1326
|
+
try {
|
|
1327
|
+
assert.equal(true, typeof a.isAlive === 'function');
|
|
1328
|
+
done();
|
|
1329
|
+
} catch (error) {
|
|
1330
|
+
log.error(`Test Failure: ${error}`);
|
|
1331
|
+
done(error);
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
});
|
|
1335
|
+
|
|
1336
|
+
describe('#getConfig', () => {
|
|
1337
|
+
it('should have a getConfig function', (done) => {
|
|
1338
|
+
try {
|
|
1339
|
+
assert.equal(true, typeof a.getConfig === 'function');
|
|
1340
|
+
done();
|
|
1341
|
+
} catch (error) {
|
|
1342
|
+
log.error(`Test Failure: ${error}`);
|
|
1343
|
+
done(error);
|
|
1344
|
+
}
|
|
1345
|
+
});
|
|
1346
|
+
});
|
|
1347
|
+
|
|
1348
|
+
describe('#getCount', () => {
|
|
1349
|
+
it('should have a getCount function', (done) => {
|
|
1350
|
+
try {
|
|
1351
|
+
assert.equal(true, typeof a.getCount === 'function');
|
|
1352
|
+
done();
|
|
1353
|
+
} catch (error) {
|
|
1354
|
+
log.error(`Test Failure: ${error}`);
|
|
1355
|
+
done(error);
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
});
|
|
1359
|
+
|
|
740
1360
|
/*
|
|
741
1361
|
-----------------------------------------------------------------------
|
|
742
1362
|
-----------------------------------------------------------------------
|
|
@@ -965,10 +1585,10 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
965
1585
|
}).timeout(attemptTimeout);
|
|
966
1586
|
});
|
|
967
1587
|
|
|
968
|
-
describe('#
|
|
969
|
-
it('should have a
|
|
1588
|
+
describe('#getDevices - errors', () => {
|
|
1589
|
+
it('should have a getDevices function', (done) => {
|
|
970
1590
|
try {
|
|
971
|
-
assert.equal(true, typeof a.
|
|
1591
|
+
assert.equal(true, typeof a.getDevices === 'function');
|
|
972
1592
|
done();
|
|
973
1593
|
} catch (error) {
|
|
974
1594
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1814,5 +2434,1380 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
1814
2434
|
}
|
|
1815
2435
|
}).timeout(attemptTimeout);
|
|
1816
2436
|
});
|
|
2437
|
+
|
|
2438
|
+
describe('#getVsmartPolicyList - errors', () => {
|
|
2439
|
+
it('should have a getVsmartPolicyList function', (done) => {
|
|
2440
|
+
try {
|
|
2441
|
+
assert.equal(true, typeof a.getVsmartPolicyList === 'function');
|
|
2442
|
+
done();
|
|
2443
|
+
} catch (error) {
|
|
2444
|
+
log.error(`Test Failure: ${error}`);
|
|
2445
|
+
done(error);
|
|
2446
|
+
}
|
|
2447
|
+
}).timeout(attemptTimeout);
|
|
2448
|
+
});
|
|
2449
|
+
|
|
2450
|
+
describe('#getDeviceList - errors', () => {
|
|
2451
|
+
it('should have a getDeviceList function', (done) => {
|
|
2452
|
+
try {
|
|
2453
|
+
assert.equal(true, typeof a.getDeviceList === 'function');
|
|
2454
|
+
done();
|
|
2455
|
+
} catch (error) {
|
|
2456
|
+
log.error(`Test Failure: ${error}`);
|
|
2457
|
+
done(error);
|
|
2458
|
+
}
|
|
2459
|
+
}).timeout(attemptTimeout);
|
|
2460
|
+
it('should error if - missing masterTemplateId', (done) => {
|
|
2461
|
+
try {
|
|
2462
|
+
a.getDeviceList(null, (data, error) => {
|
|
2463
|
+
try {
|
|
2464
|
+
const displayE = 'masterTemplateId is required';
|
|
2465
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getDeviceList', displayE);
|
|
2466
|
+
done();
|
|
2467
|
+
} catch (err) {
|
|
2468
|
+
log.error(`Test Failure: ${err}`);
|
|
2469
|
+
done(err);
|
|
2470
|
+
}
|
|
2471
|
+
});
|
|
2472
|
+
} catch (error) {
|
|
2473
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2474
|
+
done(error);
|
|
2475
|
+
}
|
|
2476
|
+
}).timeout(attemptTimeout);
|
|
2477
|
+
});
|
|
2478
|
+
|
|
2479
|
+
describe('#pushMixTemplate - errors', () => {
|
|
2480
|
+
it('should have a pushMixTemplate function', (done) => {
|
|
2481
|
+
try {
|
|
2482
|
+
assert.equal(true, typeof a.pushMixTemplate === 'function');
|
|
2483
|
+
done();
|
|
2484
|
+
} catch (error) {
|
|
2485
|
+
log.error(`Test Failure: ${error}`);
|
|
2486
|
+
done(error);
|
|
2487
|
+
}
|
|
2488
|
+
}).timeout(attemptTimeout);
|
|
2489
|
+
});
|
|
2490
|
+
|
|
2491
|
+
describe('#getAttachedConfigToDevice - errors', () => {
|
|
2492
|
+
it('should have a getAttachedConfigToDevice function', (done) => {
|
|
2493
|
+
try {
|
|
2494
|
+
assert.equal(true, typeof a.getAttachedConfigToDevice === 'function');
|
|
2495
|
+
done();
|
|
2496
|
+
} catch (error) {
|
|
2497
|
+
log.error(`Test Failure: ${error}`);
|
|
2498
|
+
done(error);
|
|
2499
|
+
}
|
|
2500
|
+
}).timeout(attemptTimeout);
|
|
2501
|
+
});
|
|
2502
|
+
|
|
2503
|
+
describe('#pushMasterTemplate - errors', () => {
|
|
2504
|
+
it('should have a pushMasterTemplate function', (done) => {
|
|
2505
|
+
try {
|
|
2506
|
+
assert.equal(true, typeof a.pushMasterTemplate === 'function');
|
|
2507
|
+
done();
|
|
2508
|
+
} catch (error) {
|
|
2509
|
+
log.error(`Test Failure: ${error}`);
|
|
2510
|
+
done(error);
|
|
2511
|
+
}
|
|
2512
|
+
}).timeout(attemptTimeout);
|
|
2513
|
+
});
|
|
2514
|
+
|
|
2515
|
+
describe('#getAttachedDeviceList - errors', () => {
|
|
2516
|
+
it('should have a getAttachedDeviceList function', (done) => {
|
|
2517
|
+
try {
|
|
2518
|
+
assert.equal(true, typeof a.getAttachedDeviceList === 'function');
|
|
2519
|
+
done();
|
|
2520
|
+
} catch (error) {
|
|
2521
|
+
log.error(`Test Failure: ${error}`);
|
|
2522
|
+
done(error);
|
|
2523
|
+
}
|
|
2524
|
+
}).timeout(attemptTimeout);
|
|
2525
|
+
it('should error if - missing masterTemplateId', (done) => {
|
|
2526
|
+
try {
|
|
2527
|
+
a.getAttachedDeviceList(null, (data, error) => {
|
|
2528
|
+
try {
|
|
2529
|
+
const displayE = 'masterTemplateId is required';
|
|
2530
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getAttachedDeviceList', displayE);
|
|
2531
|
+
done();
|
|
2532
|
+
} catch (err) {
|
|
2533
|
+
log.error(`Test Failure: ${err}`);
|
|
2534
|
+
done(err);
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2537
|
+
} catch (error) {
|
|
2538
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2539
|
+
done(error);
|
|
2540
|
+
}
|
|
2541
|
+
}).timeout(attemptTimeout);
|
|
2542
|
+
});
|
|
2543
|
+
|
|
2544
|
+
describe('#createInputWithoutDevice - errors', () => {
|
|
2545
|
+
it('should have a createInputWithoutDevice function', (done) => {
|
|
2546
|
+
try {
|
|
2547
|
+
assert.equal(true, typeof a.createInputWithoutDevice === 'function');
|
|
2548
|
+
done();
|
|
2549
|
+
} catch (error) {
|
|
2550
|
+
log.error(`Test Failure: ${error}`);
|
|
2551
|
+
done(error);
|
|
2552
|
+
}
|
|
2553
|
+
}).timeout(attemptTimeout);
|
|
2554
|
+
});
|
|
2555
|
+
|
|
2556
|
+
describe('#getDeviceConfigurationPreview - errors', () => {
|
|
2557
|
+
it('should have a getDeviceConfigurationPreview function', (done) => {
|
|
2558
|
+
try {
|
|
2559
|
+
assert.equal(true, typeof a.getDeviceConfigurationPreview === 'function');
|
|
2560
|
+
done();
|
|
2561
|
+
} catch (error) {
|
|
2562
|
+
log.error(`Test Failure: ${error}`);
|
|
2563
|
+
done(error);
|
|
2564
|
+
}
|
|
2565
|
+
}).timeout(attemptTimeout);
|
|
2566
|
+
});
|
|
2567
|
+
|
|
2568
|
+
describe('#processInputCommaSepFile - errors', () => {
|
|
2569
|
+
it('should have a processInputCommaSepFile function', (done) => {
|
|
2570
|
+
try {
|
|
2571
|
+
assert.equal(true, typeof a.processInputCommaSepFile === 'function');
|
|
2572
|
+
done();
|
|
2573
|
+
} catch (error) {
|
|
2574
|
+
log.error(`Test Failure: ${error}`);
|
|
2575
|
+
done(error);
|
|
2576
|
+
}
|
|
2577
|
+
}).timeout(attemptTimeout);
|
|
2578
|
+
});
|
|
2579
|
+
|
|
2580
|
+
describe('#validateTemplate - errors', () => {
|
|
2581
|
+
it('should have a validateTemplate function', (done) => {
|
|
2582
|
+
try {
|
|
2583
|
+
assert.equal(true, typeof a.validateTemplate === 'function');
|
|
2584
|
+
done();
|
|
2585
|
+
} catch (error) {
|
|
2586
|
+
log.error(`Test Failure: ${error}`);
|
|
2587
|
+
done(error);
|
|
2588
|
+
}
|
|
2589
|
+
}).timeout(attemptTimeout);
|
|
2590
|
+
});
|
|
2591
|
+
|
|
2592
|
+
describe('#pushCloudxConfig - errors', () => {
|
|
2593
|
+
it('should have a pushCloudxConfig function', (done) => {
|
|
2594
|
+
try {
|
|
2595
|
+
assert.equal(true, typeof a.pushCloudxConfig === 'function');
|
|
2596
|
+
done();
|
|
2597
|
+
} catch (error) {
|
|
2598
|
+
log.error(`Test Failure: ${error}`);
|
|
2599
|
+
done(error);
|
|
2600
|
+
}
|
|
2601
|
+
}).timeout(attemptTimeout);
|
|
2602
|
+
});
|
|
2603
|
+
|
|
2604
|
+
describe('#editCloudxConfig - errors', () => {
|
|
2605
|
+
it('should have a editCloudxConfig function', (done) => {
|
|
2606
|
+
try {
|
|
2607
|
+
assert.equal(true, typeof a.editCloudxConfig === 'function');
|
|
2608
|
+
done();
|
|
2609
|
+
} catch (error) {
|
|
2610
|
+
log.error(`Test Failure: ${error}`);
|
|
2611
|
+
done(error);
|
|
2612
|
+
}
|
|
2613
|
+
}).timeout(attemptTimeout);
|
|
2614
|
+
});
|
|
2615
|
+
|
|
2616
|
+
describe('#detachSites - errors', () => {
|
|
2617
|
+
it('should have a detachSites function', (done) => {
|
|
2618
|
+
try {
|
|
2619
|
+
assert.equal(true, typeof a.detachSites === 'function');
|
|
2620
|
+
done();
|
|
2621
|
+
} catch (error) {
|
|
2622
|
+
log.error(`Test Failure: ${error}`);
|
|
2623
|
+
done(error);
|
|
2624
|
+
}
|
|
2625
|
+
}).timeout(attemptTimeout);
|
|
2626
|
+
});
|
|
2627
|
+
|
|
2628
|
+
describe('#getDevicesWithDuplicateIP - errors', () => {
|
|
2629
|
+
it('should have a getDevicesWithDuplicateIP function', (done) => {
|
|
2630
|
+
try {
|
|
2631
|
+
assert.equal(true, typeof a.getDevicesWithDuplicateIP === 'function');
|
|
2632
|
+
done();
|
|
2633
|
+
} catch (error) {
|
|
2634
|
+
log.error(`Test Failure: ${error}`);
|
|
2635
|
+
done(error);
|
|
2636
|
+
}
|
|
2637
|
+
}).timeout(attemptTimeout);
|
|
2638
|
+
});
|
|
2639
|
+
|
|
2640
|
+
describe('#pushCLITemplate - errors', () => {
|
|
2641
|
+
it('should have a pushCLITemplate function', (done) => {
|
|
2642
|
+
try {
|
|
2643
|
+
assert.equal(true, typeof a.pushCLITemplate === 'function');
|
|
2644
|
+
done();
|
|
2645
|
+
} catch (error) {
|
|
2646
|
+
log.error(`Test Failure: ${error}`);
|
|
2647
|
+
done(error);
|
|
2648
|
+
}
|
|
2649
|
+
}).timeout(attemptTimeout);
|
|
2650
|
+
});
|
|
2651
|
+
|
|
2652
|
+
describe('#detachDeviceTemplate - errors', () => {
|
|
2653
|
+
it('should have a detachDeviceTemplate function', (done) => {
|
|
2654
|
+
try {
|
|
2655
|
+
assert.equal(true, typeof a.detachDeviceTemplate === 'function');
|
|
2656
|
+
done();
|
|
2657
|
+
} catch (error) {
|
|
2658
|
+
log.error(`Test Failure: ${error}`);
|
|
2659
|
+
done(error);
|
|
2660
|
+
}
|
|
2661
|
+
}).timeout(attemptTimeout);
|
|
2662
|
+
});
|
|
2663
|
+
|
|
2664
|
+
describe('#createDeviceInput - errors', () => {
|
|
2665
|
+
it('should have a createDeviceInput function', (done) => {
|
|
2666
|
+
try {
|
|
2667
|
+
assert.equal(true, typeof a.createDeviceInput === 'function');
|
|
2668
|
+
done();
|
|
2669
|
+
} catch (error) {
|
|
2670
|
+
log.error(`Test Failure: ${error}`);
|
|
2671
|
+
done(error);
|
|
2672
|
+
}
|
|
2673
|
+
}).timeout(attemptTimeout);
|
|
2674
|
+
});
|
|
2675
|
+
|
|
2676
|
+
describe('#checkVbond - errors', () => {
|
|
2677
|
+
it('should have a checkVbond function', (done) => {
|
|
2678
|
+
try {
|
|
2679
|
+
assert.equal(true, typeof a.checkVbond === 'function');
|
|
2680
|
+
done();
|
|
2681
|
+
} catch (error) {
|
|
2682
|
+
log.error(`Test Failure: ${error}`);
|
|
2683
|
+
done(error);
|
|
2684
|
+
}
|
|
2685
|
+
}).timeout(attemptTimeout);
|
|
2686
|
+
});
|
|
2687
|
+
|
|
2688
|
+
describe('#generateTemplateList - errors', () => {
|
|
2689
|
+
it('should have a generateTemplateList function', (done) => {
|
|
2690
|
+
try {
|
|
2691
|
+
assert.equal(true, typeof a.generateTemplateList === 'function');
|
|
2692
|
+
done();
|
|
2693
|
+
} catch (error) {
|
|
2694
|
+
log.error(`Test Failure: ${error}`);
|
|
2695
|
+
done(error);
|
|
2696
|
+
}
|
|
2697
|
+
}).timeout(attemptTimeout);
|
|
2698
|
+
});
|
|
2699
|
+
|
|
2700
|
+
describe('#createTemplate - errors', () => {
|
|
2701
|
+
it('should have a createTemplate function', (done) => {
|
|
2702
|
+
try {
|
|
2703
|
+
assert.equal(true, typeof a.createTemplate === 'function');
|
|
2704
|
+
done();
|
|
2705
|
+
} catch (error) {
|
|
2706
|
+
log.error(`Test Failure: ${error}`);
|
|
2707
|
+
done(error);
|
|
2708
|
+
}
|
|
2709
|
+
}).timeout(attemptTimeout);
|
|
2710
|
+
});
|
|
2711
|
+
|
|
2712
|
+
describe('#getTemplate - errors', () => {
|
|
2713
|
+
it('should have a getTemplate function', (done) => {
|
|
2714
|
+
try {
|
|
2715
|
+
assert.equal(true, typeof a.getTemplate === 'function');
|
|
2716
|
+
done();
|
|
2717
|
+
} catch (error) {
|
|
2718
|
+
log.error(`Test Failure: ${error}`);
|
|
2719
|
+
done(error);
|
|
2720
|
+
}
|
|
2721
|
+
}).timeout(attemptTimeout);
|
|
2722
|
+
it('should error if - missing templateId', (done) => {
|
|
2723
|
+
try {
|
|
2724
|
+
a.getTemplate(null, (data, error) => {
|
|
2725
|
+
try {
|
|
2726
|
+
const displayE = 'templateId is required';
|
|
2727
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getTemplate', displayE);
|
|
2728
|
+
done();
|
|
2729
|
+
} catch (err) {
|
|
2730
|
+
log.error(`Test Failure: ${err}`);
|
|
2731
|
+
done(err);
|
|
2732
|
+
}
|
|
2733
|
+
});
|
|
2734
|
+
} catch (error) {
|
|
2735
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2736
|
+
done(error);
|
|
2737
|
+
}
|
|
2738
|
+
}).timeout(attemptTimeout);
|
|
2739
|
+
});
|
|
2740
|
+
|
|
2741
|
+
describe('#editTemplate - errors', () => {
|
|
2742
|
+
it('should have a editTemplate function', (done) => {
|
|
2743
|
+
try {
|
|
2744
|
+
assert.equal(true, typeof a.editTemplate === 'function');
|
|
2745
|
+
done();
|
|
2746
|
+
} catch (error) {
|
|
2747
|
+
log.error(`Test Failure: ${error}`);
|
|
2748
|
+
done(error);
|
|
2749
|
+
}
|
|
2750
|
+
}).timeout(attemptTimeout);
|
|
2751
|
+
it('should error if - missing templateId', (done) => {
|
|
2752
|
+
try {
|
|
2753
|
+
a.editTemplate(null, null, (data, error) => {
|
|
2754
|
+
try {
|
|
2755
|
+
const displayE = 'templateId is required';
|
|
2756
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-editTemplate', displayE);
|
|
2757
|
+
done();
|
|
2758
|
+
} catch (err) {
|
|
2759
|
+
log.error(`Test Failure: ${err}`);
|
|
2760
|
+
done(err);
|
|
2761
|
+
}
|
|
2762
|
+
});
|
|
2763
|
+
} catch (error) {
|
|
2764
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2765
|
+
done(error);
|
|
2766
|
+
}
|
|
2767
|
+
}).timeout(attemptTimeout);
|
|
2768
|
+
});
|
|
2769
|
+
|
|
2770
|
+
describe('#deleteTemplate - errors', () => {
|
|
2771
|
+
it('should have a deleteTemplate function', (done) => {
|
|
2772
|
+
try {
|
|
2773
|
+
assert.equal(true, typeof a.deleteTemplate === 'function');
|
|
2774
|
+
done();
|
|
2775
|
+
} catch (error) {
|
|
2776
|
+
log.error(`Test Failure: ${error}`);
|
|
2777
|
+
done(error);
|
|
2778
|
+
}
|
|
2779
|
+
}).timeout(attemptTimeout);
|
|
2780
|
+
it('should error if - missing templateId', (done) => {
|
|
2781
|
+
try {
|
|
2782
|
+
a.deleteTemplate(null, (data, error) => {
|
|
2783
|
+
try {
|
|
2784
|
+
const displayE = 'templateId is required';
|
|
2785
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-deleteTemplate', displayE);
|
|
2786
|
+
done();
|
|
2787
|
+
} catch (err) {
|
|
2788
|
+
log.error(`Test Failure: ${err}`);
|
|
2789
|
+
done(err);
|
|
2790
|
+
}
|
|
2791
|
+
});
|
|
2792
|
+
} catch (error) {
|
|
2793
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2794
|
+
done(error);
|
|
2795
|
+
}
|
|
2796
|
+
}).timeout(attemptTimeout);
|
|
2797
|
+
});
|
|
2798
|
+
|
|
2799
|
+
describe('#editLITemplate - errors', () => {
|
|
2800
|
+
it('should have a editLITemplate function', (done) => {
|
|
2801
|
+
try {
|
|
2802
|
+
assert.equal(true, typeof a.editLITemplate === 'function');
|
|
2803
|
+
done();
|
|
2804
|
+
} catch (error) {
|
|
2805
|
+
log.error(`Test Failure: ${error}`);
|
|
2806
|
+
done(error);
|
|
2807
|
+
}
|
|
2808
|
+
}).timeout(attemptTimeout);
|
|
2809
|
+
it('should error if - missing templateId', (done) => {
|
|
2810
|
+
try {
|
|
2811
|
+
a.editLITemplate(null, null, (data, error) => {
|
|
2812
|
+
try {
|
|
2813
|
+
const displayE = 'templateId is required';
|
|
2814
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-editLITemplate', displayE);
|
|
2815
|
+
done();
|
|
2816
|
+
} catch (err) {
|
|
2817
|
+
log.error(`Test Failure: ${err}`);
|
|
2818
|
+
done(err);
|
|
2819
|
+
}
|
|
2820
|
+
});
|
|
2821
|
+
} catch (error) {
|
|
2822
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2823
|
+
done(error);
|
|
2824
|
+
}
|
|
2825
|
+
}).timeout(attemptTimeout);
|
|
2826
|
+
});
|
|
2827
|
+
|
|
2828
|
+
describe('#createLITemplate - errors', () => {
|
|
2829
|
+
it('should have a createLITemplate function', (done) => {
|
|
2830
|
+
try {
|
|
2831
|
+
assert.equal(true, typeof a.createLITemplate === 'function');
|
|
2832
|
+
done();
|
|
2833
|
+
} catch (error) {
|
|
2834
|
+
log.error(`Test Failure: ${error}`);
|
|
2835
|
+
done(error);
|
|
2836
|
+
}
|
|
2837
|
+
}).timeout(attemptTimeout);
|
|
2838
|
+
});
|
|
2839
|
+
|
|
2840
|
+
describe('#listLITemplate - errors', () => {
|
|
2841
|
+
it('should have a listLITemplate function', (done) => {
|
|
2842
|
+
try {
|
|
2843
|
+
assert.equal(true, typeof a.listLITemplate === 'function');
|
|
2844
|
+
done();
|
|
2845
|
+
} catch (error) {
|
|
2846
|
+
log.error(`Test Failure: ${error}`);
|
|
2847
|
+
done(error);
|
|
2848
|
+
}
|
|
2849
|
+
}).timeout(attemptTimeout);
|
|
2850
|
+
});
|
|
2851
|
+
|
|
2852
|
+
describe('#generateTemplateByDeviceType - errors', () => {
|
|
2853
|
+
it('should have a generateTemplateByDeviceType function', (done) => {
|
|
2854
|
+
try {
|
|
2855
|
+
assert.equal(true, typeof a.generateTemplateByDeviceType === 'function');
|
|
2856
|
+
done();
|
|
2857
|
+
} catch (error) {
|
|
2858
|
+
log.error(`Test Failure: ${error}`);
|
|
2859
|
+
done(error);
|
|
2860
|
+
}
|
|
2861
|
+
}).timeout(attemptTimeout);
|
|
2862
|
+
it('should error if - missing deviceType', (done) => {
|
|
2863
|
+
try {
|
|
2864
|
+
a.generateTemplateByDeviceType(null, (data, error) => {
|
|
2865
|
+
try {
|
|
2866
|
+
const displayE = 'deviceType is required';
|
|
2867
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-generateTemplateByDeviceType', displayE);
|
|
2868
|
+
done();
|
|
2869
|
+
} catch (err) {
|
|
2870
|
+
log.error(`Test Failure: ${err}`);
|
|
2871
|
+
done(err);
|
|
2872
|
+
}
|
|
2873
|
+
});
|
|
2874
|
+
} catch (error) {
|
|
2875
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2876
|
+
done(error);
|
|
2877
|
+
}
|
|
2878
|
+
}).timeout(attemptTimeout);
|
|
2879
|
+
});
|
|
2880
|
+
|
|
2881
|
+
describe('#getTemplateDefinition - errors', () => {
|
|
2882
|
+
it('should have a getTemplateDefinition function', (done) => {
|
|
2883
|
+
try {
|
|
2884
|
+
assert.equal(true, typeof a.getTemplateDefinition === 'function');
|
|
2885
|
+
done();
|
|
2886
|
+
} catch (error) {
|
|
2887
|
+
log.error(`Test Failure: ${error}`);
|
|
2888
|
+
done(error);
|
|
2889
|
+
}
|
|
2890
|
+
}).timeout(attemptTimeout);
|
|
2891
|
+
it('should error if - missing templateId', (done) => {
|
|
2892
|
+
try {
|
|
2893
|
+
a.getTemplateDefinition(null, (data, error) => {
|
|
2894
|
+
try {
|
|
2895
|
+
const displayE = 'templateId is required';
|
|
2896
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getTemplateDefinition', displayE);
|
|
2897
|
+
done();
|
|
2898
|
+
} catch (err) {
|
|
2899
|
+
log.error(`Test Failure: ${err}`);
|
|
2900
|
+
done(err);
|
|
2901
|
+
}
|
|
2902
|
+
});
|
|
2903
|
+
} catch (error) {
|
|
2904
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2905
|
+
done(error);
|
|
2906
|
+
}
|
|
2907
|
+
}).timeout(attemptTimeout);
|
|
2908
|
+
});
|
|
2909
|
+
|
|
2910
|
+
describe('#generateTemplateTypes - errors', () => {
|
|
2911
|
+
it('should have a generateTemplateTypes function', (done) => {
|
|
2912
|
+
try {
|
|
2913
|
+
assert.equal(true, typeof a.generateTemplateTypes === 'function');
|
|
2914
|
+
done();
|
|
2915
|
+
} catch (error) {
|
|
2916
|
+
log.error(`Test Failure: ${error}`);
|
|
2917
|
+
done(error);
|
|
2918
|
+
}
|
|
2919
|
+
}).timeout(attemptTimeout);
|
|
2920
|
+
});
|
|
2921
|
+
|
|
2922
|
+
describe('#generateTemplateTypeDefinition - errors', () => {
|
|
2923
|
+
it('should have a generateTemplateTypeDefinition function', (done) => {
|
|
2924
|
+
try {
|
|
2925
|
+
assert.equal(true, typeof a.generateTemplateTypeDefinition === 'function');
|
|
2926
|
+
done();
|
|
2927
|
+
} catch (error) {
|
|
2928
|
+
log.error(`Test Failure: ${error}`);
|
|
2929
|
+
done(error);
|
|
2930
|
+
}
|
|
2931
|
+
}).timeout(attemptTimeout);
|
|
2932
|
+
it('should error if - missing typeName', (done) => {
|
|
2933
|
+
try {
|
|
2934
|
+
a.generateTemplateTypeDefinition(null, null, (data, error) => {
|
|
2935
|
+
try {
|
|
2936
|
+
const displayE = 'typeName is required';
|
|
2937
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-generateTemplateTypeDefinition', displayE);
|
|
2938
|
+
done();
|
|
2939
|
+
} catch (err) {
|
|
2940
|
+
log.error(`Test Failure: ${err}`);
|
|
2941
|
+
done(err);
|
|
2942
|
+
}
|
|
2943
|
+
});
|
|
2944
|
+
} catch (error) {
|
|
2945
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2946
|
+
done(error);
|
|
2947
|
+
}
|
|
2948
|
+
}).timeout(attemptTimeout);
|
|
2949
|
+
it('should error if - missing version', (done) => {
|
|
2950
|
+
try {
|
|
2951
|
+
a.generateTemplateTypeDefinition('fakeparam', null, (data, error) => {
|
|
2952
|
+
try {
|
|
2953
|
+
const displayE = 'version is required';
|
|
2954
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-generateTemplateTypeDefinition', displayE);
|
|
2955
|
+
done();
|
|
2956
|
+
} catch (err) {
|
|
2957
|
+
log.error(`Test Failure: ${err}`);
|
|
2958
|
+
done(err);
|
|
2959
|
+
}
|
|
2960
|
+
});
|
|
2961
|
+
} catch (error) {
|
|
2962
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2963
|
+
done(error);
|
|
2964
|
+
}
|
|
2965
|
+
}).timeout(attemptTimeout);
|
|
2966
|
+
});
|
|
2967
|
+
|
|
2968
|
+
describe('#generateMasterTemplateDefinition - errors', () => {
|
|
2969
|
+
it('should have a generateMasterTemplateDefinition function', (done) => {
|
|
2970
|
+
try {
|
|
2971
|
+
assert.equal(true, typeof a.generateMasterTemplateDefinition === 'function');
|
|
2972
|
+
done();
|
|
2973
|
+
} catch (error) {
|
|
2974
|
+
log.error(`Test Failure: ${error}`);
|
|
2975
|
+
done(error);
|
|
2976
|
+
}
|
|
2977
|
+
}).timeout(attemptTimeout);
|
|
2978
|
+
it('should error if - missing typeName', (done) => {
|
|
2979
|
+
try {
|
|
2980
|
+
a.generateMasterTemplateDefinition(null, (data, error) => {
|
|
2981
|
+
try {
|
|
2982
|
+
const displayE = 'typeName is required';
|
|
2983
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-generateMasterTemplateDefinition', displayE);
|
|
2984
|
+
done();
|
|
2985
|
+
} catch (err) {
|
|
2986
|
+
log.error(`Test Failure: ${err}`);
|
|
2987
|
+
done(err);
|
|
2988
|
+
}
|
|
2989
|
+
});
|
|
2990
|
+
} catch (error) {
|
|
2991
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2992
|
+
done(error);
|
|
2993
|
+
}
|
|
2994
|
+
}).timeout(attemptTimeout);
|
|
2995
|
+
});
|
|
2996
|
+
|
|
2997
|
+
describe('#getDeviceTemplatesAttachedToFeature - errors', () => {
|
|
2998
|
+
it('should have a getDeviceTemplatesAttachedToFeature function', (done) => {
|
|
2999
|
+
try {
|
|
3000
|
+
assert.equal(true, typeof a.getDeviceTemplatesAttachedToFeature === 'function');
|
|
3001
|
+
done();
|
|
3002
|
+
} catch (error) {
|
|
3003
|
+
log.error(`Test Failure: ${error}`);
|
|
3004
|
+
done(error);
|
|
3005
|
+
}
|
|
3006
|
+
}).timeout(attemptTimeout);
|
|
3007
|
+
it('should error if - missing templateId', (done) => {
|
|
3008
|
+
try {
|
|
3009
|
+
a.getDeviceTemplatesAttachedToFeature(null, (data, error) => {
|
|
3010
|
+
try {
|
|
3011
|
+
const displayE = 'templateId is required';
|
|
3012
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getDeviceTemplatesAttachedToFeature', displayE);
|
|
3013
|
+
done();
|
|
3014
|
+
} catch (err) {
|
|
3015
|
+
log.error(`Test Failure: ${err}`);
|
|
3016
|
+
done(err);
|
|
3017
|
+
}
|
|
3018
|
+
});
|
|
3019
|
+
} catch (error) {
|
|
3020
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3021
|
+
done(error);
|
|
3022
|
+
}
|
|
3023
|
+
}).timeout(attemptTimeout);
|
|
3024
|
+
});
|
|
3025
|
+
|
|
3026
|
+
describe('#resetVedgeCloud - errors', () => {
|
|
3027
|
+
it('should have a resetVedgeCloud function', (done) => {
|
|
3028
|
+
try {
|
|
3029
|
+
assert.equal(true, typeof a.resetVedgeCloud === 'function');
|
|
3030
|
+
done();
|
|
3031
|
+
} catch (error) {
|
|
3032
|
+
log.error(`Test Failure: ${error}`);
|
|
3033
|
+
done(error);
|
|
3034
|
+
}
|
|
3035
|
+
}).timeout(attemptTimeout);
|
|
3036
|
+
it('should error if - missing uuid', (done) => {
|
|
3037
|
+
try {
|
|
3038
|
+
a.resetVedgeCloud(null, (data, error) => {
|
|
3039
|
+
try {
|
|
3040
|
+
const displayE = 'uuid is required';
|
|
3041
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-resetVedgeCloud', displayE);
|
|
3042
|
+
done();
|
|
3043
|
+
} catch (err) {
|
|
3044
|
+
log.error(`Test Failure: ${err}`);
|
|
3045
|
+
done(err);
|
|
3046
|
+
}
|
|
3047
|
+
});
|
|
3048
|
+
} catch (error) {
|
|
3049
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3050
|
+
done(error);
|
|
3051
|
+
}
|
|
3052
|
+
}).timeout(attemptTimeout);
|
|
3053
|
+
});
|
|
3054
|
+
|
|
3055
|
+
describe('#generateBootstrapConfigForVedges - errors', () => {
|
|
3056
|
+
it('should have a generateBootstrapConfigForVedges function', (done) => {
|
|
3057
|
+
try {
|
|
3058
|
+
assert.equal(true, typeof a.generateBootstrapConfigForVedges === 'function');
|
|
3059
|
+
done();
|
|
3060
|
+
} catch (error) {
|
|
3061
|
+
log.error(`Test Failure: ${error}`);
|
|
3062
|
+
done(error);
|
|
3063
|
+
}
|
|
3064
|
+
}).timeout(attemptTimeout);
|
|
3065
|
+
});
|
|
3066
|
+
|
|
3067
|
+
describe('#decommissionVedgeCloud - errors', () => {
|
|
3068
|
+
it('should have a decommissionVedgeCloud function', (done) => {
|
|
3069
|
+
try {
|
|
3070
|
+
assert.equal(true, typeof a.decommissionVedgeCloud === 'function');
|
|
3071
|
+
done();
|
|
3072
|
+
} catch (error) {
|
|
3073
|
+
log.error(`Test Failure: ${error}`);
|
|
3074
|
+
done(error);
|
|
3075
|
+
}
|
|
3076
|
+
}).timeout(attemptTimeout);
|
|
3077
|
+
it('should error if - missing uuid', (done) => {
|
|
3078
|
+
try {
|
|
3079
|
+
a.decommissionVedgeCloud(null, (data, error) => {
|
|
3080
|
+
try {
|
|
3081
|
+
const displayE = 'uuid is required';
|
|
3082
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-decommissionVedgeCloud', displayE);
|
|
3083
|
+
done();
|
|
3084
|
+
} catch (err) {
|
|
3085
|
+
log.error(`Test Failure: ${err}`);
|
|
3086
|
+
done(err);
|
|
3087
|
+
}
|
|
3088
|
+
});
|
|
3089
|
+
} catch (error) {
|
|
3090
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3091
|
+
done(error);
|
|
3092
|
+
}
|
|
3093
|
+
}).timeout(attemptTimeout);
|
|
3094
|
+
});
|
|
3095
|
+
|
|
3096
|
+
describe('#generateBootstrapConfigForVedge - errors', () => {
|
|
3097
|
+
it('should have a generateBootstrapConfigForVedge function', (done) => {
|
|
3098
|
+
try {
|
|
3099
|
+
assert.equal(true, typeof a.generateBootstrapConfigForVedge === 'function');
|
|
3100
|
+
done();
|
|
3101
|
+
} catch (error) {
|
|
3102
|
+
log.error(`Test Failure: ${error}`);
|
|
3103
|
+
done(error);
|
|
3104
|
+
}
|
|
3105
|
+
}).timeout(attemptTimeout);
|
|
3106
|
+
it('should error if - missing uuid', (done) => {
|
|
3107
|
+
try {
|
|
3108
|
+
a.generateBootstrapConfigForVedge(null, null, (data, error) => {
|
|
3109
|
+
try {
|
|
3110
|
+
const displayE = 'uuid is required';
|
|
3111
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-generateBootstrapConfigForVedge', displayE);
|
|
3112
|
+
done();
|
|
3113
|
+
} catch (err) {
|
|
3114
|
+
log.error(`Test Failure: ${err}`);
|
|
3115
|
+
done(err);
|
|
3116
|
+
}
|
|
3117
|
+
});
|
|
3118
|
+
} catch (error) {
|
|
3119
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3120
|
+
done(error);
|
|
3121
|
+
}
|
|
3122
|
+
}).timeout(attemptTimeout);
|
|
3123
|
+
});
|
|
3124
|
+
|
|
3125
|
+
describe('#getBootstrapConfigZip - errors', () => {
|
|
3126
|
+
it('should have a getBootstrapConfigZip function', (done) => {
|
|
3127
|
+
try {
|
|
3128
|
+
assert.equal(true, typeof a.getBootstrapConfigZip === 'function');
|
|
3129
|
+
done();
|
|
3130
|
+
} catch (error) {
|
|
3131
|
+
log.error(`Test Failure: ${error}`);
|
|
3132
|
+
done(error);
|
|
3133
|
+
}
|
|
3134
|
+
}).timeout(attemptTimeout);
|
|
3135
|
+
it('should error if - missing id', (done) => {
|
|
3136
|
+
try {
|
|
3137
|
+
a.getBootstrapConfigZip(null, (data, error) => {
|
|
3138
|
+
try {
|
|
3139
|
+
const displayE = 'id is required';
|
|
3140
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getBootstrapConfigZip', displayE);
|
|
3141
|
+
done();
|
|
3142
|
+
} catch (err) {
|
|
3143
|
+
log.error(`Test Failure: ${err}`);
|
|
3144
|
+
done(err);
|
|
3145
|
+
}
|
|
3146
|
+
});
|
|
3147
|
+
} catch (error) {
|
|
3148
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3149
|
+
done(error);
|
|
3150
|
+
}
|
|
3151
|
+
}).timeout(attemptTimeout);
|
|
3152
|
+
});
|
|
3153
|
+
|
|
3154
|
+
describe('#formPost - errors', () => {
|
|
3155
|
+
it('should have a formPost function', (done) => {
|
|
3156
|
+
try {
|
|
3157
|
+
assert.equal(true, typeof a.formPost === 'function');
|
|
3158
|
+
done();
|
|
3159
|
+
} catch (error) {
|
|
3160
|
+
log.error(`Test Failure: ${error}`);
|
|
3161
|
+
done(error);
|
|
3162
|
+
}
|
|
3163
|
+
}).timeout(attemptTimeout);
|
|
3164
|
+
});
|
|
3165
|
+
|
|
3166
|
+
describe('#getDevicesDetails - errors', () => {
|
|
3167
|
+
it('should have a getDevicesDetails function', (done) => {
|
|
3168
|
+
try {
|
|
3169
|
+
assert.equal(true, typeof a.getDevicesDetails === 'function');
|
|
3170
|
+
done();
|
|
3171
|
+
} catch (error) {
|
|
3172
|
+
log.error(`Test Failure: ${error}`);
|
|
3173
|
+
done(error);
|
|
3174
|
+
}
|
|
3175
|
+
}).timeout(attemptTimeout);
|
|
3176
|
+
it('should error if - missing deviceCategory', (done) => {
|
|
3177
|
+
try {
|
|
3178
|
+
a.getDevicesDetails(null, null, null, null, null, null, (data, error) => {
|
|
3179
|
+
try {
|
|
3180
|
+
const displayE = 'deviceCategory is required';
|
|
3181
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getDevicesDetails', displayE);
|
|
3182
|
+
done();
|
|
3183
|
+
} catch (err) {
|
|
3184
|
+
log.error(`Test Failure: ${err}`);
|
|
3185
|
+
done(err);
|
|
3186
|
+
}
|
|
3187
|
+
});
|
|
3188
|
+
} catch (error) {
|
|
3189
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3190
|
+
done(error);
|
|
3191
|
+
}
|
|
3192
|
+
}).timeout(attemptTimeout);
|
|
3193
|
+
});
|
|
3194
|
+
|
|
3195
|
+
describe('#createDevice - errors', () => {
|
|
3196
|
+
it('should have a createDevice function', (done) => {
|
|
3197
|
+
try {
|
|
3198
|
+
assert.equal(true, typeof a.createDevice === 'function');
|
|
3199
|
+
done();
|
|
3200
|
+
} catch (error) {
|
|
3201
|
+
log.error(`Test Failure: ${error}`);
|
|
3202
|
+
done(error);
|
|
3203
|
+
}
|
|
3204
|
+
}).timeout(attemptTimeout);
|
|
3205
|
+
});
|
|
3206
|
+
|
|
3207
|
+
describe('#getManagementSystemIPInfo - errors', () => {
|
|
3208
|
+
it('should have a getManagementSystemIPInfo function', (done) => {
|
|
3209
|
+
try {
|
|
3210
|
+
assert.equal(true, typeof a.getManagementSystemIPInfo === 'function');
|
|
3211
|
+
done();
|
|
3212
|
+
} catch (error) {
|
|
3213
|
+
log.error(`Test Failure: ${error}`);
|
|
3214
|
+
done(error);
|
|
3215
|
+
}
|
|
3216
|
+
}).timeout(attemptTimeout);
|
|
3217
|
+
});
|
|
3218
|
+
|
|
3219
|
+
describe('#deleteDevice - errors', () => {
|
|
3220
|
+
it('should have a deleteDevice function', (done) => {
|
|
3221
|
+
try {
|
|
3222
|
+
assert.equal(true, typeof a.deleteDevice === 'function');
|
|
3223
|
+
done();
|
|
3224
|
+
} catch (error) {
|
|
3225
|
+
log.error(`Test Failure: ${error}`);
|
|
3226
|
+
done(error);
|
|
3227
|
+
}
|
|
3228
|
+
}).timeout(attemptTimeout);
|
|
3229
|
+
it('should error if - missing uuid', (done) => {
|
|
3230
|
+
try {
|
|
3231
|
+
a.deleteDevice(null, (data, error) => {
|
|
3232
|
+
try {
|
|
3233
|
+
const displayE = 'uuid is required';
|
|
3234
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-deleteDevice', displayE);
|
|
3235
|
+
done();
|
|
3236
|
+
} catch (err) {
|
|
3237
|
+
log.error(`Test Failure: ${err}`);
|
|
3238
|
+
done(err);
|
|
3239
|
+
}
|
|
3240
|
+
});
|
|
3241
|
+
} catch (error) {
|
|
3242
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3243
|
+
done(error);
|
|
3244
|
+
}
|
|
3245
|
+
}).timeout(attemptTimeout);
|
|
3246
|
+
});
|
|
3247
|
+
|
|
3248
|
+
describe('#editDevice - errors', () => {
|
|
3249
|
+
it('should have a editDevice function', (done) => {
|
|
3250
|
+
try {
|
|
3251
|
+
assert.equal(true, typeof a.editDevice === 'function');
|
|
3252
|
+
done();
|
|
3253
|
+
} catch (error) {
|
|
3254
|
+
log.error(`Test Failure: ${error}`);
|
|
3255
|
+
done(error);
|
|
3256
|
+
}
|
|
3257
|
+
}).timeout(attemptTimeout);
|
|
3258
|
+
it('should error if - missing uuid', (done) => {
|
|
3259
|
+
try {
|
|
3260
|
+
a.editDevice(null, null, (data, error) => {
|
|
3261
|
+
try {
|
|
3262
|
+
const displayE = 'uuid is required';
|
|
3263
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-editDevice', displayE);
|
|
3264
|
+
done();
|
|
3265
|
+
} catch (err) {
|
|
3266
|
+
log.error(`Test Failure: ${err}`);
|
|
3267
|
+
done(err);
|
|
3268
|
+
}
|
|
3269
|
+
});
|
|
3270
|
+
} catch (error) {
|
|
3271
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3272
|
+
done(error);
|
|
3273
|
+
}
|
|
3274
|
+
}).timeout(attemptTimeout);
|
|
3275
|
+
});
|
|
3276
|
+
|
|
3277
|
+
describe('#getControllerVEdgeSyncStatus - errors', () => {
|
|
3278
|
+
it('should have a getControllerVEdgeSyncStatus function', (done) => {
|
|
3279
|
+
try {
|
|
3280
|
+
assert.equal(true, typeof a.getControllerVEdgeSyncStatus === 'function');
|
|
3281
|
+
done();
|
|
3282
|
+
} catch (error) {
|
|
3283
|
+
log.error(`Test Failure: ${error}`);
|
|
3284
|
+
done(error);
|
|
3285
|
+
}
|
|
3286
|
+
}).timeout(attemptTimeout);
|
|
3287
|
+
});
|
|
3288
|
+
|
|
3289
|
+
describe('#getRootCertStatusAll - errors', () => {
|
|
3290
|
+
it('should have a getRootCertStatusAll function', (done) => {
|
|
3291
|
+
try {
|
|
3292
|
+
assert.equal(true, typeof a.getRootCertStatusAll === 'function');
|
|
3293
|
+
done();
|
|
3294
|
+
} catch (error) {
|
|
3295
|
+
log.error(`Test Failure: ${error}`);
|
|
3296
|
+
done(error);
|
|
3297
|
+
}
|
|
3298
|
+
}).timeout(attemptTimeout);
|
|
3299
|
+
});
|
|
3300
|
+
|
|
3301
|
+
describe('#syncDevices - errors', () => {
|
|
3302
|
+
it('should have a syncDevices function', (done) => {
|
|
3303
|
+
try {
|
|
3304
|
+
assert.equal(true, typeof a.syncDevices === 'function');
|
|
3305
|
+
done();
|
|
3306
|
+
} catch (error) {
|
|
3307
|
+
log.error(`Test Failure: ${error}`);
|
|
3308
|
+
done(error);
|
|
3309
|
+
}
|
|
3310
|
+
}).timeout(attemptTimeout);
|
|
3311
|
+
});
|
|
3312
|
+
|
|
3313
|
+
describe('#getCloudDockDataBasedOnDeviceType - errors', () => {
|
|
3314
|
+
it('should have a getCloudDockDataBasedOnDeviceType function', (done) => {
|
|
3315
|
+
try {
|
|
3316
|
+
assert.equal(true, typeof a.getCloudDockDataBasedOnDeviceType === 'function');
|
|
3317
|
+
done();
|
|
3318
|
+
} catch (error) {
|
|
3319
|
+
log.error(`Test Failure: ${error}`);
|
|
3320
|
+
done(error);
|
|
3321
|
+
}
|
|
3322
|
+
}).timeout(attemptTimeout);
|
|
3323
|
+
it('should error if - missing deviceCategory', (done) => {
|
|
3324
|
+
try {
|
|
3325
|
+
a.getCloudDockDataBasedOnDeviceType(null, (data, error) => {
|
|
3326
|
+
try {
|
|
3327
|
+
const displayE = 'deviceCategory is required';
|
|
3328
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getCloudDockDataBasedOnDeviceType', displayE);
|
|
3329
|
+
done();
|
|
3330
|
+
} catch (err) {
|
|
3331
|
+
log.error(`Test Failure: ${err}`);
|
|
3332
|
+
done(err);
|
|
3333
|
+
}
|
|
3334
|
+
});
|
|
3335
|
+
} catch (error) {
|
|
3336
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3337
|
+
done(error);
|
|
3338
|
+
}
|
|
3339
|
+
}).timeout(attemptTimeout);
|
|
3340
|
+
});
|
|
3341
|
+
|
|
3342
|
+
describe('#getOutOfSyncTemplates - errors', () => {
|
|
3343
|
+
it('should have a getOutOfSyncTemplates function', (done) => {
|
|
3344
|
+
try {
|
|
3345
|
+
assert.equal(true, typeof a.getOutOfSyncTemplates === 'function');
|
|
3346
|
+
done();
|
|
3347
|
+
} catch (error) {
|
|
3348
|
+
log.error(`Test Failure: ${error}`);
|
|
3349
|
+
done(error);
|
|
3350
|
+
}
|
|
3351
|
+
}).timeout(attemptTimeout);
|
|
3352
|
+
});
|
|
3353
|
+
|
|
3354
|
+
describe('#getOutOfSyncDevices - errors', () => {
|
|
3355
|
+
it('should have a getOutOfSyncDevices function', (done) => {
|
|
3356
|
+
try {
|
|
3357
|
+
assert.equal(true, typeof a.getOutOfSyncDevices === 'function');
|
|
3358
|
+
done();
|
|
3359
|
+
} catch (error) {
|
|
3360
|
+
log.error(`Test Failure: ${error}`);
|
|
3361
|
+
done(error);
|
|
3362
|
+
}
|
|
3363
|
+
}).timeout(attemptTimeout);
|
|
3364
|
+
it('should error if - missing templateId', (done) => {
|
|
3365
|
+
try {
|
|
3366
|
+
a.getOutOfSyncDevices(null, (data, error) => {
|
|
3367
|
+
try {
|
|
3368
|
+
const displayE = 'templateId is required';
|
|
3369
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getOutOfSyncDevices', displayE);
|
|
3370
|
+
done();
|
|
3371
|
+
} catch (err) {
|
|
3372
|
+
log.error(`Test Failure: ${err}`);
|
|
3373
|
+
done(err);
|
|
3374
|
+
}
|
|
3375
|
+
});
|
|
3376
|
+
} catch (error) {
|
|
3377
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3378
|
+
done(error);
|
|
3379
|
+
}
|
|
3380
|
+
}).timeout(attemptTimeout);
|
|
3381
|
+
});
|
|
3382
|
+
|
|
3383
|
+
describe('#createMasterTemplate - errors', () => {
|
|
3384
|
+
it('should have a createMasterTemplate function', (done) => {
|
|
3385
|
+
try {
|
|
3386
|
+
assert.equal(true, typeof a.createMasterTemplate === '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 body', (done) => {
|
|
3394
|
+
try {
|
|
3395
|
+
a.createMasterTemplate(null, (data, error) => {
|
|
3396
|
+
try {
|
|
3397
|
+
const displayE = 'body is required';
|
|
3398
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-createMasterTemplate', 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('#createCLITemplate - errors', () => {
|
|
3413
|
+
it('should have a createCLITemplate function', (done) => {
|
|
3414
|
+
try {
|
|
3415
|
+
assert.equal(true, typeof a.createCLITemplate === '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 body', (done) => {
|
|
3423
|
+
try {
|
|
3424
|
+
a.createCLITemplate(null, (data, error) => {
|
|
3425
|
+
try {
|
|
3426
|
+
const displayE = 'body is required';
|
|
3427
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-createCLITemplate', 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('#getMasterTemplateDefinition - errors', () => {
|
|
3442
|
+
it('should have a getMasterTemplateDefinition function', (done) => {
|
|
3443
|
+
try {
|
|
3444
|
+
assert.equal(true, typeof a.getMasterTemplateDefinition === 'function');
|
|
3445
|
+
done();
|
|
3446
|
+
} catch (error) {
|
|
3447
|
+
log.error(`Test Failure: ${error}`);
|
|
3448
|
+
done(error);
|
|
3449
|
+
}
|
|
3450
|
+
}).timeout(attemptTimeout);
|
|
3451
|
+
it('should error if - missing templateId', (done) => {
|
|
3452
|
+
try {
|
|
3453
|
+
a.getMasterTemplateDefinition(null, (data, error) => {
|
|
3454
|
+
try {
|
|
3455
|
+
const displayE = 'templateId is required';
|
|
3456
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getMasterTemplateDefinition', displayE);
|
|
3457
|
+
done();
|
|
3458
|
+
} catch (err) {
|
|
3459
|
+
log.error(`Test Failure: ${err}`);
|
|
3460
|
+
done(err);
|
|
3461
|
+
}
|
|
3462
|
+
});
|
|
3463
|
+
} catch (error) {
|
|
3464
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3465
|
+
done(error);
|
|
3466
|
+
}
|
|
3467
|
+
}).timeout(attemptTimeout);
|
|
3468
|
+
});
|
|
3469
|
+
|
|
3470
|
+
describe('#getRunningConfig - errors', () => {
|
|
3471
|
+
it('should have a getRunningConfig function', (done) => {
|
|
3472
|
+
try {
|
|
3473
|
+
assert.equal(true, typeof a.getRunningConfig === 'function');
|
|
3474
|
+
done();
|
|
3475
|
+
} catch (error) {
|
|
3476
|
+
log.error(`Test Failure: ${error}`);
|
|
3477
|
+
done(error);
|
|
3478
|
+
}
|
|
3479
|
+
}).timeout(attemptTimeout);
|
|
3480
|
+
it('should error if - missing deviceUUID', (done) => {
|
|
3481
|
+
try {
|
|
3482
|
+
a.getRunningConfig(null, (data, error) => {
|
|
3483
|
+
try {
|
|
3484
|
+
const displayE = 'deviceUUID is required';
|
|
3485
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getRunningConfig', displayE);
|
|
3486
|
+
done();
|
|
3487
|
+
} catch (err) {
|
|
3488
|
+
log.error(`Test Failure: ${err}`);
|
|
3489
|
+
done(err);
|
|
3490
|
+
}
|
|
3491
|
+
});
|
|
3492
|
+
} catch (error) {
|
|
3493
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3494
|
+
done(error);
|
|
3495
|
+
}
|
|
3496
|
+
}).timeout(attemptTimeout);
|
|
3497
|
+
});
|
|
3498
|
+
|
|
3499
|
+
describe('#uploadConfig - errors', () => {
|
|
3500
|
+
it('should have a uploadConfig function', (done) => {
|
|
3501
|
+
try {
|
|
3502
|
+
assert.equal(true, typeof a.uploadConfig === 'function');
|
|
3503
|
+
done();
|
|
3504
|
+
} catch (error) {
|
|
3505
|
+
log.error(`Test Failure: ${error}`);
|
|
3506
|
+
done(error);
|
|
3507
|
+
}
|
|
3508
|
+
}).timeout(attemptTimeout);
|
|
3509
|
+
it('should error if - missing deviceUUID', (done) => {
|
|
3510
|
+
try {
|
|
3511
|
+
a.uploadConfig(null, null, (data, error) => {
|
|
3512
|
+
try {
|
|
3513
|
+
const displayE = 'deviceUUID is required';
|
|
3514
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-uploadConfig', displayE);
|
|
3515
|
+
done();
|
|
3516
|
+
} catch (err) {
|
|
3517
|
+
log.error(`Test Failure: ${err}`);
|
|
3518
|
+
done(err);
|
|
3519
|
+
}
|
|
3520
|
+
});
|
|
3521
|
+
} catch (error) {
|
|
3522
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3523
|
+
done(error);
|
|
3524
|
+
}
|
|
3525
|
+
}).timeout(attemptTimeout);
|
|
3526
|
+
});
|
|
3527
|
+
|
|
3528
|
+
describe('#getAttachedConfig - errors', () => {
|
|
3529
|
+
it('should have a getAttachedConfig function', (done) => {
|
|
3530
|
+
try {
|
|
3531
|
+
assert.equal(true, typeof a.getAttachedConfig === 'function');
|
|
3532
|
+
done();
|
|
3533
|
+
} catch (error) {
|
|
3534
|
+
log.error(`Test Failure: ${error}`);
|
|
3535
|
+
done(error);
|
|
3536
|
+
}
|
|
3537
|
+
}).timeout(attemptTimeout);
|
|
3538
|
+
it('should error if - missing deviceUUID', (done) => {
|
|
3539
|
+
try {
|
|
3540
|
+
a.getAttachedConfig(null, null, (data, error) => {
|
|
3541
|
+
try {
|
|
3542
|
+
const displayE = 'deviceUUID is required';
|
|
3543
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getAttachedConfig', displayE);
|
|
3544
|
+
done();
|
|
3545
|
+
} catch (err) {
|
|
3546
|
+
log.error(`Test Failure: ${err}`);
|
|
3547
|
+
done(err);
|
|
3548
|
+
}
|
|
3549
|
+
});
|
|
3550
|
+
} catch (error) {
|
|
3551
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3552
|
+
done(error);
|
|
3553
|
+
}
|
|
3554
|
+
}).timeout(attemptTimeout);
|
|
3555
|
+
});
|
|
3556
|
+
|
|
3557
|
+
describe('#getConfigDiff - errors', () => {
|
|
3558
|
+
it('should have a getConfigDiff function', (done) => {
|
|
3559
|
+
try {
|
|
3560
|
+
assert.equal(true, typeof a.getConfigDiff === 'function');
|
|
3561
|
+
done();
|
|
3562
|
+
} catch (error) {
|
|
3563
|
+
log.error(`Test Failure: ${error}`);
|
|
3564
|
+
done(error);
|
|
3565
|
+
}
|
|
3566
|
+
}).timeout(attemptTimeout);
|
|
3567
|
+
it('should error if - missing deviceUUID', (done) => {
|
|
3568
|
+
try {
|
|
3569
|
+
a.getConfigDiff(null, (data, error) => {
|
|
3570
|
+
try {
|
|
3571
|
+
const displayE = 'deviceUUID is required';
|
|
3572
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getConfigDiff', displayE);
|
|
3573
|
+
done();
|
|
3574
|
+
} catch (err) {
|
|
3575
|
+
log.error(`Test Failure: ${err}`);
|
|
3576
|
+
done(err);
|
|
3577
|
+
}
|
|
3578
|
+
});
|
|
3579
|
+
} catch (error) {
|
|
3580
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3581
|
+
done(error);
|
|
3582
|
+
}
|
|
3583
|
+
}).timeout(attemptTimeout);
|
|
3584
|
+
});
|
|
3585
|
+
|
|
3586
|
+
describe('#generateCLIModeDevices - errors', () => {
|
|
3587
|
+
it('should have a generateCLIModeDevices function', (done) => {
|
|
3588
|
+
try {
|
|
3589
|
+
assert.equal(true, typeof a.generateCLIModeDevices === 'function');
|
|
3590
|
+
done();
|
|
3591
|
+
} catch (error) {
|
|
3592
|
+
log.error(`Test Failure: ${error}`);
|
|
3593
|
+
done(error);
|
|
3594
|
+
}
|
|
3595
|
+
}).timeout(attemptTimeout);
|
|
3596
|
+
it('should error if - missing type', (done) => {
|
|
3597
|
+
try {
|
|
3598
|
+
a.generateCLIModeDevices(null, (data, error) => {
|
|
3599
|
+
try {
|
|
3600
|
+
const displayE = 'type is required';
|
|
3601
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-generateCLIModeDevices', displayE);
|
|
3602
|
+
done();
|
|
3603
|
+
} catch (err) {
|
|
3604
|
+
log.error(`Test Failure: ${err}`);
|
|
3605
|
+
done(err);
|
|
3606
|
+
}
|
|
3607
|
+
});
|
|
3608
|
+
} catch (error) {
|
|
3609
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3610
|
+
done(error);
|
|
3611
|
+
}
|
|
3612
|
+
}).timeout(attemptTimeout);
|
|
3613
|
+
});
|
|
3614
|
+
|
|
3615
|
+
describe('#updateDeviceToCLIMode - errors', () => {
|
|
3616
|
+
it('should have a updateDeviceToCLIMode function', (done) => {
|
|
3617
|
+
try {
|
|
3618
|
+
assert.equal(true, typeof a.updateDeviceToCLIMode === 'function');
|
|
3619
|
+
done();
|
|
3620
|
+
} catch (error) {
|
|
3621
|
+
log.error(`Test Failure: ${error}`);
|
|
3622
|
+
done(error);
|
|
3623
|
+
}
|
|
3624
|
+
}).timeout(attemptTimeout);
|
|
3625
|
+
});
|
|
3626
|
+
|
|
3627
|
+
describe('#generatevManageModeDevices - errors', () => {
|
|
3628
|
+
it('should have a generatevManageModeDevices function', (done) => {
|
|
3629
|
+
try {
|
|
3630
|
+
assert.equal(true, typeof a.generatevManageModeDevices === 'function');
|
|
3631
|
+
done();
|
|
3632
|
+
} catch (error) {
|
|
3633
|
+
log.error(`Test Failure: ${error}`);
|
|
3634
|
+
done(error);
|
|
3635
|
+
}
|
|
3636
|
+
}).timeout(attemptTimeout);
|
|
3637
|
+
it('should error if - missing type', (done) => {
|
|
3638
|
+
try {
|
|
3639
|
+
a.generatevManageModeDevices(null, (data, error) => {
|
|
3640
|
+
try {
|
|
3641
|
+
const displayE = 'type is required';
|
|
3642
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-generatevManageModeDevices', displayE);
|
|
3643
|
+
done();
|
|
3644
|
+
} catch (err) {
|
|
3645
|
+
log.error(`Test Failure: ${err}`);
|
|
3646
|
+
done(err);
|
|
3647
|
+
}
|
|
3648
|
+
});
|
|
3649
|
+
} catch (error) {
|
|
3650
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3651
|
+
done(error);
|
|
3652
|
+
}
|
|
3653
|
+
}).timeout(attemptTimeout);
|
|
3654
|
+
});
|
|
3655
|
+
|
|
3656
|
+
describe('#getCompatibleDevices - errors', () => {
|
|
3657
|
+
it('should have a getCompatibleDevices function', (done) => {
|
|
3658
|
+
try {
|
|
3659
|
+
assert.equal(true, typeof a.getCompatibleDevices === 'function');
|
|
3660
|
+
done();
|
|
3661
|
+
} catch (error) {
|
|
3662
|
+
log.error(`Test Failure: ${error}`);
|
|
3663
|
+
done(error);
|
|
3664
|
+
}
|
|
3665
|
+
}).timeout(attemptTimeout);
|
|
3666
|
+
it('should error if - missing oldDeviceUUID', (done) => {
|
|
3667
|
+
try {
|
|
3668
|
+
a.getCompatibleDevices(null, (data, error) => {
|
|
3669
|
+
try {
|
|
3670
|
+
const displayE = 'oldDeviceUUID is required';
|
|
3671
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getCompatibleDevices', displayE);
|
|
3672
|
+
done();
|
|
3673
|
+
} catch (err) {
|
|
3674
|
+
log.error(`Test Failure: ${err}`);
|
|
3675
|
+
done(err);
|
|
3676
|
+
}
|
|
3677
|
+
});
|
|
3678
|
+
} catch (error) {
|
|
3679
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3680
|
+
done(error);
|
|
3681
|
+
}
|
|
3682
|
+
}).timeout(attemptTimeout);
|
|
3683
|
+
});
|
|
3684
|
+
|
|
3685
|
+
describe('#getVpnForDevice - errors', () => {
|
|
3686
|
+
it('should have a getVpnForDevice function', (done) => {
|
|
3687
|
+
try {
|
|
3688
|
+
assert.equal(true, typeof a.getVpnForDevice === 'function');
|
|
3689
|
+
done();
|
|
3690
|
+
} catch (error) {
|
|
3691
|
+
log.error(`Test Failure: ${error}`);
|
|
3692
|
+
done(error);
|
|
3693
|
+
}
|
|
3694
|
+
}).timeout(attemptTimeout);
|
|
3695
|
+
it('should error if - missing uuid', (done) => {
|
|
3696
|
+
try {
|
|
3697
|
+
a.getVpnForDevice(null, (data, error) => {
|
|
3698
|
+
try {
|
|
3699
|
+
const displayE = 'uuid is required';
|
|
3700
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-getVpnForDevice', displayE);
|
|
3701
|
+
done();
|
|
3702
|
+
} catch (err) {
|
|
3703
|
+
log.error(`Test Failure: ${err}`);
|
|
3704
|
+
done(err);
|
|
3705
|
+
}
|
|
3706
|
+
});
|
|
3707
|
+
} catch (error) {
|
|
3708
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3709
|
+
done(error);
|
|
3710
|
+
}
|
|
3711
|
+
}).timeout(attemptTimeout);
|
|
3712
|
+
});
|
|
3713
|
+
|
|
3714
|
+
describe('#rmaUpdate - errors', () => {
|
|
3715
|
+
it('should have a rmaUpdate function', (done) => {
|
|
3716
|
+
try {
|
|
3717
|
+
assert.equal(true, typeof a.rmaUpdate === 'function');
|
|
3718
|
+
done();
|
|
3719
|
+
} catch (error) {
|
|
3720
|
+
log.error(`Test Failure: ${error}`);
|
|
3721
|
+
done(error);
|
|
3722
|
+
}
|
|
3723
|
+
}).timeout(attemptTimeout);
|
|
3724
|
+
});
|
|
3725
|
+
|
|
3726
|
+
describe('#deActivatePolicy - errors', () => {
|
|
3727
|
+
it('should have a deActivatePolicy function', (done) => {
|
|
3728
|
+
try {
|
|
3729
|
+
assert.equal(true, typeof a.deActivatePolicy === 'function');
|
|
3730
|
+
done();
|
|
3731
|
+
} catch (error) {
|
|
3732
|
+
log.error(`Test Failure: ${error}`);
|
|
3733
|
+
done(error);
|
|
3734
|
+
}
|
|
3735
|
+
}).timeout(attemptTimeout);
|
|
3736
|
+
it('should error if - missing policyId', (done) => {
|
|
3737
|
+
try {
|
|
3738
|
+
a.deActivatePolicy(null, (data, error) => {
|
|
3739
|
+
try {
|
|
3740
|
+
const displayE = 'policyId is required';
|
|
3741
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-deActivatePolicy', displayE);
|
|
3742
|
+
done();
|
|
3743
|
+
} catch (err) {
|
|
3744
|
+
log.error(`Test Failure: ${err}`);
|
|
3745
|
+
done(err);
|
|
3746
|
+
}
|
|
3747
|
+
});
|
|
3748
|
+
} catch (error) {
|
|
3749
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3750
|
+
done(error);
|
|
3751
|
+
}
|
|
3752
|
+
}).timeout(attemptTimeout);
|
|
3753
|
+
});
|
|
3754
|
+
|
|
3755
|
+
describe('#activatePolicy - errors', () => {
|
|
3756
|
+
it('should have a activatePolicy function', (done) => {
|
|
3757
|
+
try {
|
|
3758
|
+
assert.equal(true, typeof a.activatePolicy === 'function');
|
|
3759
|
+
done();
|
|
3760
|
+
} catch (error) {
|
|
3761
|
+
log.error(`Test Failure: ${error}`);
|
|
3762
|
+
done(error);
|
|
3763
|
+
}
|
|
3764
|
+
}).timeout(attemptTimeout);
|
|
3765
|
+
it('should error if - missing policyId', (done) => {
|
|
3766
|
+
try {
|
|
3767
|
+
a.activatePolicy(null, null, (data, error) => {
|
|
3768
|
+
try {
|
|
3769
|
+
const displayE = 'policyId is required';
|
|
3770
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-activatePolicy', displayE);
|
|
3771
|
+
done();
|
|
3772
|
+
} catch (err) {
|
|
3773
|
+
log.error(`Test Failure: ${err}`);
|
|
3774
|
+
done(err);
|
|
3775
|
+
}
|
|
3776
|
+
});
|
|
3777
|
+
} catch (error) {
|
|
3778
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3779
|
+
done(error);
|
|
3780
|
+
}
|
|
3781
|
+
}).timeout(attemptTimeout);
|
|
3782
|
+
it('should error if - missing body', (done) => {
|
|
3783
|
+
try {
|
|
3784
|
+
a.activatePolicy('fakeparam', null, (data, error) => {
|
|
3785
|
+
try {
|
|
3786
|
+
const displayE = 'body is required';
|
|
3787
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-viptela-adapter-activatePolicy', displayE);
|
|
3788
|
+
done();
|
|
3789
|
+
} catch (err) {
|
|
3790
|
+
log.error(`Test Failure: ${err}`);
|
|
3791
|
+
done(err);
|
|
3792
|
+
}
|
|
3793
|
+
});
|
|
3794
|
+
} catch (error) {
|
|
3795
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3796
|
+
done(error);
|
|
3797
|
+
}
|
|
3798
|
+
}).timeout(attemptTimeout);
|
|
3799
|
+
});
|
|
3800
|
+
|
|
3801
|
+
describe('#checkVSmartConnectivityStatus - errors', () => {
|
|
3802
|
+
it('should have a checkVSmartConnectivityStatus function', (done) => {
|
|
3803
|
+
try {
|
|
3804
|
+
assert.equal(true, typeof a.checkVSmartConnectivityStatus === 'function');
|
|
3805
|
+
done();
|
|
3806
|
+
} catch (error) {
|
|
3807
|
+
log.error(`Test Failure: ${error}`);
|
|
3808
|
+
done(error);
|
|
3809
|
+
}
|
|
3810
|
+
}).timeout(attemptTimeout);
|
|
3811
|
+
});
|
|
1817
3812
|
});
|
|
1818
3813
|
});
|