itoolkit 1.0.1 → 1.0.2

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.
Files changed (46) hide show
  1. package/README.md +5 -0
  2. package/lib/CommandCall.js +2 -16
  3. package/lib/Connection.js +2 -16
  4. package/lib/Deprecated.js +2 -22
  5. package/lib/ProgramCall.js +2 -16
  6. package/lib/itoolkit.js +2 -16
  7. package/lib/transports/httpTransport.js +2 -16
  8. package/lib/transports/idbTransport.js +2 -16
  9. package/lib/transports/odbcTransport.js +2 -16
  10. package/lib/transports/sshTransport.js +2 -16
  11. package/package.json +11 -5
  12. package/.eslintrc.js +0 -39
  13. package/.gitattributes +0 -2
  14. package/.readthedocs.yml +0 -16
  15. package/CHANGELOG.md +0 -228
  16. package/contributors.txt +0 -2
  17. package/test/README.md +0 -44
  18. package/test/functional/CommandCallFunctional.js +0 -87
  19. package/test/functional/ProgramCallFunctional.js +0 -106
  20. package/test/functional/checkObjectExists.js +0 -193
  21. package/test/functional/checkVersion.js +0 -17
  22. package/test/functional/config.js +0 -35
  23. package/test/functional/deprecated/commandsFunctional.js +0 -108
  24. package/test/functional/deprecated/iDataQueueFunctional.js +0 -103
  25. package/test/functional/deprecated/iNetworkFunctional.js +0 -159
  26. package/test/functional/deprecated/iObjFunctional.js +0 -349
  27. package/test/functional/deprecated/iPgmFunctional.js +0 -104
  28. package/test/functional/deprecated/iProdFunctional.js +0 -160
  29. package/test/functional/deprecated/iSqlFunctional.js +0 -453
  30. package/test/functional/deprecated/iUserSpaceFunctional.js +0 -138
  31. package/test/functional/deprecated/iWorkFunctional.js +0 -238
  32. package/test/functional/iDataQueueFunctional.js +0 -83
  33. package/test/functional/iNetworkFunctional.js +0 -131
  34. package/test/functional/iObjFunctional.js +0 -326
  35. package/test/functional/iProdFunctional.js +0 -134
  36. package/test/functional/iSqlFunctional.js +0 -448
  37. package/test/functional/iUserSpaceFunctional.js +0 -134
  38. package/test/functional/iWorkFunctional.js +0 -215
  39. package/test/unit/CommandCallUnit.js +0 -87
  40. package/test/unit/ConnectionUnit.js +0 -188
  41. package/test/unit/ProgamCallUnit.js +0 -281
  42. package/test/unit/deprecated/commandsUnit.js +0 -87
  43. package/test/unit/deprecated/iConnUnit.js +0 -158
  44. package/test/unit/deprecated/iPgmUnit.js +0 -211
  45. package/test/unit/deprecated/iSqlUnit.js +0 -441
  46. package/test/unit/deprecated/xmlToJsonUnit.js +0 -200
@@ -1,138 +0,0 @@
1
- // Copyright (c) International Business Machines Corp. 2019
2
-
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4
- // associated documentation files (the "Software"), to deal in the Software without restriction,
5
- // including without limitation the rights to use, copy, modify, merge, publish, distribute,
6
- // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7
- // furnished to do so, subject to the following conditions:
8
-
9
- // The above copyright notice and this permission notice shall be included in all copies or
10
- // substantial portions of the Software.
11
-
12
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
13
- // NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
-
18
- /* eslint-disable new-cap */
19
-
20
- const { expect } = require('chai');
21
- const { iConn, iUserSpace } = require('../../../lib/itoolkit');
22
- const { config, printConfig } = require('../config');
23
-
24
- // deprecated tests are in place to test compatability using deprecated classes and functions
25
- // these tests use deprecated iConn Class to create a connnection
26
- // iConn only supported idb and rest transports
27
- if (config.transport !== 'idb' && config.transport !== 'rest') {
28
- throw new Error('Only idb and rest transports are available for deprecated tests');
29
- }
30
-
31
- const {
32
- database, username, password, host, port = 80, path,
33
- } = config.transportOptions;
34
-
35
- let restOptions = null;
36
- if (config.transport === 'rest') {
37
- restOptions = {
38
- host,
39
- port,
40
- path,
41
- };
42
- }
43
-
44
- const lib = 'NODETKTEST';
45
-
46
- describe('iUserSpace Functional Tests', function () {
47
- before(function () {
48
- printConfig();
49
- });
50
-
51
- describe('constructor', function () {
52
- it('returns an instance of iUserSpace', function () {
53
- const connection = new iConn(database, config.user, password);
54
-
55
- const userSpace = new iUserSpace(connection);
56
-
57
- expect(userSpace).to.be.instanceOf(iUserSpace);
58
- });
59
- });
60
-
61
- describe('createUserSpace', function () {
62
- it('creates a user space', function (done) {
63
- const connection = new iConn(database, username, password, restOptions);
64
-
65
- const userSpace = new iUserSpace(connection);
66
-
67
- const description = 'Node toolkit test user space';
68
-
69
- const userSpaceName = `USP${(config.transport).toUpperCase()}`;
70
-
71
- userSpace.createUserSpace(
72
- userSpaceName,
73
- lib,
74
- 'LOG',
75
- 50,
76
- '*EXCLUDE',
77
- description,
78
- (output) => {
79
- expect(output).to.be.a('boolean').and.to.equal(true);
80
- done();
81
- },
82
- );
83
- });
84
- });
85
-
86
- describe('setUserSpaceData', function () {
87
- it('sets data within the user space', function (done) {
88
- const connection = new iConn(database, username, password, restOptions);
89
-
90
- const userSpace = new iUserSpace(connection);
91
-
92
- const msg = 'Hello from userspace!';
93
-
94
- const userSpaceName = `USP${(config.transport).toUpperCase()}`;
95
-
96
- userSpace.setUserSpaceData(
97
- userSpaceName,
98
- lib,
99
- msg.length,
100
- msg,
101
- (output) => {
102
- expect(output).to.be.a('boolean').and.to.equal(true);
103
- done();
104
- },
105
- );
106
- });
107
- });
108
-
109
- describe('getUserSpaceData', function () {
110
- it('returns specified length of data', function (done) {
111
- const connection = new iConn(database, username, password, restOptions);
112
-
113
- const userSpace = new iUserSpace(connection);
114
-
115
- const userSpaceName = `USP${(config.transport).toUpperCase()}`;
116
-
117
- userSpace.getUserSpaceData(userSpaceName, lib, 21, (output) => {
118
- expect(output).to.be.a('string').and.to.equal('Hello from userspace!');
119
- done();
120
- });
121
- });
122
- });
123
-
124
- describe('deleteUserSpace', function () {
125
- it('removes a user space', function (done) {
126
- const connection = new iConn(database, username, password, restOptions);
127
-
128
- const userSpace = new iUserSpace(connection);
129
-
130
- const userSpaceName = `USP${(config.transport).toUpperCase()}`;
131
-
132
- userSpace.deleteUserSpace(userSpaceName, lib, (output) => {
133
- expect(output).to.be.a('boolean').and.to.equal(true);
134
- done();
135
- });
136
- });
137
- });
138
- });
@@ -1,238 +0,0 @@
1
- // Copyright (c) International Business Machines Corp. 2019
2
-
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4
- // associated documentation files (the "Software"), to deal in the Software without restriction,
5
- // including without limitation the rights to use, copy, modify, merge, publish, distribute,
6
- // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7
- // furnished to do so, subject to the following conditions:
8
-
9
- // The above copyright notice and this permission notice shall be included in all copies or
10
- // substantial portions of the Software.
11
-
12
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
13
- // NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
-
18
- /* eslint-disable new-cap */
19
-
20
- const { expect } = require('chai');
21
- const { iConn, iWork } = require('../../../lib/itoolkit');
22
- const { config, printConfig } = require('../config');
23
- const { checkObjectExists } = require('../checkObjectExists');
24
-
25
- // deprecated tests are in place to test compatability using deprecated classes and functions
26
- // these tests use deprecated iConn Class to create a connnection
27
- // iConn only supported idb and rest transports
28
- if (config.transport !== 'idb' && config.transport !== 'rest') {
29
- throw new Error('Only idb and rest transports are available for deprecated tests');
30
- }
31
-
32
- const {
33
- database, username, password, host, port = 80, path,
34
- } = config.transportOptions;
35
-
36
- let restOptions = null;
37
- if (config.transport === 'rest') {
38
- restOptions = {
39
- host,
40
- port,
41
- path,
42
- };
43
- }
44
-
45
- describe('iWork Functional Tests', function () {
46
- before(function () {
47
- printConfig();
48
- });
49
-
50
- describe('constructor', function () {
51
- it('creates and returns an instance of iWork', function () {
52
- const connection = new iConn(database, config.user, password);
53
-
54
- const work = new iWork(connection);
55
-
56
- expect(work).to.be.instanceOf(iWork);
57
- });
58
- });
59
-
60
- describe('getSysValue', function () {
61
- it('returns the value of system variable', function (done) {
62
- const connection = new iConn(database, username, password, restOptions);
63
-
64
- const work = new iWork(connection);
65
-
66
- work.getSysValue('QCENTURY', (output) => {
67
- expect(output).to.be.a('string').and.to.equal('1');
68
- done();
69
- });
70
- });
71
- });
72
-
73
- describe('getSysStatus', function () {
74
- it(
75
- 'returns basic system status information about the signed-on users '
76
- + 'and batch jobs',
77
- function (done) {
78
- const connection = new iConn(database, username, password, restOptions);
79
- const work = new iWork(connection);
80
-
81
- work.getSysStatus((output) => {
82
- expect(output).to.be.an('Object');
83
- expect(output).to.have.a.property('Current_date_and_time');
84
- expect(output).to.have.a.property('System_name');
85
- expect(output).to.have.a.property('Users_currently_signed_on');
86
- expect(output).to.have.a.property('Users_temporarily_signed_off_(disconnected)');
87
- expect(output).to.have.a.property('Users_suspended_by_system_request');
88
- expect(output).to.have.a.property('Users_suspended_by_group_jobs');
89
- expect(output).to.have.a.property('Users_signed_off_with_printer_output_waiting_to_print');
90
- expect(output).to.have.a.property('Batch_jobs_waiting_for_messages');
91
- expect(output).to.have.a.property('Batch_jobs_running');
92
- expect(output).to.have.a.property('Batch_jobs_held_while_running');
93
- expect(output).to.have.a.property('Batch_jobs_ending');
94
- expect(output).to.have.a.property('Batch_jobs_waiting_to_run_or_already_scheduled');
95
- expect(output).to.have.a.property('Batch_jobs_held_on_a_job_queue');
96
- expect(output).to.have.a.property('Batch_jobs_on_a_held_job_queue');
97
- expect(output).to.have.a.property('Batch_jobs_on_an_unassigned_job_queue');
98
- expect(output).to.have.a.property('Batch_jobs_ended_with_printer_output_waiting_to_print');
99
- done();
100
- });
101
- },
102
- );
103
- });
104
-
105
- describe('getSysStatusExt', function () {
106
- it(
107
- 'returns more detailed system status info',
108
- function (done) {
109
- const connection = new iConn(database, username, password, restOptions);
110
-
111
- const work = new iWork(connection);
112
-
113
- work.getSysStatusExt((output) => {
114
- expect(output).to.be.an('Object');
115
- expect(output).to.have.a.property('Current_date_and_time');
116
- expect(output).to.have.a.property('System_name');
117
- expect(output).to.have.a.property('Elapsed_time');
118
- expect(output).to.have.a.property('Restricted_state_flag');
119
- expect(output).to.have.a.property('%_processing_unit_used');
120
- expect(output).to.have.a.property('Jobs_in_system');
121
- expect(output).to.have.a.property('%_permanent_addresses');
122
- expect(output).to.have.a.property('%_temporary_addresses');
123
- expect(output).to.have.a.property('System_ASP');
124
- expect(output).to.have.a.property('%_system_ASP_used');
125
- expect(output).to.have.a.property('Total_auxiliary_storage');
126
- expect(output).to.have.a.property('Current_unprotected_storage_used');
127
- expect(output).to.have.a.property('Maximum_unprotected_storage_used');
128
- expect(output).to.have.a.property('%_DB_capability');
129
- expect(output).to.have.a.property('Main_storage_size');
130
- expect(output).to.have.a.property('Number_of_partitions');
131
- expect(output).to.have.a.property('Partition_identifier');
132
- expect(output).to.have.a.property('Current_processing_capacity');
133
- expect(output).to.have.a.property('Processor_sharing_attribute');
134
- expect(output).to.have.a.property('Number_of_processors');
135
- expect(output).to.have.a.property('Active_jobs_in_system');
136
- expect(output).to.have.a.property('Active_threads_in_system');
137
- expect(output).to.have.a.property('Maximum_jobs_in_system');
138
- expect(output).to.have.a.property('%_temporary_256MB_segments_used');
139
- expect(output).to.have.a.property('%_temporary_4GB_segments_used');
140
- expect(output).to.have.a.property('%_permanent_256MB_segments_used');
141
- expect(output).to.have.a.property('%_permanent_4GB_segments_used');
142
- expect(output).to.have.a.property('%_current_interactive_performance');
143
- expect(output).to.have.a.property('%_uncapped_CPU_capacity_used');
144
- expect(output).to.have.a.property('%_shared_processor_pool_used');
145
- expect(output).to.have.a.property('Main_storage_size_(long)');
146
- done();
147
- });
148
- },
149
- );
150
- });
151
-
152
- describe('getJobStatus', function () {
153
- it(
154
- 'returns status of specified job',
155
- function (done) {
156
- const connection = new iConn(database, username, password, restOptions);
157
-
158
- const work = new iWork(connection);
159
-
160
- work.getJobStatus('000000', (output) => {
161
- expect(output).to.be.an('Object');
162
- expect(output).to.have.a.property('Job_status');
163
- expect(output).to.have.a.property('Fully_qualified_job_name');
164
- done();
165
- });
166
- },
167
- );
168
- });
169
-
170
- describe('getJobInfo', function () {
171
- it('returns info on specfed job', function (done) {
172
- const connection = new iConn(database, username, password, restOptions);
173
-
174
- const work = new iWork(connection);
175
-
176
- work.getJobInfo('SCPF', 'QSYS', '000000', (output) => {
177
- expect(output).to.be.an('Object');
178
- expect(output).to.have.a.property('Job_name');
179
- expect(output).to.have.a.property('User_name');
180
- expect(output).to.have.a.property('Job_number');
181
- expect(output).to.have.a.property('Job_status');
182
- expect(output).to.have.a.property('Job_type');
183
- expect(output).to.have.a.property('Job_subtype');
184
- expect(output).to.have.a.property('Subsystem_description_name');
185
- expect(output).to.have.a.property('Run_priority_(job)');
186
- expect(output).to.have.a.property('System_pool_identifier');
187
- expect(output).to.have.a.property('Processing_unit_time_used,_if_less_than_2,147,483,647_milliseconds');
188
- expect(output).to.have.a.property('Number_of_auxiliary_I/O_requests,_if_less_than_2,147,483,647');
189
- expect(output).to.have.a.property('Number_of_interactive_transactions');
190
- expect(output).to.have.a.property('Response_time_total');
191
- expect(output).to.have.a.property('Function_type');
192
- expect(output).to.have.a.property('Function_name');
193
- expect(output).to.have.a.property('Active_job_status');
194
- expect(output).to.have.a.property('Number_of_database_lock_waits');
195
- expect(output).to.have.a.property('Number_of_internal_machine_lock_waits');
196
- expect(output).to.have.a.property('Number_of_nondatabase_lock_waits');
197
- expect(output).to.have.a.property('Time_spent_on_database_lock_waits');
198
- expect(output).to.have.a.property('Time_spent_on_internal_machine_lock_waits');
199
- expect(output).to.have.a.property('Time_spent_on_nondatabase_lock_waits');
200
- expect(output).to.have.a.property('Current_system_pool_identifier');
201
- expect(output).to.have.a.property('Thread_count');
202
- expect(output).to.have.a.property('Processing_unit_time_used_-_total_for_the_job');
203
- expect(output).to.have.a.property('Number_of_auxiliary_I/O_requests');
204
- expect(output).to.have.a.property('Processing_unit_time_used_for_database_-_total_for_the_job');
205
- expect(output).to.have.a.property('Page_faults');
206
- expect(output).to.have.a.property('Active_job_status_for_jobs_ending');
207
- expect(output).to.have.a.property('Memory_pool_name');
208
- expect(output).to.have.a.property('Message_reply');
209
- expect(output).to.have.a.property('Message_key,_when_active_job_waiting_for_a_message');
210
- expect(output).to.have.a.property('Message_queue_name,_when_active_job_waiting_for_a_message');
211
- expect(output).to.have.a.property('Message_queue_library_name,_when_active_job_waiting_for_a_message');
212
- expect(output).to.have.a.property('Message_queue_library_ASP_device_name,_when_active_job_waiting_for_a_message');
213
- done();
214
- });
215
- });
216
- });
217
-
218
- describe('getDataArea', function () {
219
- it('returns contents of a data area', function (done) {
220
- checkObjectExists(config, 'TESTDA', '*DTAARA', (error) => {
221
- if (error) { throw error; }
222
- const connection = new iConn(database, username, password, restOptions);
223
-
224
- const work = new iWork(connection);
225
-
226
- work.getDataArea('NODETKTEST', 'TESTDA', 20, (output) => {
227
- expect(output).to.be.an('Object');
228
- expect(output).to.have.a.property('Type_of_value_returned');
229
- expect(output).to.have.a.property('Library_name');
230
- expect(output).to.have.a.property('Length_of_value_returned');
231
- expect(output).to.have.a.property('Number_of_decimal_positions');
232
- expect(output).to.have.a.property('Value');
233
- done();
234
- });
235
- });
236
- });
237
- });
238
- });
@@ -1,83 +0,0 @@
1
- // Copyright (c) International Business Machines Corp. 2019
2
-
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4
- // associated documentation files (the "Software"), to deal in the Software without restriction,
5
- // including without limitation the rights to use, copy, modify, merge, publish, distribute,
6
- // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7
- // furnished to do so, subject to the following conditions:
8
-
9
- // The above copyright notice and this permission notice shall be included in all copies or
10
- // substantial portions of the Software.
11
-
12
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
13
- // NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
-
18
- /* eslint-disable new-cap */
19
-
20
- const { expect } = require('chai');
21
- const { iDataQueue, Connection } = require('../../lib/itoolkit');
22
- const { config, printConfig } = require('./config');
23
- const { checkObjectExists } = require('./checkObjectExists');
24
-
25
- const lib = 'NODETKTEST';
26
-
27
- describe('DataQueue Functional Tests', function () {
28
- const dqName = 'TESTQ';
29
- const dqName2 = 'TESTQ2';
30
-
31
- before('check if data queue exists for tests', function (done) {
32
- printConfig();
33
- checkObjectExists(config, dqName, '*DTAQ', (error) => {
34
- if (error) { throw error; }
35
-
36
- checkObjectExists(config, dqName2, '*DTAQ', (error2) => {
37
- if (error2) { throw error2; }
38
- done();
39
- });
40
- });
41
- });
42
- describe('sendToDataQueue', function () {
43
- it('sends data to specified DQ', function (done) {
44
- const connection = new Connection(config);
45
-
46
- const dq = new iDataQueue(connection);
47
-
48
- dq.sendToDataQueue(dqName, lib, 'Hello from DQ!', (error, output) => {
49
- expect(error).to.equal(null);
50
- expect(output).to.equal(true);
51
- done();
52
- });
53
- });
54
- });
55
-
56
- describe('receiveFromDataQueue', function () {
57
- it('receives data from specfied DQ', function (done) {
58
- const connection = new Connection(config);
59
-
60
- const dq = new iDataQueue(connection);
61
-
62
- dq.receiveFromDataQueue(dqName, lib, 100, (error, output) => {
63
- expect(error).to.equal(null);
64
- expect(output).to.be.a('string').and.to.equal('Hello from DQ!');
65
- done();
66
- });
67
- });
68
- });
69
-
70
- describe('clearDataQueue', function () {
71
- it('clears the specifed DQ', function (done) {
72
- const connection = new Connection(config);
73
-
74
- const dq = new iDataQueue(connection);
75
-
76
- dq.clearDataQueue(dqName2, lib, (error, output) => {
77
- expect(error).to.equal(null);
78
- expect(output).to.equal(true);
79
- done();
80
- });
81
- });
82
- });
83
- });
@@ -1,131 +0,0 @@
1
- // Copyright (c) International Business Machines Corp. 2019
2
-
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4
- // associated documentation files (the "Software"), to deal in the Software without restriction,
5
- // including without limitation the rights to use, copy, modify, merge, publish, distribute,
6
- // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7
- // furnished to do so, subject to the following conditions:
8
-
9
- // The above copyright notice and this permission notice shall be included in all copies or
10
- // substantial portions of the Software.
11
-
12
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
13
- // NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
-
18
- /* eslint-disable new-cap */
19
-
20
- const { expect } = require('chai');
21
- const { Connection, iNetwork } = require('../../lib/itoolkit');
22
- const { config, printConfig } = require('./config');
23
-
24
- describe('iNetwork Functional Tests', function () {
25
- before(function () {
26
- printConfig();
27
- });
28
-
29
- describe('getTCPIPAttr', function () {
30
- it('retrieves TCP/IP Attributes', function (done) {
31
- const connection = new Connection(config);
32
-
33
- const net = new iNetwork(connection);
34
-
35
- net.getTCPIPAttr((error, output) => {
36
- expect(error).to.equal(null);
37
- expect(output).to.be.an('Object');
38
- expect(output).to.have.a.property('TCP/IPv4_stack_status');
39
- expect(output).to.have.a.property('How_long_active');
40
- expect(output).to.have.a.property('When_last_started_-_date');
41
- expect(output).to.have.a.property('When_last_started_-_time');
42
- expect(output).to.have.a.property('When_last_ended_-_date');
43
- expect(output).to.have.a.property('When_last_ended_-_time');
44
- expect(output).to.have.a.property('Who_last_started_-_job_name');
45
- expect(output).to.have.a.property('Who_last_started_-_job_user_name');
46
- expect(output).to.have.a.property('Who_last_started_-_job_number');
47
- expect(output).to.have.a.property('Who_last_started_-_internal_job_identifier');
48
- expect(output).to.have.a.property('Who_last_ended_-_job_name');
49
- expect(output).to.have.a.property('Who_last_ended_-_job_user_name');
50
- expect(output).to.have.a.property('Who_last_ended_-_job_number');
51
- expect(output).to.have.a.property('Who_last_ended_-_internal_job_identifier');
52
- expect(output).to.have.a.property('Offset_to_additional_information');
53
- expect(output).to.have.a.property('Length_of_additional_information');
54
- expect(output).to.have.a.property('Limited_mode');
55
- expect(output).to.have.a.property('Offset_to_list_of_Internet_addresses');
56
- expect(output).to.have.a.property('Number_of_Internet_addresses');
57
- expect(output).to.have.a.property('Entry_length_for_list_of_Internet_addresses');
58
- expect(output).to.have.a.property('DNS_protocol');
59
- expect(output).to.have.a.property('Retries');
60
- expect(output).to.have.a.property('Time_interval');
61
- expect(output).to.have.a.property('Search_order');
62
- expect(output).to.have.a.property('Initial_domain_name_server');
63
- expect(output).to.have.a.property('DNS_listening_port');
64
- expect(output).to.have.a.property('Host_name');
65
- expect(output).to.have.a.property('Domain_name');
66
- expect(output).to.have.a.property('Domain_search_list');
67
- done();
68
- });
69
- });
70
- });
71
-
72
- describe('getNetInterfaceData', function () {
73
- it('retrieves IPv4 network interface info', function (done) {
74
- const connection = new Connection(config);
75
-
76
- const net = new iNetwork(connection);
77
-
78
- net.getNetInterfaceData('127.0.0.1', (error, output) => {
79
- expect(error).to.equal(null);
80
- expect(output).to.be.an('Object');
81
- expect(output).to.have.a.property('Internet_address');
82
- expect(output).to.have.a.property('Internet_address_binary');
83
- expect(output).to.have.a.property('Network_address');
84
- expect(output).to.have.a.property('Network_address_binary');
85
- expect(output).to.have.a.property('Line_description');
86
- expect(output).to.have.a.property('Interface_status');
87
- expect(output).to.have.a.property('Interface_type_of_service');
88
- expect(output).to.have.a.property('Interface_MTU');
89
- expect(output).to.have.a.property('Interface_line_type');
90
- expect(output).to.have.a.property('Host_address');
91
- expect(output).to.have.a.property('Host_address_binary');
92
- expect(output).to.have.a.property('Interface_subnet_mask');
93
- expect(output).to.have.a.property('Interface_subnet_mask_binary');
94
- expect(output).to.have.a.property('Directed_broadcast_address');
95
- expect(output).to.have.a.property('Directed_broadcast_address_binary');
96
- expect(output).to.have.a.property('Change_date');
97
- expect(output).to.have.a.property('Change_time');
98
- expect(output).to.have.a.property('Associated_local_interface');
99
- expect(output).to.have.a.property('Associated_local_interface_binary');
100
- expect(output).to.have.a.property('Packet_rules');
101
- expect(output).to.have.a.property('Change_status');
102
- expect(output).to.have.a.property('Automatic_start');
103
- expect(output).to.have.a.property('TRLAN_bit_sequencing');
104
- expect(output).to.have.a.property('Interface_type');
105
- expect(output).to.have.a.property('Proxy_ARP_allowed');
106
- expect(output).to.have.a.property('Proxy_ARP_enabled');
107
- expect(output).to.have.a.property('Configured_MTU');
108
- expect(output).to.have.a.property('Network_name');
109
- expect(output).to.have.a.property('Interface_name');
110
- expect(output).to.have.a.property('Alias_name');
111
- expect(output).to.have.a.property('Interface_description');
112
- expect(output).to.have.a.property('Offset_to_preferred_interface_list');
113
- expect(output).to.have.a.property('Number_of_entries_in_preferred_interface_list');
114
- expect(output).to.have.a.property('Length_of_one_preferred_interface_list_entry');
115
- expect(output).to.have.a.property('DHCP_created');
116
- expect(output).to.have.a.property('DHCP_dynamic_DNS_updates');
117
- expect(output).to.have.a.property('DHCP_lease_expiration');
118
- expect(output).to.have.a.property('DHCP_lease_expiration_-_date');
119
- expect(output).to.have.a.property('DHCP_lease_expiration_-_time');
120
- expect(output).to.have.a.property('DHCP_lease_obtained');
121
- expect(output).to.have.a.property('DHCP_lease_obtained_-_date');
122
- expect(output).to.have.a.property('DHCP_lease_obtained_-_time');
123
- expect(output).to.have.a.property('Use_DHCP_unique_identifier');
124
- expect(output).to.have.a.property('DHCP_server_IP_address');
125
- expect(output).to.have.a.property('Preferred_interface_Internet_address');
126
- expect(output).to.have.a.property('Preferred_interface_Internet_address_binary');
127
- done();
128
- });
129
- });
130
- });
131
- });