@itentialopensource/adapter-gcp_compute 1.1.0 → 1.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 +49 -5
- 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 +850 -1029
- package/adapterBase.js +1006 -252
- package/entities/.generic/action.json +105 -0
- package/entities/.generic/schema.json +6 -1
- package/error.json +6 -0
- package/package.json +5 -3
- package/pronghorn.json +161 -82
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +421 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1652893318280.json +120 -0
- package/sampleProperties.json +91 -2
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestIntegration.js +25 -116
- package/test/unit/adapterBaseTestUnit.js +30 -25
- package/test/unit/adapterTestUnit.js +90 -186
- package/utils/adapterInfo.js +206 -0
- package/utils/entitiesToDB.js +12 -57
- package/utils/pre-commit.sh +3 -0
- package/utils/tbScript.js +35 -20
- package/utils/tbUtils.js +49 -31
- package/utils/testRunner.js +16 -16
|
@@ -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,111 +55,7 @@ global.pronghornProps = {
|
|
|
45
55
|
adapters: [{
|
|
46
56
|
id: 'Test-gcp_compute',
|
|
47
57
|
type: 'GcpCompute',
|
|
48
|
-
properties:
|
|
49
|
-
host,
|
|
50
|
-
port,
|
|
51
|
-
base_path: '/compute',
|
|
52
|
-
version: 'v1',
|
|
53
|
-
cache_location: 'none',
|
|
54
|
-
encode_pathvars: true,
|
|
55
|
-
save_metric: false,
|
|
56
|
-
stub,
|
|
57
|
-
protocol,
|
|
58
|
-
authentication: {
|
|
59
|
-
auth_method: 'no_authentication',
|
|
60
|
-
username,
|
|
61
|
-
password,
|
|
62
|
-
token: '',
|
|
63
|
-
invalid_token_error: 401,
|
|
64
|
-
token_timeout: -1,
|
|
65
|
-
token_cache: 'local',
|
|
66
|
-
auth_field: 'header.headers.Authorization',
|
|
67
|
-
auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
|
|
68
|
-
auth_logging: false,
|
|
69
|
-
client_id: '',
|
|
70
|
-
client_secret: '',
|
|
71
|
-
grant_type: '',
|
|
72
|
-
configureGtoken: {
|
|
73
|
-
email: '',
|
|
74
|
-
scope: 'https://www.googleapis.com/auth/cloud-platform',
|
|
75
|
-
sub: '',
|
|
76
|
-
keyFile: 'path/to/google/keyfile',
|
|
77
|
-
key: '',
|
|
78
|
-
additionalClaims: '',
|
|
79
|
-
eagerRefreshThresholdMillis: 300000
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
healthcheck: {
|
|
83
|
-
type: 'none',
|
|
84
|
-
frequency: 60000,
|
|
85
|
-
query_object: {}
|
|
86
|
-
},
|
|
87
|
-
throttle: {
|
|
88
|
-
throttle_enabled: false,
|
|
89
|
-
number_pronghorns: 1,
|
|
90
|
-
sync_async: 'sync',
|
|
91
|
-
max_in_queue: 1000,
|
|
92
|
-
concurrent_max: 1,
|
|
93
|
-
expire_timeout: 0,
|
|
94
|
-
avg_runtime: 200,
|
|
95
|
-
priorities: [
|
|
96
|
-
{
|
|
97
|
-
value: 0,
|
|
98
|
-
percent: 100
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
|
-
request: {
|
|
103
|
-
number_redirects: 0,
|
|
104
|
-
number_retries: 3,
|
|
105
|
-
limit_retry_error: [0],
|
|
106
|
-
failover_codes: [],
|
|
107
|
-
attempt_timeout: attemptTimeout,
|
|
108
|
-
global_request: {
|
|
109
|
-
payload: {},
|
|
110
|
-
uriOptions: {},
|
|
111
|
-
addlHeaders: {},
|
|
112
|
-
authData: {}
|
|
113
|
-
},
|
|
114
|
-
healthcheck_on_timeout: true,
|
|
115
|
-
return_raw: true,
|
|
116
|
-
archiving: false,
|
|
117
|
-
return_request: false
|
|
118
|
-
},
|
|
119
|
-
proxy: {
|
|
120
|
-
enabled: false,
|
|
121
|
-
host: '',
|
|
122
|
-
port: 1,
|
|
123
|
-
protocol: 'http',
|
|
124
|
-
username: '',
|
|
125
|
-
password: ''
|
|
126
|
-
},
|
|
127
|
-
ssl: {
|
|
128
|
-
ecdhCurve: '',
|
|
129
|
-
enabled: sslenable,
|
|
130
|
-
accept_invalid_cert: sslinvalid,
|
|
131
|
-
ca_file: '',
|
|
132
|
-
key_file: '',
|
|
133
|
-
cert_file: '',
|
|
134
|
-
secure_protocol: '',
|
|
135
|
-
ciphers: ''
|
|
136
|
-
},
|
|
137
|
-
mongo: {
|
|
138
|
-
host: '',
|
|
139
|
-
port: 0,
|
|
140
|
-
database: '',
|
|
141
|
-
username: '',
|
|
142
|
-
password: '',
|
|
143
|
-
replSet: '',
|
|
144
|
-
db_ssl: {
|
|
145
|
-
enabled: false,
|
|
146
|
-
accept_invalid_cert: false,
|
|
147
|
-
ca_file: '',
|
|
148
|
-
key_file: '',
|
|
149
|
-
cert_file: ''
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
58
|
+
properties: samProps
|
|
153
59
|
}]
|
|
154
60
|
}
|
|
155
61
|
};
|
|
@@ -280,10 +186,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
280
186
|
});
|
|
281
187
|
|
|
282
188
|
let wffunctions = [];
|
|
283
|
-
describe('#
|
|
189
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
284
190
|
it('should retrieve workflow functions', (done) => {
|
|
285
191
|
try {
|
|
286
|
-
wffunctions = a.
|
|
192
|
+
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
287
193
|
|
|
288
194
|
try {
|
|
289
195
|
assert.notEqual(0, wffunctions.length);
|
|
@@ -474,16 +380,17 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
474
380
|
assert.notEqual('', pronghornDotJson.methods);
|
|
475
381
|
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
476
382
|
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
477
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
478
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
479
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
480
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
481
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
482
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
483
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
484
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
485
|
-
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'));
|
|
486
392
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
393
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
|
|
487
394
|
done();
|
|
488
395
|
} catch (error) {
|
|
489
396
|
log.error(`Test Failure: ${error}`);
|
|
@@ -655,6 +562,8 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
655
562
|
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
|
|
656
563
|
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
|
|
657
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);
|
|
658
567
|
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
659
568
|
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
660
569
|
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
@@ -668,6 +577,7 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
668
577
|
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
669
578
|
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
670
579
|
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
580
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
|
|
671
581
|
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
672
582
|
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
673
583
|
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
@@ -716,8 +626,6 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
716
626
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
|
|
717
627
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
|
|
718
628
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
|
|
719
|
-
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
720
|
-
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
721
629
|
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
|
|
722
630
|
assert.notEqual(null, propertiesDotJson.definitions.mongo);
|
|
723
631
|
assert.notEqual('', propertiesDotJson.definitions.mongo);
|
|
@@ -733,6 +641,12 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
733
641
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
|
|
734
642
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
|
|
735
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);
|
|
736
650
|
done();
|
|
737
651
|
} catch (error) {
|
|
738
652
|
log.error(`Test Failure: ${error}`);
|
|
@@ -849,17 +763,13 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
849
763
|
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
850
764
|
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
851
765
|
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
852
|
-
|
|
853
766
|
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
854
767
|
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
855
768
|
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
856
769
|
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
770
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
857
771
|
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
858
772
|
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
859
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
860
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
861
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
862
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
863
773
|
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
864
774
|
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
865
775
|
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
@@ -918,6 +828,12 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
918
828
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
919
829
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
920
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);
|
|
921
837
|
done();
|
|
922
838
|
} catch (error) {
|
|
923
839
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1011,10 +927,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1011
927
|
});
|
|
1012
928
|
});
|
|
1013
929
|
|
|
1014
|
-
describe('#
|
|
1015
|
-
it('should have a
|
|
930
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
931
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
1016
932
|
try {
|
|
1017
|
-
assert.equal(true, typeof a.
|
|
933
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
1018
934
|
done();
|
|
1019
935
|
} catch (error) {
|
|
1020
936
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1023,19 +939,19 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1023
939
|
});
|
|
1024
940
|
});
|
|
1025
941
|
|
|
1026
|
-
describe('#
|
|
1027
|
-
it('should have a
|
|
942
|
+
describe('#iapFindAdapterPath', () => {
|
|
943
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
1028
944
|
try {
|
|
1029
|
-
assert.equal(true, typeof a.
|
|
945
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
1030
946
|
done();
|
|
1031
947
|
} catch (error) {
|
|
1032
948
|
log.error(`Test Failure: ${error}`);
|
|
1033
949
|
done(error);
|
|
1034
950
|
}
|
|
1035
951
|
});
|
|
1036
|
-
it('
|
|
952
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
1037
953
|
try {
|
|
1038
|
-
a.
|
|
954
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
1039
955
|
try {
|
|
1040
956
|
assert.equal(undefined, error);
|
|
1041
957
|
assert.notEqual(undefined, data);
|
|
@@ -1057,10 +973,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1057
973
|
}).timeout(attemptTimeout);
|
|
1058
974
|
});
|
|
1059
975
|
|
|
1060
|
-
describe('#
|
|
1061
|
-
it('should have a
|
|
976
|
+
describe('#iapSuspendAdapter', () => {
|
|
977
|
+
it('should have a iapSuspendAdapter function', (done) => {
|
|
1062
978
|
try {
|
|
1063
|
-
assert.equal(true, typeof a.
|
|
979
|
+
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
|
|
1064
980
|
done();
|
|
1065
981
|
} catch (error) {
|
|
1066
982
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1069,10 +985,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1069
985
|
});
|
|
1070
986
|
});
|
|
1071
987
|
|
|
1072
|
-
describe('#
|
|
1073
|
-
it('should have a
|
|
988
|
+
describe('#iapUnsuspendAdapter', () => {
|
|
989
|
+
it('should have a iapUnsuspendAdapter function', (done) => {
|
|
1074
990
|
try {
|
|
1075
|
-
assert.equal(true, typeof a.
|
|
991
|
+
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
|
|
1076
992
|
done();
|
|
1077
993
|
} catch (error) {
|
|
1078
994
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1081,10 +997,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1081
997
|
});
|
|
1082
998
|
});
|
|
1083
999
|
|
|
1084
|
-
describe('#
|
|
1085
|
-
it('should have a
|
|
1000
|
+
describe('#iapGetAdapterQueue', () => {
|
|
1001
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
1086
1002
|
try {
|
|
1087
|
-
assert.equal(true, typeof a.
|
|
1003
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
1088
1004
|
done();
|
|
1089
1005
|
} catch (error) {
|
|
1090
1006
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1093,10 +1009,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1093
1009
|
});
|
|
1094
1010
|
});
|
|
1095
1011
|
|
|
1096
|
-
describe('#
|
|
1097
|
-
it('should have a
|
|
1012
|
+
describe('#iapTroubleshootAdapter', () => {
|
|
1013
|
+
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1098
1014
|
try {
|
|
1099
|
-
assert.equal(true, typeof a.
|
|
1015
|
+
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
|
|
1100
1016
|
done();
|
|
1101
1017
|
} catch (error) {
|
|
1102
1018
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1105,10 +1021,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1105
1021
|
});
|
|
1106
1022
|
});
|
|
1107
1023
|
|
|
1108
|
-
describe('#
|
|
1109
|
-
it('should have a
|
|
1024
|
+
describe('#iapRunAdapterHealthcheck', () => {
|
|
1025
|
+
it('should have a iapRunAdapterHealthcheck function', (done) => {
|
|
1110
1026
|
try {
|
|
1111
|
-
assert.equal(true, typeof a.
|
|
1027
|
+
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
|
|
1112
1028
|
done();
|
|
1113
1029
|
} catch (error) {
|
|
1114
1030
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1117,10 +1033,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1117
1033
|
});
|
|
1118
1034
|
});
|
|
1119
1035
|
|
|
1120
|
-
describe('#
|
|
1121
|
-
it('should have a
|
|
1036
|
+
describe('#iapRunAdapterConnectivity', () => {
|
|
1037
|
+
it('should have a iapRunAdapterConnectivity function', (done) => {
|
|
1122
1038
|
try {
|
|
1123
|
-
assert.equal(true, typeof a.
|
|
1039
|
+
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
|
|
1124
1040
|
done();
|
|
1125
1041
|
} catch (error) {
|
|
1126
1042
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1129,10 +1045,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1129
1045
|
});
|
|
1130
1046
|
});
|
|
1131
1047
|
|
|
1132
|
-
describe('#
|
|
1133
|
-
it('should have a
|
|
1048
|
+
describe('#iapRunAdapterBasicGet', () => {
|
|
1049
|
+
it('should have a iapRunAdapterBasicGet function', (done) => {
|
|
1134
1050
|
try {
|
|
1135
|
-
assert.equal(true, typeof a.
|
|
1051
|
+
assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
|
|
1136
1052
|
done();
|
|
1137
1053
|
} catch (error) {
|
|
1138
1054
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1141,10 +1057,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1141
1057
|
});
|
|
1142
1058
|
});
|
|
1143
1059
|
|
|
1144
|
-
describe('#
|
|
1145
|
-
it('should have a
|
|
1060
|
+
describe('#iapMoveAdapterEntitiesToDB', () => {
|
|
1061
|
+
it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
|
|
1146
1062
|
try {
|
|
1147
|
-
assert.equal(true, typeof a.
|
|
1063
|
+
assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
|
|
1148
1064
|
done();
|
|
1149
1065
|
} catch (error) {
|
|
1150
1066
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1238,10 +1154,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1238
1154
|
}).timeout(attemptTimeout);
|
|
1239
1155
|
});
|
|
1240
1156
|
|
|
1241
|
-
// describe('#
|
|
1242
|
-
// it('should have a
|
|
1157
|
+
// describe('#iapHasAdapterEntity', () => {
|
|
1158
|
+
// it('should have a iapHasAdapterEntity function', (done) => {
|
|
1243
1159
|
// try {
|
|
1244
|
-
// assert.equal(true, typeof a.
|
|
1160
|
+
// assert.equal(true, typeof a.iapHasAdapterEntity === 'function');
|
|
1245
1161
|
// done();
|
|
1246
1162
|
// } catch (error) {
|
|
1247
1163
|
// log.error(`Test Failure: ${error}`);
|
|
@@ -1250,7 +1166,7 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1250
1166
|
// });
|
|
1251
1167
|
// it('should find entity', (done) => {
|
|
1252
1168
|
// try {
|
|
1253
|
-
// a.
|
|
1169
|
+
// a.iapHasAdapterEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
|
|
1254
1170
|
// try {
|
|
1255
1171
|
// assert.equal(true, data[0]);
|
|
1256
1172
|
// done();
|
|
@@ -1266,7 +1182,7 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1266
1182
|
// }).timeout(attemptTimeout);
|
|
1267
1183
|
// it('should not find entity', (done) => {
|
|
1268
1184
|
// try {
|
|
1269
|
-
// a.
|
|
1185
|
+
// a.iapHasAdapterEntity('template_entity', 'blah', (data) => {
|
|
1270
1186
|
// try {
|
|
1271
1187
|
// assert.equal(false, data[0]);
|
|
1272
1188
|
// done();
|
|
@@ -1294,18 +1210,6 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1294
1210
|
});
|
|
1295
1211
|
});
|
|
1296
1212
|
|
|
1297
|
-
describe('#hasDevices', () => {
|
|
1298
|
-
it('should have a hasDevices function', (done) => {
|
|
1299
|
-
try {
|
|
1300
|
-
assert.equal(true, typeof a.hasDevices === 'function');
|
|
1301
|
-
done();
|
|
1302
|
-
} catch (error) {
|
|
1303
|
-
log.error(`Test Failure: ${error}`);
|
|
1304
|
-
done(error);
|
|
1305
|
-
}
|
|
1306
|
-
});
|
|
1307
|
-
});
|
|
1308
|
-
|
|
1309
1213
|
describe('#getDevice', () => {
|
|
1310
1214
|
it('should have a getDevice function', (done) => {
|
|
1311
1215
|
try {
|
|
@@ -1354,10 +1258,10 @@ describe('[unit] GcpCompute Adapter Test', () => {
|
|
|
1354
1258
|
});
|
|
1355
1259
|
});
|
|
1356
1260
|
|
|
1357
|
-
describe('#
|
|
1358
|
-
it('should have a
|
|
1261
|
+
describe('#iapGetDeviceCount', () => {
|
|
1262
|
+
it('should have a iapGetDeviceCount function', (done) => {
|
|
1359
1263
|
try {
|
|
1360
|
-
assert.equal(true, typeof a.
|
|
1264
|
+
assert.equal(true, typeof a.iapGetDeviceCount === 'function');
|
|
1361
1265
|
done();
|
|
1362
1266
|
} catch (error) {
|
|
1363
1267
|
log.error(`Test Failure: ${error}`);
|