@itentialopensource/adapter-azure_aks 0.1.1 → 0.2.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/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +9 -2
- 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 +221 -571
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +349 -57
- package/adapterBase.js +1021 -245
- package/entities/.generic/action.json +110 -5
- package/entities/.generic/schema.json +6 -1
- package/error.json +6 -0
- package/package.json +13 -7
- package/pronghorn.json +642 -378
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +422 -1
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1653089062336.json +120 -0
- package/sampleProperties.json +92 -3
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestIntegration.js +26 -109
- package/test/unit/adapterBaseTestUnit.js +30 -25
- package/test/unit/adapterTestUnit.js +174 -163
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +0 -0
- package/utils/basicGet.js +1 -14
- package/utils/entitiesToDB.js +179 -0
- package/utils/modify.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 +43 -22
- package/utils/tbUtils.js +99 -19
- package/utils/testRunner.js +16 -16
- package/utils/troubleshootingAdapter.js +2 -26
|
@@ -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
|
|
@@ -45,106 +55,7 @@ global.pronghornProps = {
|
|
|
45
55
|
adapters: [{
|
|
46
56
|
id: 'Test-azure_aks',
|
|
47
57
|
type: 'AzureAks',
|
|
48
|
-
properties:
|
|
49
|
-
host,
|
|
50
|
-
port,
|
|
51
|
-
base_path: '/',
|
|
52
|
-
version: '',
|
|
53
|
-
cache_location: 'none',
|
|
54
|
-
encode_pathvars: true,
|
|
55
|
-
save_metric: false,
|
|
56
|
-
stub,
|
|
57
|
-
protocol,
|
|
58
|
-
apiVersion: '2019-11-01',
|
|
59
|
-
subscriptionId: 'replace_subscriptionId',
|
|
60
|
-
resourceGroup: [],
|
|
61
|
-
authentication: {
|
|
62
|
-
auth_method: 'request_token',
|
|
63
|
-
username,
|
|
64
|
-
password,
|
|
65
|
-
token: '',
|
|
66
|
-
invalid_token_error: 401,
|
|
67
|
-
token_timeout: 1800000,
|
|
68
|
-
token_cache: 'local',
|
|
69
|
-
auth_field: 'header.headers.Authorization',
|
|
70
|
-
auth_field_format: 'Bearer {token}',
|
|
71
|
-
auth_logging: false,
|
|
72
|
-
tenant_id: 'replace_tenant_id',
|
|
73
|
-
client_id: 'replace_client_id',
|
|
74
|
-
grant_type: 'client_credentials',
|
|
75
|
-
client_secret: 'replace_client_secret'
|
|
76
|
-
},
|
|
77
|
-
healthcheck: {
|
|
78
|
-
type: 'none',
|
|
79
|
-
frequency: 60000,
|
|
80
|
-
query_object: {}
|
|
81
|
-
},
|
|
82
|
-
throttle: {
|
|
83
|
-
throttle_enabled: false,
|
|
84
|
-
number_pronghorns: 1,
|
|
85
|
-
sync_async: 'sync',
|
|
86
|
-
max_in_queue: 1000,
|
|
87
|
-
concurrent_max: 1,
|
|
88
|
-
expire_timeout: 0,
|
|
89
|
-
avg_runtime: 200,
|
|
90
|
-
priorities: [
|
|
91
|
-
{
|
|
92
|
-
value: 0,
|
|
93
|
-
percent: 100
|
|
94
|
-
}
|
|
95
|
-
]
|
|
96
|
-
},
|
|
97
|
-
request: {
|
|
98
|
-
number_redirects: 0,
|
|
99
|
-
number_retries: 3,
|
|
100
|
-
limit_retry_error: [0],
|
|
101
|
-
failover_codes: [],
|
|
102
|
-
attempt_timeout: attemptTimeout,
|
|
103
|
-
global_request: {
|
|
104
|
-
payload: {},
|
|
105
|
-
uriOptions: {},
|
|
106
|
-
addlHeaders: {},
|
|
107
|
-
authData: {}
|
|
108
|
-
},
|
|
109
|
-
healthcheck_on_timeout: true,
|
|
110
|
-
return_raw: true,
|
|
111
|
-
archiving: false,
|
|
112
|
-
return_request: false
|
|
113
|
-
},
|
|
114
|
-
proxy: {
|
|
115
|
-
enabled: false,
|
|
116
|
-
host: '',
|
|
117
|
-
port: 1,
|
|
118
|
-
protocol: 'http',
|
|
119
|
-
username: '',
|
|
120
|
-
password: ''
|
|
121
|
-
},
|
|
122
|
-
ssl: {
|
|
123
|
-
ecdhCurve: '',
|
|
124
|
-
enabled: sslenable,
|
|
125
|
-
accept_invalid_cert: sslinvalid,
|
|
126
|
-
ca_file: '',
|
|
127
|
-
key_file: '',
|
|
128
|
-
cert_file: '',
|
|
129
|
-
secure_protocol: '',
|
|
130
|
-
ciphers: ''
|
|
131
|
-
},
|
|
132
|
-
mongo: {
|
|
133
|
-
host: '',
|
|
134
|
-
port: 0,
|
|
135
|
-
database: '',
|
|
136
|
-
username: '',
|
|
137
|
-
password: '',
|
|
138
|
-
replSet: '',
|
|
139
|
-
db_ssl: {
|
|
140
|
-
enabled: false,
|
|
141
|
-
accept_invalid_cert: false,
|
|
142
|
-
ca_file: '',
|
|
143
|
-
key_file: '',
|
|
144
|
-
cert_file: ''
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
58
|
+
properties: samProps
|
|
148
59
|
}]
|
|
149
60
|
}
|
|
150
61
|
};
|
|
@@ -275,10 +186,10 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
275
186
|
});
|
|
276
187
|
|
|
277
188
|
let wffunctions = [];
|
|
278
|
-
describe('#
|
|
189
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
279
190
|
it('should retrieve workflow functions', (done) => {
|
|
280
191
|
try {
|
|
281
|
-
wffunctions = a.
|
|
192
|
+
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
282
193
|
|
|
283
194
|
try {
|
|
284
195
|
assert.notEqual(0, wffunctions.length);
|
|
@@ -360,6 +271,7 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
360
271
|
assert.notEqual(undefined, packageDotJson.scripts);
|
|
361
272
|
assert.notEqual(null, packageDotJson.scripts);
|
|
362
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);
|
|
363
275
|
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
|
|
364
276
|
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
|
|
365
277
|
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
|
|
@@ -367,6 +279,8 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
367
279
|
assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
|
|
368
280
|
assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
|
|
369
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);
|
|
370
284
|
done();
|
|
371
285
|
} catch (error) {
|
|
372
286
|
log.error(`Test Failure: ${error}`);
|
|
@@ -379,6 +293,9 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
379
293
|
assert.notEqual(undefined, packageDotJson.repository);
|
|
380
294
|
assert.notEqual(null, packageDotJson.repository);
|
|
381
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));
|
|
382
299
|
done();
|
|
383
300
|
} catch (error) {
|
|
384
301
|
log.error(`Test Failure: ${error}`);
|
|
@@ -463,16 +380,17 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
463
380
|
assert.notEqual('', pronghornDotJson.methods);
|
|
464
381
|
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
465
382
|
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
466
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
467
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
468
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
469
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
470
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
471
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
472
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
473
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
474
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
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'));
|
|
475
392
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
393
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
|
|
476
394
|
done();
|
|
477
395
|
} catch (error) {
|
|
478
396
|
log.error(`Test Failure: ${error}`);
|
|
@@ -644,6 +562,8 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
644
562
|
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
|
|
645
563
|
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
|
|
646
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);
|
|
647
567
|
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
648
568
|
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
649
569
|
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
@@ -657,6 +577,7 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
657
577
|
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
658
578
|
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
659
579
|
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
580
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
|
|
660
581
|
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
661
582
|
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
662
583
|
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
@@ -705,8 +626,6 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
705
626
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
|
|
706
627
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
|
|
707
628
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
|
|
708
|
-
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
709
|
-
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
710
629
|
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
|
|
711
630
|
assert.notEqual(null, propertiesDotJson.definitions.mongo);
|
|
712
631
|
assert.notEqual('', propertiesDotJson.definitions.mongo);
|
|
@@ -722,6 +641,12 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
722
641
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
|
|
723
642
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
|
|
724
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);
|
|
725
650
|
done();
|
|
726
651
|
} catch (error) {
|
|
727
652
|
log.error(`Test Failure: ${error}`);
|
|
@@ -838,17 +763,13 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
838
763
|
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
839
764
|
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
840
765
|
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
841
|
-
|
|
842
766
|
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
843
767
|
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
844
768
|
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
845
769
|
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
770
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
846
771
|
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
847
772
|
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
848
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
849
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
850
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
851
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
852
773
|
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
853
774
|
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
854
775
|
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
@@ -907,6 +828,12 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
907
828
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
908
829
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
909
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);
|
|
910
837
|
done();
|
|
911
838
|
} catch (error) {
|
|
912
839
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1000,10 +927,10 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1000
927
|
});
|
|
1001
928
|
});
|
|
1002
929
|
|
|
1003
|
-
describe('#
|
|
1004
|
-
it('should have a
|
|
930
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
931
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
1005
932
|
try {
|
|
1006
|
-
assert.equal(true, typeof a.
|
|
933
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
1007
934
|
done();
|
|
1008
935
|
} catch (error) {
|
|
1009
936
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1012,19 +939,19 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1012
939
|
});
|
|
1013
940
|
});
|
|
1014
941
|
|
|
1015
|
-
describe('#
|
|
1016
|
-
it('should have a
|
|
942
|
+
describe('#iapFindAdapterPath', () => {
|
|
943
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
1017
944
|
try {
|
|
1018
|
-
assert.equal(true, typeof a.
|
|
945
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
1019
946
|
done();
|
|
1020
947
|
} catch (error) {
|
|
1021
948
|
log.error(`Test Failure: ${error}`);
|
|
1022
949
|
done(error);
|
|
1023
950
|
}
|
|
1024
951
|
});
|
|
1025
|
-
it('
|
|
952
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
1026
953
|
try {
|
|
1027
|
-
a.
|
|
954
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
1028
955
|
try {
|
|
1029
956
|
assert.equal(undefined, error);
|
|
1030
957
|
assert.notEqual(undefined, data);
|
|
@@ -1046,10 +973,10 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1046
973
|
}).timeout(attemptTimeout);
|
|
1047
974
|
});
|
|
1048
975
|
|
|
1049
|
-
describe('#
|
|
1050
|
-
it('should have a
|
|
976
|
+
describe('#iapSuspendAdapter', () => {
|
|
977
|
+
it('should have a iapSuspendAdapter function', (done) => {
|
|
1051
978
|
try {
|
|
1052
|
-
assert.equal(true, typeof a.
|
|
979
|
+
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
|
|
1053
980
|
done();
|
|
1054
981
|
} catch (error) {
|
|
1055
982
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1058,10 +985,10 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1058
985
|
});
|
|
1059
986
|
});
|
|
1060
987
|
|
|
1061
|
-
describe('#
|
|
1062
|
-
it('should have a
|
|
988
|
+
describe('#iapUnsuspendAdapter', () => {
|
|
989
|
+
it('should have a iapUnsuspendAdapter function', (done) => {
|
|
1063
990
|
try {
|
|
1064
|
-
assert.equal(true, typeof a.
|
|
991
|
+
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
|
|
1065
992
|
done();
|
|
1066
993
|
} catch (error) {
|
|
1067
994
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1070,10 +997,10 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1070
997
|
});
|
|
1071
998
|
});
|
|
1072
999
|
|
|
1073
|
-
describe('#
|
|
1074
|
-
it('should have a
|
|
1000
|
+
describe('#iapGetAdapterQueue', () => {
|
|
1001
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
1075
1002
|
try {
|
|
1076
|
-
assert.equal(true, typeof a.
|
|
1003
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
1077
1004
|
done();
|
|
1078
1005
|
} catch (error) {
|
|
1079
1006
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1082,10 +1009,10 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1082
1009
|
});
|
|
1083
1010
|
});
|
|
1084
1011
|
|
|
1085
|
-
describe('#
|
|
1086
|
-
it('should have a
|
|
1012
|
+
describe('#iapTroubleshootAdapter', () => {
|
|
1013
|
+
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1087
1014
|
try {
|
|
1088
|
-
assert.equal(true, typeof a.
|
|
1015
|
+
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
|
|
1089
1016
|
done();
|
|
1090
1017
|
} catch (error) {
|
|
1091
1018
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1094,10 +1021,10 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1094
1021
|
});
|
|
1095
1022
|
});
|
|
1096
1023
|
|
|
1097
|
-
describe('#
|
|
1098
|
-
it('should have a
|
|
1024
|
+
describe('#iapRunAdapterHealthcheck', () => {
|
|
1025
|
+
it('should have a iapRunAdapterHealthcheck function', (done) => {
|
|
1099
1026
|
try {
|
|
1100
|
-
assert.equal(true, typeof a.
|
|
1027
|
+
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
|
|
1101
1028
|
done();
|
|
1102
1029
|
} catch (error) {
|
|
1103
1030
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1106,10 +1033,10 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1106
1033
|
});
|
|
1107
1034
|
});
|
|
1108
1035
|
|
|
1109
|
-
describe('#
|
|
1110
|
-
it('should have a
|
|
1036
|
+
describe('#iapRunAdapterConnectivity', () => {
|
|
1037
|
+
it('should have a iapRunAdapterConnectivity function', (done) => {
|
|
1111
1038
|
try {
|
|
1112
|
-
assert.equal(true, typeof a.
|
|
1039
|
+
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
|
|
1113
1040
|
done();
|
|
1114
1041
|
} catch (error) {
|
|
1115
1042
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1118,10 +1045,22 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1118
1045
|
});
|
|
1119
1046
|
});
|
|
1120
1047
|
|
|
1121
|
-
describe('#
|
|
1122
|
-
it('should have a
|
|
1048
|
+
describe('#iapRunAdapterBasicGet', () => {
|
|
1049
|
+
it('should have a iapRunAdapterBasicGet function', (done) => {
|
|
1123
1050
|
try {
|
|
1124
|
-
assert.equal(true, typeof a.
|
|
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');
|
|
1125
1064
|
done();
|
|
1126
1065
|
} catch (error) {
|
|
1127
1066
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1215,10 +1154,10 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1215
1154
|
}).timeout(attemptTimeout);
|
|
1216
1155
|
});
|
|
1217
1156
|
|
|
1218
|
-
// describe('#
|
|
1219
|
-
// it('should have a
|
|
1157
|
+
// describe('#iapHasAdapterEntity', () => {
|
|
1158
|
+
// it('should have a iapHasAdapterEntity function', (done) => {
|
|
1220
1159
|
// try {
|
|
1221
|
-
// assert.equal(true, typeof a.
|
|
1160
|
+
// assert.equal(true, typeof a.iapHasAdapterEntity === 'function');
|
|
1222
1161
|
// done();
|
|
1223
1162
|
// } catch (error) {
|
|
1224
1163
|
// log.error(`Test Failure: ${error}`);
|
|
@@ -1227,7 +1166,7 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1227
1166
|
// });
|
|
1228
1167
|
// it('should find entity', (done) => {
|
|
1229
1168
|
// try {
|
|
1230
|
-
// a.
|
|
1169
|
+
// a.iapHasAdapterEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
|
|
1231
1170
|
// try {
|
|
1232
1171
|
// assert.equal(true, data[0]);
|
|
1233
1172
|
// done();
|
|
@@ -1243,7 +1182,7 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1243
1182
|
// }).timeout(attemptTimeout);
|
|
1244
1183
|
// it('should not find entity', (done) => {
|
|
1245
1184
|
// try {
|
|
1246
|
-
// a.
|
|
1185
|
+
// a.iapHasAdapterEntity('template_entity', 'blah', (data) => {
|
|
1247
1186
|
// try {
|
|
1248
1187
|
// assert.equal(false, data[0]);
|
|
1249
1188
|
// done();
|
|
@@ -1259,6 +1198,78 @@ describe('[unit] Azure_aks Adapter Test', () => {
|
|
|
1259
1198
|
// }).timeout(attemptTimeout);
|
|
1260
1199
|
// });
|
|
1261
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
|
+
|
|
1262
1273
|
/*
|
|
1263
1274
|
-----------------------------------------------------------------------
|
|
1264
1275
|
-----------------------------------------------------------------------
|