@itentialopensource/adapter-infoblox 1.9.1 → 1.10.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/.eslintrc.js +12 -12
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +68 -49
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +88 -74
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +244 -392
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +5177 -2074
- package/adapterBase.js +1330 -49
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/DNSProperties/action.json +1 -1
- package/entities/DNSProperties/mockdatafiles/getGridDnsData.json +3 -0
- package/entities/ExtensibleAttributes/action.json +63 -0
- package/entities/ExtensibleAttributes/schema.json +4 -1
- package/entities/NetworkViewsAndDNSViews/action.json +63 -0
- package/entities/NetworkViewsAndDNSViews/schema.json +4 -1
- package/entities/Networks/action.json +49 -7
- package/entities/Networks/requestSchema.json +3 -1
- package/entities/Networks/responseSchema.json +3 -1
- package/entities/Records/action.json +7 -7
- package/entities/Services/action.json +22 -1
- package/entities/Services/schema.json +1 -0
- package/entities/Zones/action.json +3 -3
- package/error.json +12 -0
- package/package.json +47 -23
- package/pronghorn.json +1079 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +505 -11
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1594212087590.json +95 -0
- package/report/updateReport1615140322137.json +95 -0
- package/report/updateReport1646675873230.json +95 -0
- package/report/updateReport1653911824054.json +120 -0
- package/sampleProperties.json +110 -6
- package/test/integration/adapterTestBasicGet.js +85 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +390 -181
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +1181 -272
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +0 -1
- package/utils/basicGet.js +50 -0
- package/utils/checkMigrate.js +63 -0
- package/utils/entitiesToDB.js +179 -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/pre-commit.sh +3 -0
- package/utils/removeHooks.js +20 -0
- package/utils/tbScript.js +184 -0
- package/utils/tbUtils.js +469 -0
- package/utils/testRunner.js +16 -16
- package/utils/troubleshootingAdapter.js +190 -0
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
/* global describe it log pronghornProps */
|
|
5
5
|
/* eslint global-require: warn */
|
|
6
6
|
/* eslint no-unused-vars: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
7
8
|
|
|
8
9
|
// include required items for testing & logging
|
|
9
10
|
const assert = require('assert');
|
|
@@ -18,22 +19,31 @@ const { use } = require('chai');
|
|
|
18
19
|
const td = require('testdouble');
|
|
19
20
|
|
|
20
21
|
const anything = td.matchers.anything();
|
|
21
|
-
|
|
22
|
-
// stub and attemptTimeout are used throughout the code so set them here
|
|
23
22
|
let logLevel = 'none';
|
|
24
|
-
const stub = true;
|
|
25
23
|
const isRapidFail = false;
|
|
26
|
-
|
|
24
|
+
|
|
25
|
+
// read in the properties from the sampleProperties files
|
|
26
|
+
let adaptdir = __dirname;
|
|
27
|
+
if (adaptdir.endsWith('/test/integration')) {
|
|
28
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 17);
|
|
29
|
+
} else if (adaptdir.endsWith('/test/unit')) {
|
|
30
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 10);
|
|
31
|
+
}
|
|
32
|
+
const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
|
|
27
33
|
|
|
28
34
|
// these variables can be changed to run in integrated mode so easier to set them here
|
|
29
35
|
// always check these in with bogus data!!!
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
samProps.stub = true;
|
|
37
|
+
samProps.host = 'replace.hostorip.here';
|
|
38
|
+
samProps.authentication.username = 'username';
|
|
39
|
+
samProps.authentication.password = 'password';
|
|
40
|
+
samProps.protocol = 'http';
|
|
41
|
+
samProps.port = 80;
|
|
42
|
+
samProps.ssl.enabled = false;
|
|
43
|
+
samProps.ssl.accept_invalid_cert = false;
|
|
44
|
+
samProps.request.attempt_timeout = 60000;
|
|
45
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
46
|
+
const { stub } = samProps;
|
|
37
47
|
|
|
38
48
|
// these are the adapter properties. You generally should not need to alter
|
|
39
49
|
// any of these after they are initially set up
|
|
@@ -43,89 +53,9 @@ global.pronghornProps = {
|
|
|
43
53
|
},
|
|
44
54
|
adapterProps: {
|
|
45
55
|
adapters: [{
|
|
46
|
-
id: 'infoblox',
|
|
56
|
+
id: 'Test-infoblox',
|
|
47
57
|
type: 'Infoblox',
|
|
48
|
-
properties:
|
|
49
|
-
host,
|
|
50
|
-
port,
|
|
51
|
-
base_path: '/wapi',
|
|
52
|
-
version: 'v1',
|
|
53
|
-
cache_location: 'none',
|
|
54
|
-
save_metric: false,
|
|
55
|
-
stub,
|
|
56
|
-
protocol,
|
|
57
|
-
authentication: {
|
|
58
|
-
auth_method: 'basic user_password',
|
|
59
|
-
username,
|
|
60
|
-
password,
|
|
61
|
-
token: '',
|
|
62
|
-
invalid_token_error: 401,
|
|
63
|
-
token_timeout: -1,
|
|
64
|
-
token_cache: 'local',
|
|
65
|
-
auth_field: 'header.headers.Authorization',
|
|
66
|
-
auth_field_format: 'Basic {b64}{username}:{password}{/b64}'
|
|
67
|
-
},
|
|
68
|
-
healthcheck: {
|
|
69
|
-
type: 'startup',
|
|
70
|
-
frequency: 60000
|
|
71
|
-
},
|
|
72
|
-
throttle: {
|
|
73
|
-
throttle_enabled: false,
|
|
74
|
-
number_pronghorns: 1,
|
|
75
|
-
sync_async: 'sync',
|
|
76
|
-
max_in_queue: 1000,
|
|
77
|
-
concurrent_max: 1,
|
|
78
|
-
expire_timeout: 0,
|
|
79
|
-
avg_runtime: 200
|
|
80
|
-
},
|
|
81
|
-
request: {
|
|
82
|
-
number_redirects: 0,
|
|
83
|
-
number_retries: 3,
|
|
84
|
-
limit_retry_error: 0,
|
|
85
|
-
failover_codes: [],
|
|
86
|
-
attempt_timeout: attemptTimeout,
|
|
87
|
-
global_request: {
|
|
88
|
-
payload: {},
|
|
89
|
-
uriOptions: {},
|
|
90
|
-
addlHeaders: {},
|
|
91
|
-
authData: {}
|
|
92
|
-
},
|
|
93
|
-
healthcheck_on_timeout: false,
|
|
94
|
-
return_raw: true,
|
|
95
|
-
archiving: false
|
|
96
|
-
},
|
|
97
|
-
proxy: {
|
|
98
|
-
enabled: false,
|
|
99
|
-
host: '',
|
|
100
|
-
port: 1,
|
|
101
|
-
protocol: 'http'
|
|
102
|
-
},
|
|
103
|
-
ssl: {
|
|
104
|
-
ecdhCurve: '',
|
|
105
|
-
enabled: sslenable,
|
|
106
|
-
accept_invalid_cert: sslinvalid,
|
|
107
|
-
ca_file: '',
|
|
108
|
-
key_file: '',
|
|
109
|
-
cert_file: '',
|
|
110
|
-
secure_protocol: '',
|
|
111
|
-
ciphers: ''
|
|
112
|
-
},
|
|
113
|
-
mongo: {
|
|
114
|
-
host: '',
|
|
115
|
-
port: 0,
|
|
116
|
-
database: '',
|
|
117
|
-
username: '',
|
|
118
|
-
password: '',
|
|
119
|
-
replSet: '',
|
|
120
|
-
db_ssl: {
|
|
121
|
-
enabled: false,
|
|
122
|
-
accept_invalid_cert: false,
|
|
123
|
-
ca_file: '',
|
|
124
|
-
key_file: '',
|
|
125
|
-
cert_file: ''
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
58
|
+
properties: samProps
|
|
129
59
|
}]
|
|
130
60
|
}
|
|
131
61
|
};
|
|
@@ -185,9 +115,8 @@ function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
|
185
115
|
assert.equal(displayStr, error.IAPerror.displayString);
|
|
186
116
|
}
|
|
187
117
|
|
|
188
|
-
|
|
189
118
|
// require the adapter that we are going to be using
|
|
190
|
-
const Infoblox = require('../../adapter
|
|
119
|
+
const Infoblox = require('../../adapter');
|
|
191
120
|
|
|
192
121
|
// delete the .DS_Store directory in entities -- otherwise this will cause errors
|
|
193
122
|
const dirPath = path.join(__dirname, '../../entities/.DS_Store');
|
|
@@ -229,6 +158,8 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
229
158
|
try {
|
|
230
159
|
assert.notEqual(null, a);
|
|
231
160
|
assert.notEqual(undefined, a);
|
|
161
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
162
|
+
assert.equal(checkId, a.id);
|
|
232
163
|
assert.notEqual(null, a.allProps);
|
|
233
164
|
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
234
165
|
assert.equal(check, a.healthcheckType);
|
|
@@ -255,10 +186,10 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
255
186
|
});
|
|
256
187
|
|
|
257
188
|
let wffunctions = [];
|
|
258
|
-
describe('#
|
|
189
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
259
190
|
it('should retrieve workflow functions', (done) => {
|
|
260
191
|
try {
|
|
261
|
-
wffunctions = a.
|
|
192
|
+
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
262
193
|
|
|
263
194
|
try {
|
|
264
195
|
assert.notEqual(0, wffunctions.length);
|
|
@@ -310,13 +241,103 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
310
241
|
done(error);
|
|
311
242
|
}
|
|
312
243
|
});
|
|
313
|
-
it('package.json should be customized', (done) => {
|
|
244
|
+
it('package.json standard fields should be customized', (done) => {
|
|
314
245
|
try {
|
|
315
246
|
const packageDotJson = require('../../package.json');
|
|
316
247
|
assert.notEqual(-1, packageDotJson.name.indexOf('infoblox'));
|
|
317
248
|
assert.notEqual(undefined, packageDotJson.version);
|
|
318
249
|
assert.notEqual(null, packageDotJson.version);
|
|
319
250
|
assert.notEqual('', packageDotJson.version);
|
|
251
|
+
assert.notEqual(undefined, packageDotJson.description);
|
|
252
|
+
assert.notEqual(null, packageDotJson.description);
|
|
253
|
+
assert.notEqual('', packageDotJson.description);
|
|
254
|
+
assert.equal('adapter.js', packageDotJson.main);
|
|
255
|
+
assert.notEqual(undefined, packageDotJson.wizardVersion);
|
|
256
|
+
assert.notEqual(null, packageDotJson.wizardVersion);
|
|
257
|
+
assert.notEqual('', packageDotJson.wizardVersion);
|
|
258
|
+
assert.notEqual(undefined, packageDotJson.engineVersion);
|
|
259
|
+
assert.notEqual(null, packageDotJson.engineVersion);
|
|
260
|
+
assert.notEqual('', packageDotJson.engineVersion);
|
|
261
|
+
assert.equal('http', packageDotJson.adapterType);
|
|
262
|
+
done();
|
|
263
|
+
} catch (error) {
|
|
264
|
+
log.error(`Test Failure: ${error}`);
|
|
265
|
+
done(error);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
it('package.json proper scripts should be provided', (done) => {
|
|
269
|
+
try {
|
|
270
|
+
const packageDotJson = require('../../package.json');
|
|
271
|
+
assert.notEqual(undefined, packageDotJson.scripts);
|
|
272
|
+
assert.notEqual(null, packageDotJson.scripts);
|
|
273
|
+
assert.notEqual('', packageDotJson.scripts);
|
|
274
|
+
assert.equal('node utils/setup.js && npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions', packageDotJson.scripts.preinstall);
|
|
275
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
|
|
276
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
|
|
277
|
+
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
|
|
278
|
+
assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
|
|
279
|
+
assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
|
|
280
|
+
assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
|
|
281
|
+
assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
|
|
282
|
+
assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
|
|
283
|
+
assert.equal('npm run deploy', packageDotJson.scripts.build);
|
|
284
|
+
done();
|
|
285
|
+
} catch (error) {
|
|
286
|
+
log.error(`Test Failure: ${error}`);
|
|
287
|
+
done(error);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
it('package.json proper directories should be provided', (done) => {
|
|
291
|
+
try {
|
|
292
|
+
const packageDotJson = require('../../package.json');
|
|
293
|
+
assert.notEqual(undefined, packageDotJson.repository);
|
|
294
|
+
assert.notEqual(null, packageDotJson.repository);
|
|
295
|
+
assert.notEqual('', packageDotJson.repository);
|
|
296
|
+
assert.equal('git', packageDotJson.repository.type);
|
|
297
|
+
assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
|
|
298
|
+
assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
|
|
299
|
+
done();
|
|
300
|
+
} catch (error) {
|
|
301
|
+
log.error(`Test Failure: ${error}`);
|
|
302
|
+
done(error);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
it('package.json proper dependencies should be provided', (done) => {
|
|
306
|
+
try {
|
|
307
|
+
const packageDotJson = require('../../package.json');
|
|
308
|
+
assert.notEqual(undefined, packageDotJson.dependencies);
|
|
309
|
+
assert.notEqual(null, packageDotJson.dependencies);
|
|
310
|
+
assert.notEqual('', packageDotJson.dependencies);
|
|
311
|
+
assert.equal('^6.12.0', packageDotJson.dependencies.ajv);
|
|
312
|
+
assert.equal('^0.21.0', packageDotJson.dependencies.axios);
|
|
313
|
+
assert.equal('^2.20.0', packageDotJson.dependencies.commander);
|
|
314
|
+
assert.equal('^8.1.0', packageDotJson.dependencies['fs-extra']);
|
|
315
|
+
assert.equal('^9.0.1', packageDotJson.dependencies.mocha);
|
|
316
|
+
assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
|
|
317
|
+
assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
|
|
318
|
+
assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
|
|
319
|
+
assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
|
|
320
|
+
assert.equal('^7.3.2', packageDotJson.dependencies.semver);
|
|
321
|
+
assert.equal('^3.3.3', packageDotJson.dependencies.winston);
|
|
322
|
+
done();
|
|
323
|
+
} catch (error) {
|
|
324
|
+
log.error(`Test Failure: ${error}`);
|
|
325
|
+
done(error);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
it('package.json proper dev dependencies should be provided', (done) => {
|
|
329
|
+
try {
|
|
330
|
+
const packageDotJson = require('../../package.json');
|
|
331
|
+
assert.notEqual(undefined, packageDotJson.devDependencies);
|
|
332
|
+
assert.notEqual(null, packageDotJson.devDependencies);
|
|
333
|
+
assert.notEqual('', packageDotJson.devDependencies);
|
|
334
|
+
assert.equal('^4.3.4', packageDotJson.devDependencies.chai);
|
|
335
|
+
assert.equal('^7.29.0', packageDotJson.devDependencies.eslint);
|
|
336
|
+
assert.equal('^14.2.1', packageDotJson.devDependencies['eslint-config-airbnb-base']);
|
|
337
|
+
assert.equal('^2.23.4', packageDotJson.devDependencies['eslint-plugin-import']);
|
|
338
|
+
assert.equal('^3.0.0', packageDotJson.devDependencies['eslint-plugin-json']);
|
|
339
|
+
assert.equal('^0.6.3', packageDotJson.devDependencies['package-json-validator']);
|
|
340
|
+
assert.equal('^3.16.1', packageDotJson.devDependencies.testdouble);
|
|
320
341
|
done();
|
|
321
342
|
} catch (error) {
|
|
322
343
|
log.error(`Test Failure: ${error}`);
|
|
@@ -341,8 +362,35 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
341
362
|
try {
|
|
342
363
|
const pronghornDotJson = require('../../pronghorn.json');
|
|
343
364
|
assert.notEqual(-1, pronghornDotJson.id.indexOf('infoblox'));
|
|
365
|
+
assert.equal('Adapter', pronghornDotJson.type);
|
|
344
366
|
assert.equal('Infoblox', pronghornDotJson.export);
|
|
345
367
|
assert.equal('Infoblox', pronghornDotJson.title);
|
|
368
|
+
assert.equal('adapter.js', pronghornDotJson.src);
|
|
369
|
+
done();
|
|
370
|
+
} catch (error) {
|
|
371
|
+
log.error(`Test Failure: ${error}`);
|
|
372
|
+
done(error);
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
it('pronghorn.json should contain generic adapter methods', (done) => {
|
|
376
|
+
try {
|
|
377
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
378
|
+
assert.notEqual(undefined, pronghornDotJson.methods);
|
|
379
|
+
assert.notEqual(null, pronghornDotJson.methods);
|
|
380
|
+
assert.notEqual('', pronghornDotJson.methods);
|
|
381
|
+
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
382
|
+
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
383
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
|
|
384
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
|
|
385
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
|
|
386
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
|
|
387
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
|
|
388
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
|
|
389
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
|
|
390
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
|
|
391
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
|
|
392
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
393
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
|
|
346
394
|
done();
|
|
347
395
|
} catch (error) {
|
|
348
396
|
log.error(`Test Failure: ${error}`);
|
|
@@ -364,7 +412,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
364
412
|
let wfparams = [];
|
|
365
413
|
|
|
366
414
|
if (methLine && methLine.indexOf('(') >= 0 && methLine.indexOf(')') >= 0) {
|
|
367
|
-
const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.
|
|
415
|
+
const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.lastIndexOf(')'));
|
|
368
416
|
wfparams = temp.split(',');
|
|
369
417
|
|
|
370
418
|
for (let t = 0; t < wfparams.length; t += 1) {
|
|
@@ -481,6 +529,124 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
481
529
|
try {
|
|
482
530
|
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
483
531
|
assert.equal('adapter-infoblox', propertiesDotJson.$id);
|
|
532
|
+
assert.equal('object', propertiesDotJson.type);
|
|
533
|
+
assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
|
|
534
|
+
done();
|
|
535
|
+
} catch (error) {
|
|
536
|
+
log.error(`Test Failure: ${error}`);
|
|
537
|
+
done(error);
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
it('propertiesSchema.json should contain generic adapter properties', (done) => {
|
|
541
|
+
try {
|
|
542
|
+
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
543
|
+
assert.notEqual(undefined, propertiesDotJson.properties);
|
|
544
|
+
assert.notEqual(null, propertiesDotJson.properties);
|
|
545
|
+
assert.notEqual('', propertiesDotJson.properties);
|
|
546
|
+
assert.equal('string', propertiesDotJson.properties.host.type);
|
|
547
|
+
assert.equal('integer', propertiesDotJson.properties.port.type);
|
|
548
|
+
assert.equal('boolean', propertiesDotJson.properties.stub.type);
|
|
549
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
|
|
550
|
+
assert.notEqual(null, propertiesDotJson.definitions.authentication);
|
|
551
|
+
assert.notEqual('', propertiesDotJson.definitions.authentication);
|
|
552
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
|
|
553
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
|
|
554
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
|
|
555
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
|
|
556
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
|
|
557
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
|
|
558
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
|
|
559
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
|
|
560
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
|
|
561
|
+
assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
|
|
562
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
|
|
563
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
|
|
564
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
|
|
565
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
566
|
+
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
567
|
+
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
568
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
569
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
570
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
|
|
571
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
|
|
572
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
|
|
573
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
|
|
574
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
|
|
575
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
|
|
576
|
+
assert.equal('string', propertiesDotJson.properties.base_path.type);
|
|
577
|
+
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
578
|
+
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
579
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
580
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
|
|
581
|
+
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
582
|
+
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
583
|
+
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
584
|
+
assert.notEqual(null, propertiesDotJson.definitions);
|
|
585
|
+
assert.notEqual('', propertiesDotJson.definitions);
|
|
586
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
|
|
587
|
+
assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
|
|
588
|
+
assert.notEqual('', propertiesDotJson.definitions.healthcheck);
|
|
589
|
+
assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
|
|
590
|
+
assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
|
|
591
|
+
assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
|
|
592
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
|
|
593
|
+
assert.notEqual(null, propertiesDotJson.definitions.throttle);
|
|
594
|
+
assert.notEqual('', propertiesDotJson.definitions.throttle);
|
|
595
|
+
assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
|
|
596
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
|
|
597
|
+
assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
|
|
598
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
|
|
599
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
|
|
600
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
|
|
601
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
|
|
602
|
+
assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
|
|
603
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.request);
|
|
604
|
+
assert.notEqual(null, propertiesDotJson.definitions.request);
|
|
605
|
+
assert.notEqual('', propertiesDotJson.definitions.request);
|
|
606
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
|
|
607
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
|
|
608
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
|
|
609
|
+
assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
|
|
610
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
|
|
611
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
|
|
612
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
|
|
613
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
|
|
614
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
|
|
615
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
|
|
616
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
|
|
617
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
|
|
618
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
|
|
619
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
|
|
620
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
|
|
621
|
+
assert.notEqual(null, propertiesDotJson.definitions.proxy);
|
|
622
|
+
assert.notEqual('', propertiesDotJson.definitions.proxy);
|
|
623
|
+
assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
|
|
624
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
|
|
625
|
+
assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
|
|
626
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
|
|
627
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
|
|
628
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
|
|
629
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
|
|
630
|
+
assert.notEqual(null, propertiesDotJson.definitions.mongo);
|
|
631
|
+
assert.notEqual('', propertiesDotJson.definitions.mongo);
|
|
632
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
|
|
633
|
+
assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
|
|
634
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
|
|
635
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
|
|
636
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
|
|
637
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
|
|
638
|
+
assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
|
|
639
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
|
|
640
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
|
|
641
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
|
|
642
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
|
|
643
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
|
|
644
|
+
assert.notEqual('', propertiesDotJson.definitions.devicebroker);
|
|
645
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
|
|
646
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
|
|
647
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
|
|
648
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
|
|
649
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
|
|
484
650
|
done();
|
|
485
651
|
} catch (error) {
|
|
486
652
|
log.error(`Test Failure: ${error}`);
|
|
@@ -501,6 +667,50 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
501
667
|
done(error);
|
|
502
668
|
}
|
|
503
669
|
});
|
|
670
|
+
it('error.json should have standard adapter errors', (done) => {
|
|
671
|
+
try {
|
|
672
|
+
const errorDotJson = require('../../error.json');
|
|
673
|
+
assert.notEqual(undefined, errorDotJson.errors);
|
|
674
|
+
assert.notEqual(null, errorDotJson.errors);
|
|
675
|
+
assert.notEqual('', errorDotJson.errors);
|
|
676
|
+
assert.equal(true, Array.isArray(errorDotJson.errors));
|
|
677
|
+
assert.notEqual(0, errorDotJson.errors.length);
|
|
678
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
|
|
679
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
|
|
680
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
|
|
681
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
|
|
682
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
|
|
683
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
|
|
684
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
|
|
685
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
|
|
686
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
|
|
687
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
|
|
688
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
|
|
689
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
|
|
690
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
|
|
691
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
|
|
692
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
|
|
693
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
|
|
694
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
|
|
695
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
|
|
696
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
|
|
697
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
|
|
698
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
|
|
699
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
|
|
700
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
|
|
701
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
|
|
702
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
|
|
703
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
|
|
704
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
|
|
705
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
|
|
706
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
|
|
707
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
|
|
708
|
+
done();
|
|
709
|
+
} catch (error) {
|
|
710
|
+
log.error(`Test Failure: ${error}`);
|
|
711
|
+
done(error);
|
|
712
|
+
}
|
|
713
|
+
});
|
|
504
714
|
});
|
|
505
715
|
|
|
506
716
|
describe('sampleProperties.json', () => {
|
|
@@ -515,6 +725,121 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
515
725
|
done(error);
|
|
516
726
|
}
|
|
517
727
|
});
|
|
728
|
+
it('sampleProperties.json should contain generic adapter properties', (done) => {
|
|
729
|
+
try {
|
|
730
|
+
const sampleDotJson = require('../../sampleProperties.json');
|
|
731
|
+
assert.notEqual(-1, sampleDotJson.id.indexOf('infoblox'));
|
|
732
|
+
assert.equal('Infoblox', sampleDotJson.type);
|
|
733
|
+
assert.notEqual(undefined, sampleDotJson.properties);
|
|
734
|
+
assert.notEqual(null, sampleDotJson.properties);
|
|
735
|
+
assert.notEqual('', sampleDotJson.properties);
|
|
736
|
+
assert.notEqual(undefined, sampleDotJson.properties.host);
|
|
737
|
+
assert.notEqual(undefined, sampleDotJson.properties.port);
|
|
738
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
739
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication);
|
|
740
|
+
assert.notEqual(null, sampleDotJson.properties.authentication);
|
|
741
|
+
assert.notEqual('', sampleDotJson.properties.authentication);
|
|
742
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
|
|
743
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
|
|
744
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
|
|
745
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
|
|
746
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
|
|
747
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
|
|
748
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
|
|
749
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
|
|
750
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
|
|
751
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
|
|
752
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
|
|
753
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
|
|
754
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
|
|
755
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl);
|
|
756
|
+
assert.notEqual(null, sampleDotJson.properties.ssl);
|
|
757
|
+
assert.notEqual('', sampleDotJson.properties.ssl);
|
|
758
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
|
|
759
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
|
|
760
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
|
|
761
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
|
|
762
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
|
|
763
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
764
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
765
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
766
|
+
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
767
|
+
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
768
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
769
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
770
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
771
|
+
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
772
|
+
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
773
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
774
|
+
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
775
|
+
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
776
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
|
|
777
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
|
|
778
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
|
|
779
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle);
|
|
780
|
+
assert.notEqual(null, sampleDotJson.properties.throttle);
|
|
781
|
+
assert.notEqual('', sampleDotJson.properties.throttle);
|
|
782
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
|
|
783
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
|
|
784
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
|
|
785
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
|
|
786
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
|
|
787
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
|
|
788
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
|
|
789
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
|
|
790
|
+
assert.notEqual(undefined, sampleDotJson.properties.request);
|
|
791
|
+
assert.notEqual(null, sampleDotJson.properties.request);
|
|
792
|
+
assert.notEqual('', sampleDotJson.properties.request);
|
|
793
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
|
|
794
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
|
|
795
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
|
|
796
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
|
|
797
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
|
|
798
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
|
|
799
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
|
|
800
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
|
|
801
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
|
|
802
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
|
|
803
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
|
|
804
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
|
|
805
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
|
|
806
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
|
|
807
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy);
|
|
808
|
+
assert.notEqual(null, sampleDotJson.properties.proxy);
|
|
809
|
+
assert.notEqual('', sampleDotJson.properties.proxy);
|
|
810
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
|
|
811
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
|
|
812
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
|
|
813
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
|
|
814
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
|
|
815
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
|
|
816
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo);
|
|
817
|
+
assert.notEqual(null, sampleDotJson.properties.mongo);
|
|
818
|
+
assert.notEqual('', sampleDotJson.properties.mongo);
|
|
819
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
|
|
820
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
|
|
821
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
|
|
822
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
|
|
823
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
|
|
824
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
|
|
825
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
|
|
826
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
|
|
827
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
|
|
828
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
829
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
830
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
|
|
831
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
|
|
832
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
|
|
833
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
|
|
834
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
835
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
836
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
837
|
+
done();
|
|
838
|
+
} catch (error) {
|
|
839
|
+
log.error(`Test Failure: ${error}`);
|
|
840
|
+
done(error);
|
|
841
|
+
}
|
|
842
|
+
});
|
|
518
843
|
});
|
|
519
844
|
|
|
520
845
|
describe('#checkProperties', () => {
|
|
@@ -602,6 +927,148 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
602
927
|
});
|
|
603
928
|
});
|
|
604
929
|
|
|
930
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
931
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
932
|
+
try {
|
|
933
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
934
|
+
done();
|
|
935
|
+
} catch (error) {
|
|
936
|
+
log.error(`Test Failure: ${error}`);
|
|
937
|
+
done(error);
|
|
938
|
+
}
|
|
939
|
+
});
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
describe('#iapFindAdapterPath', () => {
|
|
943
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
944
|
+
try {
|
|
945
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
946
|
+
done();
|
|
947
|
+
} catch (error) {
|
|
948
|
+
log.error(`Test Failure: ${error}`);
|
|
949
|
+
done(error);
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
953
|
+
try {
|
|
954
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
955
|
+
try {
|
|
956
|
+
assert.equal(undefined, error);
|
|
957
|
+
assert.notEqual(undefined, data);
|
|
958
|
+
assert.notEqual(null, data);
|
|
959
|
+
assert.equal(true, data.found);
|
|
960
|
+
assert.notEqual(undefined, data.foundIn);
|
|
961
|
+
assert.notEqual(null, data.foundIn);
|
|
962
|
+
assert.notEqual(0, data.foundIn.length);
|
|
963
|
+
done();
|
|
964
|
+
} catch (err) {
|
|
965
|
+
log.error(`Test Failure: ${err}`);
|
|
966
|
+
done(err);
|
|
967
|
+
}
|
|
968
|
+
});
|
|
969
|
+
} catch (error) {
|
|
970
|
+
log.error(`Adapter Exception: ${error}`);
|
|
971
|
+
done(error);
|
|
972
|
+
}
|
|
973
|
+
}).timeout(attemptTimeout);
|
|
974
|
+
});
|
|
975
|
+
|
|
976
|
+
describe('#iapSuspendAdapter', () => {
|
|
977
|
+
it('should have a iapSuspendAdapter function', (done) => {
|
|
978
|
+
try {
|
|
979
|
+
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
|
|
980
|
+
done();
|
|
981
|
+
} catch (error) {
|
|
982
|
+
log.error(`Test Failure: ${error}`);
|
|
983
|
+
done(error);
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
});
|
|
987
|
+
|
|
988
|
+
describe('#iapUnsuspendAdapter', () => {
|
|
989
|
+
it('should have a iapUnsuspendAdapter function', (done) => {
|
|
990
|
+
try {
|
|
991
|
+
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
|
|
992
|
+
done();
|
|
993
|
+
} catch (error) {
|
|
994
|
+
log.error(`Test Failure: ${error}`);
|
|
995
|
+
done(error);
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
describe('#iapGetAdapterQueue', () => {
|
|
1001
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
1002
|
+
try {
|
|
1003
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
1004
|
+
done();
|
|
1005
|
+
} catch (error) {
|
|
1006
|
+
log.error(`Test Failure: ${error}`);
|
|
1007
|
+
done(error);
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
});
|
|
1011
|
+
|
|
1012
|
+
describe('#iapTroubleshootAdapter', () => {
|
|
1013
|
+
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1014
|
+
try {
|
|
1015
|
+
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
|
|
1016
|
+
done();
|
|
1017
|
+
} catch (error) {
|
|
1018
|
+
log.error(`Test Failure: ${error}`);
|
|
1019
|
+
done(error);
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
});
|
|
1023
|
+
|
|
1024
|
+
describe('#iapRunAdapterHealthcheck', () => {
|
|
1025
|
+
it('should have a iapRunAdapterHealthcheck function', (done) => {
|
|
1026
|
+
try {
|
|
1027
|
+
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
|
|
1028
|
+
done();
|
|
1029
|
+
} catch (error) {
|
|
1030
|
+
log.error(`Test Failure: ${error}`);
|
|
1031
|
+
done(error);
|
|
1032
|
+
}
|
|
1033
|
+
});
|
|
1034
|
+
});
|
|
1035
|
+
|
|
1036
|
+
describe('#iapRunAdapterConnectivity', () => {
|
|
1037
|
+
it('should have a iapRunAdapterConnectivity function', (done) => {
|
|
1038
|
+
try {
|
|
1039
|
+
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
|
|
1040
|
+
done();
|
|
1041
|
+
} catch (error) {
|
|
1042
|
+
log.error(`Test Failure: ${error}`);
|
|
1043
|
+
done(error);
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
1046
|
+
});
|
|
1047
|
+
|
|
1048
|
+
describe('#iapRunAdapterBasicGet', () => {
|
|
1049
|
+
it('should have a iapRunAdapterBasicGet function', (done) => {
|
|
1050
|
+
try {
|
|
1051
|
+
assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
|
|
1052
|
+
done();
|
|
1053
|
+
} catch (error) {
|
|
1054
|
+
log.error(`Test Failure: ${error}`);
|
|
1055
|
+
done(error);
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1058
|
+
});
|
|
1059
|
+
|
|
1060
|
+
describe('#iapMoveAdapterEntitiesToDB', () => {
|
|
1061
|
+
it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
|
|
1062
|
+
try {
|
|
1063
|
+
assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
|
|
1064
|
+
done();
|
|
1065
|
+
} catch (error) {
|
|
1066
|
+
log.error(`Test Failure: ${error}`);
|
|
1067
|
+
done(error);
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
});
|
|
1071
|
+
|
|
605
1072
|
describe('#checkActionFiles', () => {
|
|
606
1073
|
it('should have a checkActionFiles function', (done) => {
|
|
607
1074
|
try {
|
|
@@ -687,10 +1154,10 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
687
1154
|
}).timeout(attemptTimeout);
|
|
688
1155
|
});
|
|
689
1156
|
|
|
690
|
-
// describe('#
|
|
691
|
-
// it('should have a
|
|
1157
|
+
// describe('#iapHasAdapterEntity', () => {
|
|
1158
|
+
// it('should have a iapHasAdapterEntity function', (done) => {
|
|
692
1159
|
// try {
|
|
693
|
-
// assert.equal(true, typeof a.
|
|
1160
|
+
// assert.equal(true, typeof a.iapHasAdapterEntity === 'function');
|
|
694
1161
|
// done();
|
|
695
1162
|
// } catch (error) {
|
|
696
1163
|
// log.error(`Test Failure: ${error}`);
|
|
@@ -699,7 +1166,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
699
1166
|
// });
|
|
700
1167
|
// it('should find entity', (done) => {
|
|
701
1168
|
// try {
|
|
702
|
-
// a.
|
|
1169
|
+
// a.iapHasAdapterEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
|
|
703
1170
|
// try {
|
|
704
1171
|
// assert.equal(true, data[0]);
|
|
705
1172
|
// done();
|
|
@@ -715,7 +1182,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
715
1182
|
// }).timeout(attemptTimeout);
|
|
716
1183
|
// it('should not find entity', (done) => {
|
|
717
1184
|
// try {
|
|
718
|
-
// a.
|
|
1185
|
+
// a.iapHasAdapterEntity('template_entity', 'blah', (data) => {
|
|
719
1186
|
// try {
|
|
720
1187
|
// assert.equal(false, data[0]);
|
|
721
1188
|
// done();
|
|
@@ -731,6 +1198,78 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
731
1198
|
// }).timeout(attemptTimeout);
|
|
732
1199
|
// });
|
|
733
1200
|
|
|
1201
|
+
describe('#hasEntities', () => {
|
|
1202
|
+
it('should have a hasEntities function', (done) => {
|
|
1203
|
+
try {
|
|
1204
|
+
assert.equal(true, typeof a.hasEntities === 'function');
|
|
1205
|
+
done();
|
|
1206
|
+
} catch (error) {
|
|
1207
|
+
log.error(`Test Failure: ${error}`);
|
|
1208
|
+
done(error);
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
describe('#getDevice', () => {
|
|
1214
|
+
it('should have a getDevice function', (done) => {
|
|
1215
|
+
try {
|
|
1216
|
+
assert.equal(true, typeof a.getDevice === 'function');
|
|
1217
|
+
done();
|
|
1218
|
+
} catch (error) {
|
|
1219
|
+
log.error(`Test Failure: ${error}`);
|
|
1220
|
+
done(error);
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
describe('#getDevicesFiltered', () => {
|
|
1226
|
+
it('should have a getDevicesFiltered function', (done) => {
|
|
1227
|
+
try {
|
|
1228
|
+
assert.equal(true, typeof a.getDevicesFiltered === 'function');
|
|
1229
|
+
done();
|
|
1230
|
+
} catch (error) {
|
|
1231
|
+
log.error(`Test Failure: ${error}`);
|
|
1232
|
+
done(error);
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
});
|
|
1236
|
+
|
|
1237
|
+
describe('#isAlive', () => {
|
|
1238
|
+
it('should have a isAlive function', (done) => {
|
|
1239
|
+
try {
|
|
1240
|
+
assert.equal(true, typeof a.isAlive === 'function');
|
|
1241
|
+
done();
|
|
1242
|
+
} catch (error) {
|
|
1243
|
+
log.error(`Test Failure: ${error}`);
|
|
1244
|
+
done(error);
|
|
1245
|
+
}
|
|
1246
|
+
});
|
|
1247
|
+
});
|
|
1248
|
+
|
|
1249
|
+
describe('#getConfig', () => {
|
|
1250
|
+
it('should have a getConfig function', (done) => {
|
|
1251
|
+
try {
|
|
1252
|
+
assert.equal(true, typeof a.getConfig === 'function');
|
|
1253
|
+
done();
|
|
1254
|
+
} catch (error) {
|
|
1255
|
+
log.error(`Test Failure: ${error}`);
|
|
1256
|
+
done(error);
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
describe('#iapGetDeviceCount', () => {
|
|
1262
|
+
it('should have a iapGetDeviceCount function', (done) => {
|
|
1263
|
+
try {
|
|
1264
|
+
assert.equal(true, typeof a.iapGetDeviceCount === 'function');
|
|
1265
|
+
done();
|
|
1266
|
+
} catch (error) {
|
|
1267
|
+
log.error(`Test Failure: ${error}`);
|
|
1268
|
+
done(error);
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
});
|
|
1272
|
+
|
|
734
1273
|
/*
|
|
735
1274
|
-----------------------------------------------------------------------
|
|
736
1275
|
-----------------------------------------------------------------------
|
|
@@ -755,7 +1294,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
755
1294
|
a.createNetwork(null, null, (data, error) => {
|
|
756
1295
|
try {
|
|
757
1296
|
const displayE = 'network is required';
|
|
758
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createNetwork', displayE);
|
|
1297
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createNetwork', displayE);
|
|
759
1298
|
done();
|
|
760
1299
|
} catch (err) {
|
|
761
1300
|
log.error(`Test Failure: ${err}`);
|
|
@@ -772,7 +1311,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
772
1311
|
a.createNetwork('1.1.1.1', null, (data, error) => {
|
|
773
1312
|
try {
|
|
774
1313
|
const displayE = 'comment is required';
|
|
775
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createNetwork', displayE);
|
|
1314
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createNetwork', displayE);
|
|
776
1315
|
done();
|
|
777
1316
|
} catch (err) {
|
|
778
1317
|
log.error(`Test Failure: ${err}`);
|
|
@@ -801,7 +1340,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
801
1340
|
a.getNetworkKeyByIP(null, (data, error) => {
|
|
802
1341
|
try {
|
|
803
1342
|
const displayE = 'networkIP is required';
|
|
804
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getNetworkKeyByIP', displayE);
|
|
1343
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkKeyByIP', displayE);
|
|
805
1344
|
done();
|
|
806
1345
|
} catch (err) {
|
|
807
1346
|
log.error(`Test Failure: ${err}`);
|
|
@@ -830,7 +1369,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
830
1369
|
a.createAuthZone(null, (data, error) => {
|
|
831
1370
|
try {
|
|
832
1371
|
const displayE = 'fqdnName is required';
|
|
833
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createAuthZone', displayE);
|
|
1372
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createAuthZone', displayE);
|
|
834
1373
|
done();
|
|
835
1374
|
} catch (err) {
|
|
836
1375
|
log.error(`Test Failure: ${err}`);
|
|
@@ -859,7 +1398,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
859
1398
|
a.createHostRecord(null, null, null, (data, error) => {
|
|
860
1399
|
try {
|
|
861
1400
|
const displayE = 'hostName is required';
|
|
862
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createHostRecord', displayE);
|
|
1401
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createHostRecord', displayE);
|
|
863
1402
|
done();
|
|
864
1403
|
} catch (err) {
|
|
865
1404
|
log.error(`Test Failure: ${err}`);
|
|
@@ -876,7 +1415,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
876
1415
|
a.createHostRecord('itential.com', null, null, (data, error) => {
|
|
877
1416
|
try {
|
|
878
1417
|
const displayE = 'IPAddress is required';
|
|
879
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createHostRecord', displayE);
|
|
1418
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createHostRecord', displayE);
|
|
880
1419
|
done();
|
|
881
1420
|
} catch (err) {
|
|
882
1421
|
log.error(`Test Failure: ${err}`);
|
|
@@ -905,7 +1444,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
905
1444
|
a.createHostRecord2(null, null, null, (data, error) => {
|
|
906
1445
|
try {
|
|
907
1446
|
const displayE = 'hostName is required';
|
|
908
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createHostRecord2', displayE);
|
|
1447
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createHostRecord2', displayE);
|
|
909
1448
|
done();
|
|
910
1449
|
} catch (err) {
|
|
911
1450
|
log.error(`Test Failure: ${err}`);
|
|
@@ -922,7 +1461,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
922
1461
|
a.createHostRecord2('itential.com', null, null, (data, error) => {
|
|
923
1462
|
try {
|
|
924
1463
|
const displayE = 'IPAddress is required';
|
|
925
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createHostRecord2', displayE);
|
|
1464
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createHostRecord2', displayE);
|
|
926
1465
|
done();
|
|
927
1466
|
} catch (err) {
|
|
928
1467
|
log.error(`Test Failure: ${err}`);
|
|
@@ -951,7 +1490,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
951
1490
|
a.getIpByHost(null, (data, error) => {
|
|
952
1491
|
try {
|
|
953
1492
|
const displayE = 'hostName is required';
|
|
954
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getIpByHost', displayE);
|
|
1493
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getIpByHost', displayE);
|
|
955
1494
|
done();
|
|
956
1495
|
} catch (err) {
|
|
957
1496
|
log.error(`Test Failure: ${err}`);
|
|
@@ -980,7 +1519,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
980
1519
|
a.getHostKeyByHostName(null, (data, error) => {
|
|
981
1520
|
try {
|
|
982
1521
|
const displayE = 'hostName is required';
|
|
983
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getHostKeyByHostName', displayE);
|
|
1522
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getHostKeyByHostName', displayE);
|
|
984
1523
|
done();
|
|
985
1524
|
} catch (err) {
|
|
986
1525
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1009,7 +1548,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1009
1548
|
a.deleteHostRecordByHostName(null, (data, error) => {
|
|
1010
1549
|
try {
|
|
1011
1550
|
const displayE = 'hostName is required';
|
|
1012
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-deleteHostRecordByHostName', displayE);
|
|
1551
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteHostRecordByHostName', displayE);
|
|
1013
1552
|
done();
|
|
1014
1553
|
} catch (err) {
|
|
1015
1554
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1038,7 +1577,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1038
1577
|
a.assignNextNetwork(null, null, null, (data, error) => {
|
|
1039
1578
|
try {
|
|
1040
1579
|
const displayE = 'networkBlock is required';
|
|
1041
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-assignNextNetwork', displayE);
|
|
1580
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-assignNextNetwork', displayE);
|
|
1042
1581
|
done();
|
|
1043
1582
|
} catch (err) {
|
|
1044
1583
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1055,7 +1594,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1055
1594
|
a.assignNextNetwork('fakedata', null, null, (data, error) => {
|
|
1056
1595
|
try {
|
|
1057
1596
|
const displayE = 'nextNetworkSubnetMask is required';
|
|
1058
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-assignNextNetwork', displayE);
|
|
1597
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-assignNextNetwork', displayE);
|
|
1059
1598
|
done();
|
|
1060
1599
|
} catch (err) {
|
|
1061
1600
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1084,7 +1623,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1084
1623
|
a.assignNextNetworkByNetwork(null, null, null, null, null, (data, error) => {
|
|
1085
1624
|
try {
|
|
1086
1625
|
const displayE = 'networkBlock is required';
|
|
1087
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-assignNextNetworkByNetwork', displayE);
|
|
1626
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-assignNextNetworkByNetwork', displayE);
|
|
1088
1627
|
done();
|
|
1089
1628
|
} catch (err) {
|
|
1090
1629
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1101,7 +1640,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1101
1640
|
a.assignNextNetworkByNetwork('fakedata', null, null, null, null, (data, error) => {
|
|
1102
1641
|
try {
|
|
1103
1642
|
const displayE = 'nextNetworkSubnetMask is required';
|
|
1104
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-assignNextNetworkByNetwork', displayE);
|
|
1643
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-assignNextNetworkByNetwork', displayE);
|
|
1105
1644
|
done();
|
|
1106
1645
|
} catch (err) {
|
|
1107
1646
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1130,7 +1669,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1130
1669
|
a.assignNextNetworkByRef(null, null, null, null, null, (data, error) => {
|
|
1131
1670
|
try {
|
|
1132
1671
|
const displayE = 'networkReference is required';
|
|
1133
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-assignNextNetworkByRef', displayE);
|
|
1672
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-assignNextNetworkByRef', displayE);
|
|
1134
1673
|
done();
|
|
1135
1674
|
} catch (err) {
|
|
1136
1675
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1147,7 +1686,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1147
1686
|
a.assignNextNetworkByRef('fakedata', null, null, null, null, (data, error) => {
|
|
1148
1687
|
try {
|
|
1149
1688
|
const displayE = 'nextNetworkSubnetMask is required';
|
|
1150
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-assignNextNetworkByRef', displayE);
|
|
1689
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-assignNextNetworkByRef', displayE);
|
|
1151
1690
|
done();
|
|
1152
1691
|
} catch (err) {
|
|
1153
1692
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1176,7 +1715,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1176
1715
|
a.assignNextIP(null, ' ', ' ', (data, error) => {
|
|
1177
1716
|
try {
|
|
1178
1717
|
const displayE = 'networkIP is required';
|
|
1179
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-assignNextIP', displayE);
|
|
1718
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-assignNextIP', displayE);
|
|
1180
1719
|
done();
|
|
1181
1720
|
} catch (err) {
|
|
1182
1721
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1193,7 +1732,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1193
1732
|
a.assignNextIP(' ', null, ' ', (data, error) => {
|
|
1194
1733
|
try {
|
|
1195
1734
|
const displayE = 'hostName is required';
|
|
1196
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-assignNextIP', displayE);
|
|
1735
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-assignNextIP', displayE);
|
|
1197
1736
|
done();
|
|
1198
1737
|
} catch (err) {
|
|
1199
1738
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1210,7 +1749,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1210
1749
|
a.assignNextIP(' ', ' ', null, (data, error) => {
|
|
1211
1750
|
try {
|
|
1212
1751
|
const displayE = 'fqdnName is required';
|
|
1213
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-assignNextIP', displayE);
|
|
1752
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-assignNextIP', displayE);
|
|
1214
1753
|
done();
|
|
1215
1754
|
} catch (err) {
|
|
1216
1755
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1238,8 +1777,8 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1238
1777
|
try {
|
|
1239
1778
|
a.getAuthZoneDetailsByfqdnName(null, (data, error) => {
|
|
1240
1779
|
try {
|
|
1241
|
-
const displayE = '
|
|
1242
|
-
runErrorAsserts(data, error, 'AD.
|
|
1780
|
+
const displayE = 'fqdnName is required';
|
|
1781
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getAuthZoneDetailsByfqdnName', displayE);
|
|
1243
1782
|
done();
|
|
1244
1783
|
} catch (err) {
|
|
1245
1784
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1271,16 +1810,190 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1271
1810
|
assert.equal(true, typeof a.createForwardZone === 'function');
|
|
1272
1811
|
done();
|
|
1273
1812
|
} catch (error) {
|
|
1274
|
-
log.error(`Test Failure: ${error}`);
|
|
1813
|
+
log.error(`Test Failure: ${error}`);
|
|
1814
|
+
done(error);
|
|
1815
|
+
}
|
|
1816
|
+
}).timeout(attemptTimeout);
|
|
1817
|
+
it('should error if - missing body', (done) => {
|
|
1818
|
+
try {
|
|
1819
|
+
a.createForwardZone(null, (data, error) => {
|
|
1820
|
+
try {
|
|
1821
|
+
const displayE = 'body is required';
|
|
1822
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createForwardZone', displayE);
|
|
1823
|
+
done();
|
|
1824
|
+
} catch (err) {
|
|
1825
|
+
log.error(`Test Failure: ${err}`);
|
|
1826
|
+
done(err);
|
|
1827
|
+
}
|
|
1828
|
+
});
|
|
1829
|
+
} catch (error) {
|
|
1830
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1831
|
+
done(error);
|
|
1832
|
+
}
|
|
1833
|
+
}).timeout(attemptTimeout);
|
|
1834
|
+
});
|
|
1835
|
+
|
|
1836
|
+
describe('#deleteZones - errors', () => {
|
|
1837
|
+
it('should have a deleteZones function', (done) => {
|
|
1838
|
+
try {
|
|
1839
|
+
assert.equal(true, typeof a.deleteZones === 'function');
|
|
1840
|
+
done();
|
|
1841
|
+
} catch (error) {
|
|
1842
|
+
log.error(`Test Failure: ${error}`);
|
|
1843
|
+
done(error);
|
|
1844
|
+
}
|
|
1845
|
+
}).timeout(attemptTimeout);
|
|
1846
|
+
it('should error if - missing objectReference', (done) => {
|
|
1847
|
+
try {
|
|
1848
|
+
a.deleteZones(null, (data, error) => {
|
|
1849
|
+
try {
|
|
1850
|
+
const displayE = 'objectReference is required';
|
|
1851
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteZones', displayE);
|
|
1852
|
+
done();
|
|
1853
|
+
} catch (err) {
|
|
1854
|
+
log.error(`Test Failure: ${err}`);
|
|
1855
|
+
done(err);
|
|
1856
|
+
}
|
|
1857
|
+
});
|
|
1858
|
+
} catch (error) {
|
|
1859
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1860
|
+
done(error);
|
|
1861
|
+
}
|
|
1862
|
+
}).timeout(attemptTimeout);
|
|
1863
|
+
});
|
|
1864
|
+
|
|
1865
|
+
describe('#getZoneDelegations - errors', () => {
|
|
1866
|
+
it('should have a getZoneDelegations function', (done) => {
|
|
1867
|
+
try {
|
|
1868
|
+
assert.equal(true, typeof a.getZoneDelegations === 'function');
|
|
1869
|
+
done();
|
|
1870
|
+
} catch (error) {
|
|
1871
|
+
log.error(`Test Failure: ${error}`);
|
|
1872
|
+
done(error);
|
|
1873
|
+
}
|
|
1874
|
+
}).timeout(attemptTimeout);
|
|
1875
|
+
});
|
|
1876
|
+
|
|
1877
|
+
describe('#createZoneDelegation - errors', () => {
|
|
1878
|
+
it('should have a createZoneDelegation function', (done) => {
|
|
1879
|
+
try {
|
|
1880
|
+
assert.equal(true, typeof a.createZoneDelegation === 'function');
|
|
1881
|
+
done();
|
|
1882
|
+
} catch (error) {
|
|
1883
|
+
log.error(`Test Failure: ${error}`);
|
|
1884
|
+
done(error);
|
|
1885
|
+
}
|
|
1886
|
+
}).timeout(attemptTimeout);
|
|
1887
|
+
it('should error if - missing body', (done) => {
|
|
1888
|
+
try {
|
|
1889
|
+
a.createZoneDelegation(null, (data, error) => {
|
|
1890
|
+
try {
|
|
1891
|
+
const displayE = 'body is required';
|
|
1892
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createZoneDelegation', displayE);
|
|
1893
|
+
done();
|
|
1894
|
+
} catch (err) {
|
|
1895
|
+
log.error(`Test Failure: ${err}`);
|
|
1896
|
+
done(err);
|
|
1897
|
+
}
|
|
1898
|
+
});
|
|
1899
|
+
} catch (error) {
|
|
1900
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1901
|
+
done(error);
|
|
1902
|
+
}
|
|
1903
|
+
}).timeout(attemptTimeout);
|
|
1904
|
+
});
|
|
1905
|
+
|
|
1906
|
+
describe('#deleteAuthZoneByRef - errors', () => {
|
|
1907
|
+
it('should have a deleteAuthZoneByRef function', (done) => {
|
|
1908
|
+
try {
|
|
1909
|
+
assert.equal(true, typeof a.deleteAuthZoneByRef === 'function');
|
|
1910
|
+
done();
|
|
1911
|
+
} catch (error) {
|
|
1912
|
+
log.error(`Test Failure: ${error}`);
|
|
1913
|
+
done(error);
|
|
1914
|
+
}
|
|
1915
|
+
}).timeout(attemptTimeout);
|
|
1916
|
+
it('should error if - missing zoneRef', (done) => {
|
|
1917
|
+
try {
|
|
1918
|
+
a.deleteAuthZoneByRef(null, (data, error) => {
|
|
1919
|
+
try {
|
|
1920
|
+
const displayE = 'zoneRef is required';
|
|
1921
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteAuthZoneByRef', displayE);
|
|
1922
|
+
done();
|
|
1923
|
+
} catch (err) {
|
|
1924
|
+
log.error(`Test Failure: ${err}`);
|
|
1925
|
+
done(err);
|
|
1926
|
+
}
|
|
1927
|
+
});
|
|
1928
|
+
} catch (error) {
|
|
1929
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1930
|
+
done(error);
|
|
1931
|
+
}
|
|
1932
|
+
}).timeout(attemptTimeout);
|
|
1933
|
+
});
|
|
1934
|
+
|
|
1935
|
+
describe('#getNetworkBlock - errors', () => {
|
|
1936
|
+
it('should have a getNetworkBlock function', (done) => {
|
|
1937
|
+
try {
|
|
1938
|
+
assert.equal(true, typeof a.getNetworkBlock === 'function');
|
|
1939
|
+
done();
|
|
1940
|
+
} catch (error) {
|
|
1941
|
+
log.error(`Test Failure: ${error}`);
|
|
1942
|
+
done(error);
|
|
1943
|
+
}
|
|
1944
|
+
}).timeout(attemptTimeout);
|
|
1945
|
+
it('should error if - missing objectReference', (done) => {
|
|
1946
|
+
try {
|
|
1947
|
+
a.getNetworkBlock(null, (data, error) => {
|
|
1948
|
+
try {
|
|
1949
|
+
const displayE = 'objectReference is required';
|
|
1950
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkBlock', displayE);
|
|
1951
|
+
done();
|
|
1952
|
+
} catch (err) {
|
|
1953
|
+
log.error(`Test Failure: ${err}`);
|
|
1954
|
+
done(err);
|
|
1955
|
+
}
|
|
1956
|
+
});
|
|
1957
|
+
} catch (error) {
|
|
1958
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1959
|
+
done(error);
|
|
1960
|
+
}
|
|
1961
|
+
}).timeout(attemptTimeout);
|
|
1962
|
+
});
|
|
1963
|
+
|
|
1964
|
+
describe('#modifyNetworkBlock - errors', () => {
|
|
1965
|
+
it('should have a modifyNetworkBlock function', (done) => {
|
|
1966
|
+
try {
|
|
1967
|
+
assert.equal(true, typeof a.modifyNetworkBlock === 'function');
|
|
1968
|
+
done();
|
|
1969
|
+
} catch (error) {
|
|
1970
|
+
log.error(`Test Failure: ${error}`);
|
|
1971
|
+
done(error);
|
|
1972
|
+
}
|
|
1973
|
+
}).timeout(attemptTimeout);
|
|
1974
|
+
it('should error if - missing objectReference', (done) => {
|
|
1975
|
+
try {
|
|
1976
|
+
a.modifyNetworkBlock(null, null, (data, error) => {
|
|
1977
|
+
try {
|
|
1978
|
+
const displayE = 'networkIP is required';
|
|
1979
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkKeyByIP', displayE);
|
|
1980
|
+
done();
|
|
1981
|
+
} catch (err) {
|
|
1982
|
+
log.error(`Test Failure: ${err}`);
|
|
1983
|
+
done(err);
|
|
1984
|
+
}
|
|
1985
|
+
});
|
|
1986
|
+
} catch (error) {
|
|
1987
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1275
1988
|
done(error);
|
|
1276
1989
|
}
|
|
1277
1990
|
}).timeout(attemptTimeout);
|
|
1278
1991
|
it('should error if - missing body', (done) => {
|
|
1279
1992
|
try {
|
|
1280
|
-
a.
|
|
1993
|
+
a.modifyNetworkBlock('fakeparam', null, (data, error) => {
|
|
1281
1994
|
try {
|
|
1282
|
-
const displayE = '
|
|
1283
|
-
runErrorAsserts(data, error, 'AD.
|
|
1995
|
+
const displayE = 'Schema validation failed on should be string';
|
|
1996
|
+
runErrorAsserts(data, error, 'AD.312', 'Test-infoblox-translatorUtil-buildJSONEntity', displayE);
|
|
1284
1997
|
done();
|
|
1285
1998
|
} catch (err) {
|
|
1286
1999
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1294,22 +2007,22 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1294
2007
|
}).timeout(attemptTimeout);
|
|
1295
2008
|
});
|
|
1296
2009
|
|
|
1297
|
-
describe('#
|
|
1298
|
-
it('should have a
|
|
2010
|
+
describe('#getNetworkContainerNextNetworkIps - errors', () => {
|
|
2011
|
+
it('should have a getNetworkContainerNextNetworkIps function', (done) => {
|
|
1299
2012
|
try {
|
|
1300
|
-
assert.equal(true, typeof a.
|
|
2013
|
+
assert.equal(true, typeof a.getNetworkContainerNextNetworkIps === 'function');
|
|
1301
2014
|
done();
|
|
1302
2015
|
} catch (error) {
|
|
1303
2016
|
log.error(`Test Failure: ${error}`);
|
|
1304
2017
|
done(error);
|
|
1305
2018
|
}
|
|
1306
2019
|
}).timeout(attemptTimeout);
|
|
1307
|
-
it('should error if - missing
|
|
2020
|
+
it('should error if - missing networkId', (done) => {
|
|
1308
2021
|
try {
|
|
1309
|
-
a.
|
|
2022
|
+
a.getNetworkContainerNextNetworkIps(null, null, null, null, (data, error) => {
|
|
1310
2023
|
try {
|
|
1311
|
-
const displayE = '
|
|
1312
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-
|
|
2024
|
+
const displayE = 'networkId is required';
|
|
2025
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkContainerNextNetworkIps', displayE);
|
|
1313
2026
|
done();
|
|
1314
2027
|
} catch (err) {
|
|
1315
2028
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1321,36 +2034,29 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1321
2034
|
done(error);
|
|
1322
2035
|
}
|
|
1323
2036
|
}).timeout(attemptTimeout);
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
describe('#getZoneDelegations - errors', () => {
|
|
1327
|
-
it('should have a getZoneDelegations function', (done) => {
|
|
1328
|
-
try {
|
|
1329
|
-
assert.equal(true, typeof a.getZoneDelegations === 'function');
|
|
1330
|
-
done();
|
|
1331
|
-
} catch (error) {
|
|
1332
|
-
log.error(`Test Failure: ${error}`);
|
|
1333
|
-
done(error);
|
|
1334
|
-
}
|
|
1335
|
-
}).timeout(attemptTimeout);
|
|
1336
|
-
});
|
|
1337
|
-
|
|
1338
|
-
describe('#createZoneDelegation - errors', () => {
|
|
1339
|
-
it('should have a createZoneDelegation function', (done) => {
|
|
2037
|
+
it('should error if - missing containerId', (done) => {
|
|
1340
2038
|
try {
|
|
1341
|
-
|
|
1342
|
-
|
|
2039
|
+
a.getNetworkContainerNextNetworkIps('fakedata', null, null, null, (data, error) => {
|
|
2040
|
+
try {
|
|
2041
|
+
const displayE = 'containerId is required';
|
|
2042
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkContainerNextNetworkIps', displayE);
|
|
2043
|
+
done();
|
|
2044
|
+
} catch (err) {
|
|
2045
|
+
log.error(`Test Failure: ${err}`);
|
|
2046
|
+
done(err);
|
|
2047
|
+
}
|
|
2048
|
+
});
|
|
1343
2049
|
} catch (error) {
|
|
1344
|
-
log.error(`
|
|
2050
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1345
2051
|
done(error);
|
|
1346
2052
|
}
|
|
1347
2053
|
}).timeout(attemptTimeout);
|
|
1348
2054
|
it('should error if - missing body', (done) => {
|
|
1349
2055
|
try {
|
|
1350
|
-
a.
|
|
2056
|
+
a.getNetworkContainerNextNetworkIps('fakedata', 'fakedata', null, null, (data, error) => {
|
|
1351
2057
|
try {
|
|
1352
2058
|
const displayE = 'body is required';
|
|
1353
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-
|
|
2059
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkContainerNextNetworkIps', displayE);
|
|
1354
2060
|
done();
|
|
1355
2061
|
} catch (err) {
|
|
1356
2062
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1362,24 +2068,12 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1362
2068
|
done(error);
|
|
1363
2069
|
}
|
|
1364
2070
|
}).timeout(attemptTimeout);
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
describe('#deleteAuthZoneByRef - errors', () => {
|
|
1368
|
-
it('should have a deleteAuthZoneByRef function', (done) => {
|
|
1369
|
-
try {
|
|
1370
|
-
assert.equal(true, typeof a.deleteAuthZoneByRef === 'function');
|
|
1371
|
-
done();
|
|
1372
|
-
} catch (error) {
|
|
1373
|
-
log.error(`Test Failure: ${error}`);
|
|
1374
|
-
done(error);
|
|
1375
|
-
}
|
|
1376
|
-
}).timeout(attemptTimeout);
|
|
1377
|
-
it('should error if - missing zoneRef', (done) => {
|
|
2071
|
+
it('should error if - missing query', (done) => {
|
|
1378
2072
|
try {
|
|
1379
|
-
a.
|
|
2073
|
+
a.getNetworkContainerNextNetworkIps('fakedata', 'fakedata', { key: 'fakedata' }, null, (data, error) => {
|
|
1380
2074
|
try {
|
|
1381
|
-
const displayE = '
|
|
1382
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-
|
|
2075
|
+
const displayE = 'query is required';
|
|
2076
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkContainerNextNetworkIps', displayE);
|
|
1383
2077
|
done();
|
|
1384
2078
|
} catch (err) {
|
|
1385
2079
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1393,22 +2087,22 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1393
2087
|
}).timeout(attemptTimeout);
|
|
1394
2088
|
});
|
|
1395
2089
|
|
|
1396
|
-
describe('#
|
|
1397
|
-
it('should have a
|
|
2090
|
+
describe('#getIpv6NetworkContainerNextNetworkIps - errors', () => {
|
|
2091
|
+
it('should have a getIpv6NetworkContainerNextNetworkIps function', (done) => {
|
|
1398
2092
|
try {
|
|
1399
|
-
assert.equal(true, typeof a.
|
|
2093
|
+
assert.equal(true, typeof a.getIpv6NetworkContainerNextNetworkIps === 'function');
|
|
1400
2094
|
done();
|
|
1401
2095
|
} catch (error) {
|
|
1402
2096
|
log.error(`Test Failure: ${error}`);
|
|
1403
2097
|
done(error);
|
|
1404
2098
|
}
|
|
1405
2099
|
}).timeout(attemptTimeout);
|
|
1406
|
-
it('should error if - missing
|
|
2100
|
+
it('should error if - missing networkId', (done) => {
|
|
1407
2101
|
try {
|
|
1408
|
-
a.
|
|
2102
|
+
a.getIpv6NetworkContainerNextNetworkIps(null, null, null, null, (data, error) => {
|
|
1409
2103
|
try {
|
|
1410
|
-
const displayE = '
|
|
1411
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-
|
|
2104
|
+
const displayE = 'networkId is required';
|
|
2105
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getIpv6NetworkContainerNextNetworkIps', displayE);
|
|
1412
2106
|
done();
|
|
1413
2107
|
} catch (err) {
|
|
1414
2108
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1420,24 +2114,29 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1420
2114
|
done(error);
|
|
1421
2115
|
}
|
|
1422
2116
|
}).timeout(attemptTimeout);
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
describe('#modifyNetworkBlock - errors', () => {
|
|
1426
|
-
it('should have a modifyNetworkBlock function', (done) => {
|
|
2117
|
+
it('should error if - missing containerId', (done) => {
|
|
1427
2118
|
try {
|
|
1428
|
-
|
|
1429
|
-
|
|
2119
|
+
a.getIpv6NetworkContainerNextNetworkIps('fakedata', null, null, null, (data, error) => {
|
|
2120
|
+
try {
|
|
2121
|
+
const displayE = 'containerId is required';
|
|
2122
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getIpv6NetworkContainerNextNetworkIps', displayE);
|
|
2123
|
+
done();
|
|
2124
|
+
} catch (err) {
|
|
2125
|
+
log.error(`Test Failure: ${err}`);
|
|
2126
|
+
done(err);
|
|
2127
|
+
}
|
|
2128
|
+
});
|
|
1430
2129
|
} catch (error) {
|
|
1431
|
-
log.error(`
|
|
2130
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1432
2131
|
done(error);
|
|
1433
2132
|
}
|
|
1434
2133
|
}).timeout(attemptTimeout);
|
|
1435
|
-
it('should error if - missing
|
|
2134
|
+
it('should error if - missing body', (done) => {
|
|
1436
2135
|
try {
|
|
1437
|
-
a.
|
|
2136
|
+
a.getIpv6NetworkContainerNextNetworkIps('fakedata', 'fakedata', null, null, (data, error) => {
|
|
1438
2137
|
try {
|
|
1439
|
-
const displayE = '
|
|
1440
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-
|
|
2138
|
+
const displayE = 'body is required';
|
|
2139
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getIpv6NetworkContainerNextNetworkIps', displayE);
|
|
1441
2140
|
done();
|
|
1442
2141
|
} catch (err) {
|
|
1443
2142
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1449,12 +2148,12 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1449
2148
|
done(error);
|
|
1450
2149
|
}
|
|
1451
2150
|
}).timeout(attemptTimeout);
|
|
1452
|
-
it('should error if - missing
|
|
2151
|
+
it('should error if - missing query', (done) => {
|
|
1453
2152
|
try {
|
|
1454
|
-
a.
|
|
2153
|
+
a.getIpv6NetworkContainerNextNetworkIps('fakedata', 'fakedata', { key: 'fakedata' }, null, (data, error) => {
|
|
1455
2154
|
try {
|
|
1456
|
-
const displayE = '
|
|
1457
|
-
runErrorAsserts(data, error, 'AD.
|
|
2155
|
+
const displayE = 'query is required';
|
|
2156
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getIpv6NetworkContainerNextNetworkIps', displayE);
|
|
1458
2157
|
done();
|
|
1459
2158
|
} catch (err) {
|
|
1460
2159
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1482,8 +2181,8 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1482
2181
|
try {
|
|
1483
2182
|
a.getNetworkDetails(null, (data, error) => {
|
|
1484
2183
|
try {
|
|
1485
|
-
const displayE = '
|
|
1486
|
-
runErrorAsserts(data, error, 'AD.
|
|
2184
|
+
const displayE = 'networkIP is required';
|
|
2185
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkDetails', displayE);
|
|
1487
2186
|
done();
|
|
1488
2187
|
} catch (err) {
|
|
1489
2188
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1511,8 +2210,8 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1511
2210
|
try {
|
|
1512
2211
|
a.getNetworkContainerDetails(null, (data, error) => {
|
|
1513
2212
|
try {
|
|
1514
|
-
const displayE = '
|
|
1515
|
-
runErrorAsserts(data, error, 'AD.
|
|
2213
|
+
const displayE = 'networkIP is required';
|
|
2214
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkContainerDetails', displayE);
|
|
1516
2215
|
done();
|
|
1517
2216
|
} catch (err) {
|
|
1518
2217
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1553,7 +2252,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1553
2252
|
a.deleteNetworkContainer(null, (data, error) => {
|
|
1554
2253
|
try {
|
|
1555
2254
|
const displayE = 'networkRef is required';
|
|
1556
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-deleteNetworkContainer', displayE);
|
|
2255
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteNetworkContainer', displayE);
|
|
1557
2256
|
done();
|
|
1558
2257
|
} catch (err) {
|
|
1559
2258
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1582,7 +2281,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1582
2281
|
a.genericCreateNextAvailableNetwork(null, null, null, (data, error) => {
|
|
1583
2282
|
try {
|
|
1584
2283
|
const displayE = 'networkRef is required';
|
|
1585
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-genericCreateNextAvailableNetwork', displayE);
|
|
2284
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-genericCreateNextAvailableNetwork', displayE);
|
|
1586
2285
|
done();
|
|
1587
2286
|
} catch (err) {
|
|
1588
2287
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1599,7 +2298,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1599
2298
|
a.genericCreateNextAvailableNetwork('fakeparam', null, null, (data, error) => {
|
|
1600
2299
|
try {
|
|
1601
2300
|
const displayE = 'options is required';
|
|
1602
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-genericCreateNextAvailableNetwork', displayE);
|
|
2301
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-genericCreateNextAvailableNetwork', displayE);
|
|
1603
2302
|
done();
|
|
1604
2303
|
} catch (err) {
|
|
1605
2304
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1616,7 +2315,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1616
2315
|
a.genericCreateNextAvailableNetwork('fakeparam', 'fakeparam', null, (data, error) => {
|
|
1617
2316
|
try {
|
|
1618
2317
|
const displayE = 'body is required';
|
|
1619
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-genericCreateNextAvailableNetwork', displayE);
|
|
2318
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-genericCreateNextAvailableNetwork', displayE);
|
|
1620
2319
|
done();
|
|
1621
2320
|
} catch (err) {
|
|
1622
2321
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1644,8 +2343,8 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1644
2343
|
try {
|
|
1645
2344
|
a.deleteNetwork(null, (data, error) => {
|
|
1646
2345
|
try {
|
|
1647
|
-
const displayE = '
|
|
1648
|
-
runErrorAsserts(data, error, 'AD.
|
|
2346
|
+
const displayE = 'networkIP is required';
|
|
2347
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkContainerDetails', displayE);
|
|
1649
2348
|
done();
|
|
1650
2349
|
} catch (err) {
|
|
1651
2350
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1673,8 +2372,8 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1673
2372
|
try {
|
|
1674
2373
|
a.deleteNetworkv2(null, (data, error) => {
|
|
1675
2374
|
try {
|
|
1676
|
-
const displayE = '
|
|
1677
|
-
runErrorAsserts(data, error, 'AD.
|
|
2375
|
+
const displayE = 'networkIP is required';
|
|
2376
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkDetails', displayE);
|
|
1678
2377
|
done();
|
|
1679
2378
|
} catch (err) {
|
|
1680
2379
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1703,7 +2402,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1703
2402
|
a.getNetworkUtilizationByIP(null, (data, error) => {
|
|
1704
2403
|
try {
|
|
1705
2404
|
const displayE = 'networkIP is required';
|
|
1706
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getNetworkUtilizationByIP', displayE);
|
|
2405
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkUtilizationByIP', displayE);
|
|
1707
2406
|
done();
|
|
1708
2407
|
} catch (err) {
|
|
1709
2408
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1732,7 +2431,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1732
2431
|
a.createNetworkBlock(null, null, null, (data, error) => {
|
|
1733
2432
|
try {
|
|
1734
2433
|
const displayE = 'functionParam is required';
|
|
1735
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createNetworkBlock', displayE);
|
|
2434
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createNetworkBlock', displayE);
|
|
1736
2435
|
done();
|
|
1737
2436
|
} catch (err) {
|
|
1738
2437
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1749,7 +2448,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1749
2448
|
a.createNetworkBlock('fakeparam', null, null, (data, error) => {
|
|
1750
2449
|
try {
|
|
1751
2450
|
const displayE = 'objectReference is required';
|
|
1752
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createNetworkBlock', displayE);
|
|
2451
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createNetworkBlock', displayE);
|
|
1753
2452
|
done();
|
|
1754
2453
|
} catch (err) {
|
|
1755
2454
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1766,7 +2465,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1766
2465
|
a.createNetworkBlock('fakeparam', 'fakeparam', null, (data, error) => {
|
|
1767
2466
|
try {
|
|
1768
2467
|
const displayE = 'body is required';
|
|
1769
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createNetworkBlock', displayE);
|
|
2468
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createNetworkBlock', displayE);
|
|
1770
2469
|
done();
|
|
1771
2470
|
} catch (err) {
|
|
1772
2471
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1807,7 +2506,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1807
2506
|
a.createDtcServer(null, (data, error) => {
|
|
1808
2507
|
try {
|
|
1809
2508
|
const displayE = 'body is required';
|
|
1810
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createDtcServer', displayE);
|
|
2509
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createDtcServer', displayE);
|
|
1811
2510
|
done();
|
|
1812
2511
|
} catch (err) {
|
|
1813
2512
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1848,7 +2547,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1848
2547
|
a.createDtcPool(null, (data, error) => {
|
|
1849
2548
|
try {
|
|
1850
2549
|
const displayE = 'body is required';
|
|
1851
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createDtcPool', displayE);
|
|
2550
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createDtcPool', displayE);
|
|
1852
2551
|
done();
|
|
1853
2552
|
} catch (err) {
|
|
1854
2553
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1877,7 +2576,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1877
2576
|
a.createDtcLbdn(null, (data, error) => {
|
|
1878
2577
|
try {
|
|
1879
2578
|
const displayE = 'body is required';
|
|
1880
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createDtcLbdn', displayE);
|
|
2579
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createDtcLbdn', displayE);
|
|
1881
2580
|
done();
|
|
1882
2581
|
} catch (err) {
|
|
1883
2582
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1906,7 +2605,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1906
2605
|
a.getHostRecord(null, (data, error) => {
|
|
1907
2606
|
try {
|
|
1908
2607
|
const displayE = 'hostName is required';
|
|
1909
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getHostRecord', displayE);
|
|
2608
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getHostRecord', displayE);
|
|
1910
2609
|
done();
|
|
1911
2610
|
} catch (err) {
|
|
1912
2611
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1947,7 +2646,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1947
2646
|
a.createARecord(null, (data, error) => {
|
|
1948
2647
|
try {
|
|
1949
2648
|
const displayE = 'body is required';
|
|
1950
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createARecord', displayE);
|
|
2649
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createARecord', displayE);
|
|
1951
2650
|
done();
|
|
1952
2651
|
} catch (err) {
|
|
1953
2652
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1988,7 +2687,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
1988
2687
|
a.createCNAMERecord(null, (data, error) => {
|
|
1989
2688
|
try {
|
|
1990
2689
|
const displayE = 'body is required';
|
|
1991
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createCNAMERecord', displayE);
|
|
2690
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createCNAMERecord', displayE);
|
|
1992
2691
|
done();
|
|
1993
2692
|
} catch (err) {
|
|
1994
2693
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2029,7 +2728,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2029
2728
|
a.createTxtRecord(null, (data, error) => {
|
|
2030
2729
|
try {
|
|
2031
2730
|
const displayE = 'body is required';
|
|
2032
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createTxtRecord', displayE);
|
|
2731
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createTxtRecord', displayE);
|
|
2033
2732
|
done();
|
|
2034
2733
|
} catch (err) {
|
|
2035
2734
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2058,7 +2757,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2058
2757
|
a.getAllRecords(null, (data, error) => {
|
|
2059
2758
|
try {
|
|
2060
2759
|
const displayE = 'zone is required';
|
|
2061
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getAllRecords', displayE);
|
|
2760
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getAllRecords', displayE);
|
|
2062
2761
|
done();
|
|
2063
2762
|
} catch (err) {
|
|
2064
2763
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2099,7 +2798,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2099
2798
|
a.createAaaaRecord(null, (data, error) => {
|
|
2100
2799
|
try {
|
|
2101
2800
|
const displayE = 'body is required';
|
|
2102
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createAaaaRecord', displayE);
|
|
2801
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createAaaaRecord', displayE);
|
|
2103
2802
|
done();
|
|
2104
2803
|
} catch (err) {
|
|
2105
2804
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2140,7 +2839,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2140
2839
|
a.createMxRecord(null, (data, error) => {
|
|
2141
2840
|
try {
|
|
2142
2841
|
const displayE = 'body is required';
|
|
2143
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createMxRecord', displayE);
|
|
2842
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createMxRecord', displayE);
|
|
2144
2843
|
done();
|
|
2145
2844
|
} catch (err) {
|
|
2146
2845
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2181,7 +2880,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2181
2880
|
a.createNsRecord(null, (data, error) => {
|
|
2182
2881
|
try {
|
|
2183
2882
|
const displayE = 'body is required';
|
|
2184
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createNsRecord', displayE);
|
|
2883
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createNsRecord', displayE);
|
|
2185
2884
|
done();
|
|
2186
2885
|
} catch (err) {
|
|
2187
2886
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2222,7 +2921,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2222
2921
|
a.createPtrRecord(null, (data, error) => {
|
|
2223
2922
|
try {
|
|
2224
2923
|
const displayE = 'body is required';
|
|
2225
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createPtrRecord', displayE);
|
|
2924
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createPtrRecord', displayE);
|
|
2226
2925
|
done();
|
|
2227
2926
|
} catch (err) {
|
|
2228
2927
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2263,7 +2962,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2263
2962
|
a.createSrvRecord(null, (data, error) => {
|
|
2264
2963
|
try {
|
|
2265
2964
|
const displayE = 'body is required';
|
|
2266
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createSrvRecord', displayE);
|
|
2965
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createSrvRecord', displayE);
|
|
2267
2966
|
done();
|
|
2268
2967
|
} catch (err) {
|
|
2269
2968
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2292,7 +2991,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2292
2991
|
a.updateHostRecord(null, null, (data, error) => {
|
|
2293
2992
|
try {
|
|
2294
2993
|
const displayE = 'recordkey is required';
|
|
2295
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updateHostRecord', displayE);
|
|
2994
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateHostRecord', displayE);
|
|
2296
2995
|
done();
|
|
2297
2996
|
} catch (err) {
|
|
2298
2997
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2309,7 +3008,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2309
3008
|
a.updateHostRecord('fakeparam', null, (data, error) => {
|
|
2310
3009
|
try {
|
|
2311
3010
|
const displayE = 'body is required';
|
|
2312
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updateHostRecord', displayE);
|
|
3011
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateHostRecord', displayE);
|
|
2313
3012
|
done();
|
|
2314
3013
|
} catch (err) {
|
|
2315
3014
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2338,7 +3037,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2338
3037
|
a.deleteHostRecord(null, (data, error) => {
|
|
2339
3038
|
try {
|
|
2340
3039
|
const displayE = 'recordkey is required';
|
|
2341
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-deleteHostRecord', displayE);
|
|
3040
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteHostRecord', displayE);
|
|
2342
3041
|
done();
|
|
2343
3042
|
} catch (err) {
|
|
2344
3043
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2367,7 +3066,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2367
3066
|
a.updateARecord(null, null, (data, error) => {
|
|
2368
3067
|
try {
|
|
2369
3068
|
const displayE = 'recordkey is required';
|
|
2370
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updateARecord', displayE);
|
|
3069
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateARecord', displayE);
|
|
2371
3070
|
done();
|
|
2372
3071
|
} catch (err) {
|
|
2373
3072
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2384,7 +3083,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2384
3083
|
a.updateARecord('fakeparam', null, (data, error) => {
|
|
2385
3084
|
try {
|
|
2386
3085
|
const displayE = 'body is required';
|
|
2387
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updateARecord', displayE);
|
|
3086
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateARecord', displayE);
|
|
2388
3087
|
done();
|
|
2389
3088
|
} catch (err) {
|
|
2390
3089
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2413,7 +3112,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2413
3112
|
a.deleteARecord(null, (data, error) => {
|
|
2414
3113
|
try {
|
|
2415
3114
|
const displayE = 'recordkey is required';
|
|
2416
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-deleteARecord', displayE);
|
|
3115
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteARecord', displayE);
|
|
2417
3116
|
done();
|
|
2418
3117
|
} catch (err) {
|
|
2419
3118
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2442,7 +3141,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2442
3141
|
a.updatePTRRecord(null, null, (data, error) => {
|
|
2443
3142
|
try {
|
|
2444
3143
|
const displayE = 'recordkey is required';
|
|
2445
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updatePTRRecord', displayE);
|
|
3144
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updatePTRRecord', displayE);
|
|
2446
3145
|
done();
|
|
2447
3146
|
} catch (err) {
|
|
2448
3147
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2459,7 +3158,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2459
3158
|
a.updatePTRRecord('fakeparam', null, (data, error) => {
|
|
2460
3159
|
try {
|
|
2461
3160
|
const displayE = 'body is required';
|
|
2462
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updatePTRRecord', displayE);
|
|
3161
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updatePTRRecord', displayE);
|
|
2463
3162
|
done();
|
|
2464
3163
|
} catch (err) {
|
|
2465
3164
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2488,7 +3187,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2488
3187
|
a.deletePTRRecord(null, (data, error) => {
|
|
2489
3188
|
try {
|
|
2490
3189
|
const displayE = 'recordkey is required';
|
|
2491
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-deletePTRRecord', displayE);
|
|
3190
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deletePTRRecord', displayE);
|
|
2492
3191
|
done();
|
|
2493
3192
|
} catch (err) {
|
|
2494
3193
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2517,7 +3216,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2517
3216
|
a.updateCNAMERecord(null, null, (data, error) => {
|
|
2518
3217
|
try {
|
|
2519
3218
|
const displayE = 'recordkey is required';
|
|
2520
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updateCNAMERecord', displayE);
|
|
3219
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateCNAMERecord', displayE);
|
|
2521
3220
|
done();
|
|
2522
3221
|
} catch (err) {
|
|
2523
3222
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2534,7 +3233,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2534
3233
|
a.updateCNAMERecord('fakeparam', null, (data, error) => {
|
|
2535
3234
|
try {
|
|
2536
3235
|
const displayE = 'body is required';
|
|
2537
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updateCNAMERecord', displayE);
|
|
3236
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateCNAMERecord', displayE);
|
|
2538
3237
|
done();
|
|
2539
3238
|
} catch (err) {
|
|
2540
3239
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2563,7 +3262,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2563
3262
|
a.deleteCNAMERecord(null, (data, error) => {
|
|
2564
3263
|
try {
|
|
2565
3264
|
const displayE = 'recordkey is required';
|
|
2566
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-deleteCNAMERecord', displayE);
|
|
3265
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteCNAMERecord', displayE);
|
|
2567
3266
|
done();
|
|
2568
3267
|
} catch (err) {
|
|
2569
3268
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2628,7 +3327,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2628
3327
|
a.createResponsePolicyZone(null, (data, error) => {
|
|
2629
3328
|
try {
|
|
2630
3329
|
const displayE = 'body is required';
|
|
2631
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createResponsePolicyZone', displayE);
|
|
3330
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createResponsePolicyZone', displayE);
|
|
2632
3331
|
done();
|
|
2633
3332
|
} catch (err) {
|
|
2634
3333
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2657,7 +3356,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2657
3356
|
a.createSubstituitionRuleForARecords(null, (data, error) => {
|
|
2658
3357
|
try {
|
|
2659
3358
|
const displayE = 'body is required';
|
|
2660
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createSubstituitionRuleForARecords', displayE);
|
|
3359
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createSubstituitionRuleForARecords', displayE);
|
|
2661
3360
|
done();
|
|
2662
3361
|
} catch (err) {
|
|
2663
3362
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2686,7 +3385,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2686
3385
|
a.addSubstituitionRuleForPtrRecords(null, (data, error) => {
|
|
2687
3386
|
try {
|
|
2688
3387
|
const displayE = 'body is required';
|
|
2689
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-addSubstituitionRuleForPtrRecords', displayE);
|
|
3388
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-addSubstituitionRuleForPtrRecords', displayE);
|
|
2690
3389
|
done();
|
|
2691
3390
|
} catch (err) {
|
|
2692
3391
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2715,7 +3414,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2715
3414
|
a.addSubstituitionRuleForIpTriggerPolicy(null, (data, error) => {
|
|
2716
3415
|
try {
|
|
2717
3416
|
const displayE = 'body is required';
|
|
2718
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-addSubstituitionRuleForIpTriggerPolicy', displayE);
|
|
3417
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-addSubstituitionRuleForIpTriggerPolicy', displayE);
|
|
2719
3418
|
done();
|
|
2720
3419
|
} catch (err) {
|
|
2721
3420
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2744,7 +3443,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2744
3443
|
a.addBlockDomainNameRule(null, (data, error) => {
|
|
2745
3444
|
try {
|
|
2746
3445
|
const displayE = 'body is required';
|
|
2747
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-addBlockDomainNameRule', displayE);
|
|
3446
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-addBlockDomainNameRule', displayE);
|
|
2748
3447
|
done();
|
|
2749
3448
|
} catch (err) {
|
|
2750
3449
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2773,7 +3472,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2773
3472
|
a.addBlockClientIpAddressRule(null, (data, error) => {
|
|
2774
3473
|
try {
|
|
2775
3474
|
const displayE = 'body is required';
|
|
2776
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-addBlockClientIpAddressRule', displayE);
|
|
3475
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-addBlockClientIpAddressRule', displayE);
|
|
2777
3476
|
done();
|
|
2778
3477
|
} catch (err) {
|
|
2779
3478
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2802,7 +3501,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2802
3501
|
a.addSubstituteDomainNameClientIpAddressRule(null, (data, error) => {
|
|
2803
3502
|
try {
|
|
2804
3503
|
const displayE = 'body is required';
|
|
2805
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-addSubstituteDomainNameClientIpAddressRule', displayE);
|
|
3504
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-addSubstituteDomainNameClientIpAddressRule', displayE);
|
|
2806
3505
|
done();
|
|
2807
3506
|
} catch (err) {
|
|
2808
3507
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2831,7 +3530,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2831
3530
|
a.addBlockIpAddressNoSuchDomainRule(null, (data, error) => {
|
|
2832
3531
|
try {
|
|
2833
3532
|
const displayE = 'body is required';
|
|
2834
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-addBlockIpAddressNoSuchDomainRule', displayE);
|
|
3533
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-addBlockIpAddressNoSuchDomainRule', displayE);
|
|
2835
3534
|
done();
|
|
2836
3535
|
} catch (err) {
|
|
2837
3536
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2860,7 +3559,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2860
3559
|
a.addSubstituteDomainNameIpAddressRule(null, (data, error) => {
|
|
2861
3560
|
try {
|
|
2862
3561
|
const displayE = 'body is required';
|
|
2863
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-addSubstituteDomainNameIpAddressRule', displayE);
|
|
3562
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-addSubstituteDomainNameIpAddressRule', displayE);
|
|
2864
3563
|
done();
|
|
2865
3564
|
} catch (err) {
|
|
2866
3565
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2889,7 +3588,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2889
3588
|
a.getAllRpzRecords(null, (data, error) => {
|
|
2890
3589
|
try {
|
|
2891
3590
|
const displayE = 'zone is required';
|
|
2892
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getAllRpzRecords', displayE);
|
|
3591
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getAllRpzRecords', displayE);
|
|
2893
3592
|
done();
|
|
2894
3593
|
} catch (err) {
|
|
2895
3594
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2930,7 +3629,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2930
3629
|
a.createNameServerGroup(null, (data, error) => {
|
|
2931
3630
|
try {
|
|
2932
3631
|
const displayE = 'body is required';
|
|
2933
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createNameServerGroup', displayE);
|
|
3632
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createNameServerGroup', displayE);
|
|
2934
3633
|
done();
|
|
2935
3634
|
} catch (err) {
|
|
2936
3635
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2959,7 +3658,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2959
3658
|
a.getRangeByExtensibleAttribute(null, (data, error) => {
|
|
2960
3659
|
try {
|
|
2961
3660
|
const displayE = 'location is required';
|
|
2962
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getRangeByExtensibleAttribute', displayE);
|
|
3661
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getRangeByExtensibleAttribute', displayE);
|
|
2963
3662
|
done();
|
|
2964
3663
|
} catch (err) {
|
|
2965
3664
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2988,7 +3687,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
2988
3687
|
a.createRange(null, (data, error) => {
|
|
2989
3688
|
try {
|
|
2990
3689
|
const displayE = 'body is required';
|
|
2991
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createRange', displayE);
|
|
3690
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createRange', displayE);
|
|
2992
3691
|
done();
|
|
2993
3692
|
} catch (err) {
|
|
2994
3693
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3017,7 +3716,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3017
3716
|
a.getLeaseByIpAddress(null, (data, error) => {
|
|
3018
3717
|
try {
|
|
3019
3718
|
const displayE = 'address is required';
|
|
3020
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getLeaseByIpAddress', displayE);
|
|
3719
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getLeaseByIpAddress', displayE);
|
|
3021
3720
|
done();
|
|
3022
3721
|
} catch (err) {
|
|
3023
3722
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3070,7 +3769,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3070
3769
|
a.getIpAddressUsingSearch(null, (data, error) => {
|
|
3071
3770
|
try {
|
|
3072
3771
|
const displayE = 'address is required';
|
|
3073
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getIpAddressUsingSearch', displayE);
|
|
3772
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getIpAddressUsingSearch', displayE);
|
|
3074
3773
|
done();
|
|
3075
3774
|
} catch (err) {
|
|
3076
3775
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3108,6 +3807,18 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3108
3807
|
}).timeout(attemptTimeout);
|
|
3109
3808
|
});
|
|
3110
3809
|
|
|
3810
|
+
describe('#getNetworkViewWithQuery - errors', () => {
|
|
3811
|
+
it('should have a getNetworkViewWithQuery function', (done) => {
|
|
3812
|
+
try {
|
|
3813
|
+
assert.equal(true, typeof a.getNetworkViewWithQuery === 'function');
|
|
3814
|
+
done();
|
|
3815
|
+
} catch (error) {
|
|
3816
|
+
log.error(`Test Failure: ${error}`);
|
|
3817
|
+
done(error);
|
|
3818
|
+
}
|
|
3819
|
+
}).timeout(attemptTimeout);
|
|
3820
|
+
});
|
|
3821
|
+
|
|
3111
3822
|
describe('#createNetworkView - errors', () => {
|
|
3112
3823
|
it('should have a createNetworkView function', (done) => {
|
|
3113
3824
|
try {
|
|
@@ -3123,7 +3834,94 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3123
3834
|
a.createNetworkView(null, (data, error) => {
|
|
3124
3835
|
try {
|
|
3125
3836
|
const displayE = 'body is required';
|
|
3126
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createNetworkView', displayE);
|
|
3837
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createNetworkView', displayE);
|
|
3838
|
+
done();
|
|
3839
|
+
} catch (err) {
|
|
3840
|
+
log.error(`Test Failure: ${err}`);
|
|
3841
|
+
done(err);
|
|
3842
|
+
}
|
|
3843
|
+
});
|
|
3844
|
+
} catch (error) {
|
|
3845
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3846
|
+
done(error);
|
|
3847
|
+
}
|
|
3848
|
+
}).timeout(attemptTimeout);
|
|
3849
|
+
});
|
|
3850
|
+
|
|
3851
|
+
describe('#getNetworkViewById - errors', () => {
|
|
3852
|
+
it('should have a getNetworkViewById function', (done) => {
|
|
3853
|
+
try {
|
|
3854
|
+
assert.equal(true, typeof a.getNetworkViewById === 'function');
|
|
3855
|
+
done();
|
|
3856
|
+
} catch (error) {
|
|
3857
|
+
log.error(`Test Failure: ${error}`);
|
|
3858
|
+
done(error);
|
|
3859
|
+
}
|
|
3860
|
+
}).timeout(attemptTimeout);
|
|
3861
|
+
it('should error if - missing viewId', (done) => {
|
|
3862
|
+
try {
|
|
3863
|
+
a.getNetworkViewById(null, null, (data, error) => {
|
|
3864
|
+
try {
|
|
3865
|
+
const displayE = 'viewId is required';
|
|
3866
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getNetworkViewById', displayE);
|
|
3867
|
+
done();
|
|
3868
|
+
} catch (err) {
|
|
3869
|
+
log.error(`Test Failure: ${err}`);
|
|
3870
|
+
done(err);
|
|
3871
|
+
}
|
|
3872
|
+
});
|
|
3873
|
+
} catch (error) {
|
|
3874
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3875
|
+
done(error);
|
|
3876
|
+
}
|
|
3877
|
+
}).timeout(attemptTimeout);
|
|
3878
|
+
});
|
|
3879
|
+
|
|
3880
|
+
describe('#updateNetworkView - errors', () => {
|
|
3881
|
+
it('should have a updateNetworkView function', (done) => {
|
|
3882
|
+
try {
|
|
3883
|
+
assert.equal(true, typeof a.updateNetworkView === 'function');
|
|
3884
|
+
done();
|
|
3885
|
+
} catch (error) {
|
|
3886
|
+
log.error(`Test Failure: ${error}`);
|
|
3887
|
+
done(error);
|
|
3888
|
+
}
|
|
3889
|
+
}).timeout(attemptTimeout);
|
|
3890
|
+
it('should error if - missing viewId', (done) => {
|
|
3891
|
+
try {
|
|
3892
|
+
a.updateNetworkView(null, (data, error) => {
|
|
3893
|
+
try {
|
|
3894
|
+
const displayE = 'viewId is required';
|
|
3895
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateNetworkView', displayE);
|
|
3896
|
+
done();
|
|
3897
|
+
} catch (err) {
|
|
3898
|
+
log.error(`Test Failure: ${err}`);
|
|
3899
|
+
done(err);
|
|
3900
|
+
}
|
|
3901
|
+
});
|
|
3902
|
+
} catch (error) {
|
|
3903
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3904
|
+
done(error);
|
|
3905
|
+
}
|
|
3906
|
+
}).timeout(attemptTimeout);
|
|
3907
|
+
});
|
|
3908
|
+
|
|
3909
|
+
describe('#deleteNetworkView - errors', () => {
|
|
3910
|
+
it('should have a deleteNetworkView function', (done) => {
|
|
3911
|
+
try {
|
|
3912
|
+
assert.equal(true, typeof a.deleteNetworkView === 'function');
|
|
3913
|
+
done();
|
|
3914
|
+
} catch (error) {
|
|
3915
|
+
log.error(`Test Failure: ${error}`);
|
|
3916
|
+
done(error);
|
|
3917
|
+
}
|
|
3918
|
+
}).timeout(attemptTimeout);
|
|
3919
|
+
it('should error if - missing viewId', (done) => {
|
|
3920
|
+
try {
|
|
3921
|
+
a.deleteNetworkView(null, (data, error) => {
|
|
3922
|
+
try {
|
|
3923
|
+
const displayE = 'viewId is required';
|
|
3924
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteNetworkView', displayE);
|
|
3127
3925
|
done();
|
|
3128
3926
|
} catch (err) {
|
|
3129
3927
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3152,7 +3950,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3152
3950
|
a.getFixedAddressMac(null, (data, error) => {
|
|
3153
3951
|
try {
|
|
3154
3952
|
const displayE = 'mac is required';
|
|
3155
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getFixedAddressMac', displayE);
|
|
3953
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getFixedAddressMac', displayE);
|
|
3156
3954
|
done();
|
|
3157
3955
|
} catch (err) {
|
|
3158
3956
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3181,7 +3979,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3181
3979
|
a.createFixedAddress(null, (data, error) => {
|
|
3182
3980
|
try {
|
|
3183
3981
|
const displayE = 'body is required';
|
|
3184
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createFixedAddress', displayE);
|
|
3982
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createFixedAddress', displayE);
|
|
3185
3983
|
done();
|
|
3186
3984
|
} catch (err) {
|
|
3187
3985
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3222,7 +4020,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3222
4020
|
a.createMember(null, (data, error) => {
|
|
3223
4021
|
try {
|
|
3224
4022
|
const displayE = 'body is required';
|
|
3225
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createMember', displayE);
|
|
4023
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createMember', displayE);
|
|
3226
4024
|
done();
|
|
3227
4025
|
} catch (err) {
|
|
3228
4026
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3248,6 +4046,18 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3248
4046
|
}).timeout(attemptTimeout);
|
|
3249
4047
|
});
|
|
3250
4048
|
|
|
4049
|
+
describe('#getGridStatus - errors', () => {
|
|
4050
|
+
it('should have a getGridStatus function', (done) => {
|
|
4051
|
+
try {
|
|
4052
|
+
assert.equal(true, typeof a.getGridStatus === 'function');
|
|
4053
|
+
done();
|
|
4054
|
+
} catch (error) {
|
|
4055
|
+
log.error(`Test Failure: ${error}`);
|
|
4056
|
+
done(error);
|
|
4057
|
+
}
|
|
4058
|
+
}).timeout(attemptTimeout);
|
|
4059
|
+
});
|
|
4060
|
+
|
|
3251
4061
|
describe('#getGridPendingChanges - errors', () => {
|
|
3252
4062
|
it('should have a getGridPendingChanges function', (done) => {
|
|
3253
4063
|
try {
|
|
@@ -3287,7 +4097,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3287
4097
|
a.createVdiscoveryTask(null, (data, error) => {
|
|
3288
4098
|
try {
|
|
3289
4099
|
const displayE = 'body is required';
|
|
3290
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createVdiscoveryTask', displayE);
|
|
4100
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createVdiscoveryTask', displayE);
|
|
3291
4101
|
done();
|
|
3292
4102
|
} catch (err) {
|
|
3293
4103
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3316,7 +4126,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3316
4126
|
a.getPermissionsForARole(null, (data, error) => {
|
|
3317
4127
|
try {
|
|
3318
4128
|
const displayE = 'role is required';
|
|
3319
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getPermissionsForARole', displayE);
|
|
4129
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getPermissionsForARole', displayE);
|
|
3320
4130
|
done();
|
|
3321
4131
|
} catch (err) {
|
|
3322
4132
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3345,7 +4155,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3345
4155
|
a.getWapiSchema(null, (data, error) => {
|
|
3346
4156
|
try {
|
|
3347
4157
|
const displayE = 'schema is required';
|
|
3348
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getWapiSchema', displayE);
|
|
4158
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getWapiSchema', displayE);
|
|
3349
4159
|
done();
|
|
3350
4160
|
} catch (err) {
|
|
3351
4161
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3374,7 +4184,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3374
4184
|
a.multipleRecordTypes(null, (data, error) => {
|
|
3375
4185
|
try {
|
|
3376
4186
|
const displayE = 'body is required';
|
|
3377
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-multipleRecordTypes', displayE);
|
|
4187
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-multipleRecordTypes', displayE);
|
|
3378
4188
|
done();
|
|
3379
4189
|
} catch (err) {
|
|
3380
4190
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3400,6 +4210,18 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3400
4210
|
}).timeout(attemptTimeout);
|
|
3401
4211
|
});
|
|
3402
4212
|
|
|
4213
|
+
describe('#getExtensibleAttributeDefinitionWithQuery - errors', () => {
|
|
4214
|
+
it('should have a getExtensibleAttributeDefinitionWithQuery function', (done) => {
|
|
4215
|
+
try {
|
|
4216
|
+
assert.equal(true, typeof a.getExtensibleAttributeDefinitionWithQuery === 'function');
|
|
4217
|
+
done();
|
|
4218
|
+
} catch (error) {
|
|
4219
|
+
log.error(`Test Failure: ${error}`);
|
|
4220
|
+
done(error);
|
|
4221
|
+
}
|
|
4222
|
+
}).timeout(attemptTimeout);
|
|
4223
|
+
});
|
|
4224
|
+
|
|
3403
4225
|
describe('#createExtensibleAttributeDefinition - errors', () => {
|
|
3404
4226
|
it('should have a createExtensibleAttributeDefinition function', (done) => {
|
|
3405
4227
|
try {
|
|
@@ -3415,7 +4237,94 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3415
4237
|
a.createExtensibleAttributeDefinition(null, (data, error) => {
|
|
3416
4238
|
try {
|
|
3417
4239
|
const displayE = 'body is required';
|
|
3418
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createExtensibleAttributeDefinition', displayE);
|
|
4240
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createExtensibleAttributeDefinition', displayE);
|
|
4241
|
+
done();
|
|
4242
|
+
} catch (err) {
|
|
4243
|
+
log.error(`Test Failure: ${err}`);
|
|
4244
|
+
done(err);
|
|
4245
|
+
}
|
|
4246
|
+
});
|
|
4247
|
+
} catch (error) {
|
|
4248
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4249
|
+
done(error);
|
|
4250
|
+
}
|
|
4251
|
+
}).timeout(attemptTimeout);
|
|
4252
|
+
});
|
|
4253
|
+
|
|
4254
|
+
describe('#getExtensibleAttributeDefinitionById - errors', () => {
|
|
4255
|
+
it('should have a getExtensibleAttributeDefinitionById function', (done) => {
|
|
4256
|
+
try {
|
|
4257
|
+
assert.equal(true, typeof a.getExtensibleAttributeDefinitionById === 'function');
|
|
4258
|
+
done();
|
|
4259
|
+
} catch (error) {
|
|
4260
|
+
log.error(`Test Failure: ${error}`);
|
|
4261
|
+
done(error);
|
|
4262
|
+
}
|
|
4263
|
+
}).timeout(attemptTimeout);
|
|
4264
|
+
it('should error if - missing eaId', (done) => {
|
|
4265
|
+
try {
|
|
4266
|
+
a.getExtensibleAttributeDefinitionById(null, {}, (data, error) => {
|
|
4267
|
+
try {
|
|
4268
|
+
const displayE = 'eaId is required';
|
|
4269
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getExtensibleAttributeDefinitionById', displayE);
|
|
4270
|
+
done();
|
|
4271
|
+
} catch (err) {
|
|
4272
|
+
log.error(`Test Failure: ${err}`);
|
|
4273
|
+
done(err);
|
|
4274
|
+
}
|
|
4275
|
+
});
|
|
4276
|
+
} catch (error) {
|
|
4277
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4278
|
+
done(error);
|
|
4279
|
+
}
|
|
4280
|
+
}).timeout(attemptTimeout);
|
|
4281
|
+
});
|
|
4282
|
+
|
|
4283
|
+
describe('#updateExtensibleAttributeDefinition - errors', () => {
|
|
4284
|
+
it('should have a updateExtensibleAttributeDefinition function', (done) => {
|
|
4285
|
+
try {
|
|
4286
|
+
assert.equal(true, typeof a.updateExtensibleAttributeDefinition === 'function');
|
|
4287
|
+
done();
|
|
4288
|
+
} catch (error) {
|
|
4289
|
+
log.error(`Test Failure: ${error}`);
|
|
4290
|
+
done(error);
|
|
4291
|
+
}
|
|
4292
|
+
}).timeout(attemptTimeout);
|
|
4293
|
+
it('should error if - missing eaId', (done) => {
|
|
4294
|
+
try {
|
|
4295
|
+
a.updateExtensibleAttributeDefinition(null, (data, error) => {
|
|
4296
|
+
try {
|
|
4297
|
+
const displayE = 'eaId is required';
|
|
4298
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateExtensibleAttributeDefinition', displayE);
|
|
4299
|
+
done();
|
|
4300
|
+
} catch (err) {
|
|
4301
|
+
log.error(`Test Failure: ${err}`);
|
|
4302
|
+
done(err);
|
|
4303
|
+
}
|
|
4304
|
+
});
|
|
4305
|
+
} catch (error) {
|
|
4306
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4307
|
+
done(error);
|
|
4308
|
+
}
|
|
4309
|
+
}).timeout(attemptTimeout);
|
|
4310
|
+
});
|
|
4311
|
+
|
|
4312
|
+
describe('#deleteExtensibleAttributeDefinition - errors', () => {
|
|
4313
|
+
it('should have a deleteExtensibleAttributeDefinition function', (done) => {
|
|
4314
|
+
try {
|
|
4315
|
+
assert.equal(true, typeof a.deleteExtensibleAttributeDefinition === 'function');
|
|
4316
|
+
done();
|
|
4317
|
+
} catch (error) {
|
|
4318
|
+
log.error(`Test Failure: ${error}`);
|
|
4319
|
+
done(error);
|
|
4320
|
+
}
|
|
4321
|
+
}).timeout(attemptTimeout);
|
|
4322
|
+
it('should error if - missing eaId', (done) => {
|
|
4323
|
+
try {
|
|
4324
|
+
a.deleteExtensibleAttributeDefinition(null, (data, error) => {
|
|
4325
|
+
try {
|
|
4326
|
+
const displayE = 'eaId is required';
|
|
4327
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteExtensibleAttributeDefinition', displayE);
|
|
3419
4328
|
done();
|
|
3420
4329
|
} catch (err) {
|
|
3421
4330
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3444,7 +4353,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3444
4353
|
a.createObject(null, {}, (data, error) => {
|
|
3445
4354
|
try {
|
|
3446
4355
|
const displayE = 'objectType is required';
|
|
3447
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createObject', displayE);
|
|
4356
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createObject', displayE);
|
|
3448
4357
|
done();
|
|
3449
4358
|
} catch (err) {
|
|
3450
4359
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3461,7 +4370,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3461
4370
|
a.createObject('type', null, (data, error) => {
|
|
3462
4371
|
try {
|
|
3463
4372
|
const displayE = 'body is required';
|
|
3464
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-createObject', displayE);
|
|
4373
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-createObject', displayE);
|
|
3465
4374
|
done();
|
|
3466
4375
|
} catch (err) {
|
|
3467
4376
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3490,7 +4399,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3490
4399
|
a.updateObject(null, {}, (data, error) => {
|
|
3491
4400
|
try {
|
|
3492
4401
|
const displayE = 'objectReference is required';
|
|
3493
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updateObject', displayE);
|
|
4402
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateObject', displayE);
|
|
3494
4403
|
done();
|
|
3495
4404
|
} catch (err) {
|
|
3496
4405
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3526,7 +4435,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3526
4435
|
a.updateObject('type', null, (data, error) => {
|
|
3527
4436
|
try {
|
|
3528
4437
|
const displayE = 'body is required';
|
|
3529
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-updateObject', displayE);
|
|
4438
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-updateObject', displayE);
|
|
3530
4439
|
done();
|
|
3531
4440
|
} catch (err) {
|
|
3532
4441
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3555,7 +4464,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3555
4464
|
a.deleteObject(null, (data, error) => {
|
|
3556
4465
|
try {
|
|
3557
4466
|
const displayE = 'objectReference is required';
|
|
3558
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-deleteObject', displayE);
|
|
4467
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-deleteObject', displayE);
|
|
3559
4468
|
done();
|
|
3560
4469
|
} catch (err) {
|
|
3561
4470
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3603,7 +4512,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3603
4512
|
a.getObject(null, {}, 'field', (data, error) => {
|
|
3604
4513
|
try {
|
|
3605
4514
|
const displayE = 'objectType is required';
|
|
3606
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getObject', displayE);
|
|
4515
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getObject', displayE);
|
|
3607
4516
|
done();
|
|
3608
4517
|
} catch (err) {
|
|
3609
4518
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3620,7 +4529,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3620
4529
|
a.getObject('type', null, 'field', (data, error) => {
|
|
3621
4530
|
try {
|
|
3622
4531
|
const displayE = 'queryObject is required';
|
|
3623
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getObject', displayE);
|
|
4532
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getObject', displayE);
|
|
3624
4533
|
done();
|
|
3625
4534
|
} catch (err) {
|
|
3626
4535
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3637,7 +4546,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3637
4546
|
a.getObject('type', {}, null, (data, error) => {
|
|
3638
4547
|
try {
|
|
3639
4548
|
const displayE = 'returnFields is required';
|
|
3640
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-getObject', displayE);
|
|
4549
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-getObject', displayE);
|
|
3641
4550
|
done();
|
|
3642
4551
|
} catch (err) {
|
|
3643
4552
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3666,7 +4575,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3666
4575
|
a.extractObjectTypeFromObjectReference(null, (data, error) => {
|
|
3667
4576
|
try {
|
|
3668
4577
|
const displayE = 'objectReference is required';
|
|
3669
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-extractObjectTypeFromObjectReference', displayE);
|
|
4578
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-extractObjectTypeFromObjectReference', displayE);
|
|
3670
4579
|
done();
|
|
3671
4580
|
} catch (err) {
|
|
3672
4581
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3732,7 +4641,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3732
4641
|
a.restartServices(null, null, (data, error) => {
|
|
3733
4642
|
try {
|
|
3734
4643
|
const displayE = 'objectReference is required';
|
|
3735
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-restartServices', displayE);
|
|
4644
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-restartServices', displayE);
|
|
3736
4645
|
done();
|
|
3737
4646
|
} catch (err) {
|
|
3738
4647
|
log.error(`Test Failure: ${err}`);
|
|
@@ -3750,7 +4659,7 @@ describe('[unit] Infoblox Adapter Test', () => {
|
|
|
3750
4659
|
a.restartServices(objectReference, null, (data, error) => {
|
|
3751
4660
|
try {
|
|
3752
4661
|
const displayE = 'queries is required';
|
|
3753
|
-
runErrorAsserts(data, error, 'AD.300', 'infoblox-adapter-restartServices', displayE);
|
|
4662
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-infoblox-adapter-restartServices', displayE);
|
|
3754
4663
|
done();
|
|
3755
4664
|
} catch (err) {
|
|
3756
4665
|
log.error(`Test Failure: ${err}`);
|