itoolkit 1.0.1 → 1.1.0-rc.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/README.md +6 -2
- package/lib/CommandCall.js +2 -16
- package/lib/Connection.js +2 -16
- package/lib/Deprecated.js +892 -895
- package/lib/ProgramCall.js +2 -16
- package/lib/itoolkit.js +2 -16
- package/lib/transports/httpTransport.js +2 -16
- package/lib/transports/idbTransport.js +2 -16
- package/lib/transports/odbcTransport.js +2 -16
- package/lib/transports/sshTransport.js +2 -16
- package/package.json +21 -10
- package/.eslintrc.js +0 -39
- package/.gitattributes +0 -2
- package/.readthedocs.yml +0 -16
- package/CHANGELOG.md +0 -228
- package/contributors.txt +0 -2
- package/test/README.md +0 -44
- package/test/functional/CommandCallFunctional.js +0 -87
- package/test/functional/ProgramCallFunctional.js +0 -106
- package/test/functional/checkObjectExists.js +0 -193
- package/test/functional/checkVersion.js +0 -17
- package/test/functional/config.js +0 -35
- package/test/functional/deprecated/commandsFunctional.js +0 -108
- package/test/functional/deprecated/iDataQueueFunctional.js +0 -103
- package/test/functional/deprecated/iNetworkFunctional.js +0 -159
- package/test/functional/deprecated/iObjFunctional.js +0 -349
- package/test/functional/deprecated/iPgmFunctional.js +0 -104
- package/test/functional/deprecated/iProdFunctional.js +0 -160
- package/test/functional/deprecated/iSqlFunctional.js +0 -453
- package/test/functional/deprecated/iUserSpaceFunctional.js +0 -138
- package/test/functional/deprecated/iWorkFunctional.js +0 -238
- package/test/functional/iDataQueueFunctional.js +0 -83
- package/test/functional/iNetworkFunctional.js +0 -131
- package/test/functional/iObjFunctional.js +0 -326
- package/test/functional/iProdFunctional.js +0 -134
- package/test/functional/iSqlFunctional.js +0 -448
- package/test/functional/iUserSpaceFunctional.js +0 -134
- package/test/functional/iWorkFunctional.js +0 -215
- package/test/unit/CommandCallUnit.js +0 -87
- package/test/unit/ConnectionUnit.js +0 -188
- package/test/unit/ProgamCallUnit.js +0 -281
- package/test/unit/deprecated/commandsUnit.js +0 -87
- package/test/unit/deprecated/iConnUnit.js +0 -158
- package/test/unit/deprecated/iPgmUnit.js +0 -211
- package/test/unit/deprecated/iSqlUnit.js +0 -441
- package/test/unit/deprecated/xmlToJsonUnit.js +0 -200
|
@@ -1,159 +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, iNetwork } = 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
|
-
describe('iNetwork Functional Tests', function () {
|
|
45
|
-
before(function () {
|
|
46
|
-
printConfig();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
describe('constructor', function () {
|
|
50
|
-
it('creates and returns an instance of iNetwork', function () {
|
|
51
|
-
const connection = new iConn(database, config.user, password);
|
|
52
|
-
|
|
53
|
-
const net = new iNetwork(connection);
|
|
54
|
-
|
|
55
|
-
expect(net).to.be.instanceOf(iNetwork);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe('getTCPIPAttr', function () {
|
|
60
|
-
it('retrieves TCP/IP Attributes', function (done) {
|
|
61
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
62
|
-
|
|
63
|
-
const net = new iNetwork(connection);
|
|
64
|
-
|
|
65
|
-
net.getTCPIPAttr((output) => {
|
|
66
|
-
expect(output).to.be.an('Object');
|
|
67
|
-
expect(output).to.have.a.property('TCP/IPv4_stack_status');
|
|
68
|
-
expect(output).to.have.a.property('How_long_active');
|
|
69
|
-
expect(output).to.have.a.property('When_last_started_-_date');
|
|
70
|
-
expect(output).to.have.a.property('When_last_started_-_time');
|
|
71
|
-
expect(output).to.have.a.property('When_last_ended_-_date');
|
|
72
|
-
expect(output).to.have.a.property('When_last_ended_-_time');
|
|
73
|
-
expect(output).to.have.a.property('Who_last_started_-_job_name');
|
|
74
|
-
expect(output).to.have.a.property('Who_last_started_-_job_user_name');
|
|
75
|
-
expect(output).to.have.a.property('Who_last_started_-_job_number');
|
|
76
|
-
expect(output).to.have.a.property('Who_last_started_-_internal_job_identifier');
|
|
77
|
-
expect(output).to.have.a.property('Who_last_ended_-_job_name');
|
|
78
|
-
expect(output).to.have.a.property('Who_last_ended_-_job_user_name');
|
|
79
|
-
expect(output).to.have.a.property('Who_last_ended_-_job_number');
|
|
80
|
-
expect(output).to.have.a.property('Who_last_ended_-_internal_job_identifier');
|
|
81
|
-
expect(output).to.have.a.property('Offset_to_additional_information');
|
|
82
|
-
expect(output).to.have.a.property('Length_of_additional_information');
|
|
83
|
-
expect(output).to.have.a.property('Limited_mode');
|
|
84
|
-
expect(output).to.have.a.property('Offset_to_list_of_Internet_addresses');
|
|
85
|
-
expect(output).to.have.a.property('Number_of_Internet_addresses');
|
|
86
|
-
expect(output).to.have.a.property('Entry_length_for_list_of_Internet_addresses');
|
|
87
|
-
expect(output).to.have.a.property('DNS_protocol');
|
|
88
|
-
expect(output).to.have.a.property('Retries');
|
|
89
|
-
expect(output).to.have.a.property('Time_interval');
|
|
90
|
-
expect(output).to.have.a.property('Search_order');
|
|
91
|
-
expect(output).to.have.a.property('Initial_domain_name_server');
|
|
92
|
-
expect(output).to.have.a.property('DNS_listening_port');
|
|
93
|
-
expect(output).to.have.a.property('Host_name');
|
|
94
|
-
expect(output).to.have.a.property('Domain_name');
|
|
95
|
-
expect(output).to.have.a.property('Domain_search_list');
|
|
96
|
-
done();
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
describe('getNetInterfaceData', function () {
|
|
102
|
-
it('retrieves IPv4 network interface info', function (done) {
|
|
103
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
104
|
-
|
|
105
|
-
const net = new iNetwork(connection);
|
|
106
|
-
|
|
107
|
-
net.getNetInterfaceData('127.0.0.1', (output) => {
|
|
108
|
-
expect(output).to.be.an('Object');
|
|
109
|
-
expect(output).to.have.a.property('Internet_address');
|
|
110
|
-
expect(output).to.have.a.property('Internet_address_binary');
|
|
111
|
-
expect(output).to.have.a.property('Network_address');
|
|
112
|
-
expect(output).to.have.a.property('Network_address_binary');
|
|
113
|
-
expect(output).to.have.a.property('Line_description');
|
|
114
|
-
expect(output).to.have.a.property('Interface_status');
|
|
115
|
-
expect(output).to.have.a.property('Interface_type_of_service');
|
|
116
|
-
expect(output).to.have.a.property('Interface_MTU');
|
|
117
|
-
expect(output).to.have.a.property('Interface_line_type');
|
|
118
|
-
expect(output).to.have.a.property('Host_address');
|
|
119
|
-
expect(output).to.have.a.property('Host_address_binary');
|
|
120
|
-
expect(output).to.have.a.property('Interface_subnet_mask');
|
|
121
|
-
expect(output).to.have.a.property('Interface_subnet_mask_binary');
|
|
122
|
-
expect(output).to.have.a.property('Directed_broadcast_address');
|
|
123
|
-
expect(output).to.have.a.property('Directed_broadcast_address_binary');
|
|
124
|
-
expect(output).to.have.a.property('Change_date');
|
|
125
|
-
expect(output).to.have.a.property('Change_time');
|
|
126
|
-
expect(output).to.have.a.property('Associated_local_interface');
|
|
127
|
-
expect(output).to.have.a.property('Associated_local_interface_binary');
|
|
128
|
-
expect(output).to.have.a.property('Packet_rules');
|
|
129
|
-
expect(output).to.have.a.property('Change_status');
|
|
130
|
-
expect(output).to.have.a.property('Automatic_start');
|
|
131
|
-
expect(output).to.have.a.property('TRLAN_bit_sequencing');
|
|
132
|
-
expect(output).to.have.a.property('Interface_type');
|
|
133
|
-
expect(output).to.have.a.property('Proxy_ARP_allowed');
|
|
134
|
-
expect(output).to.have.a.property('Proxy_ARP_enabled');
|
|
135
|
-
expect(output).to.have.a.property('Configured_MTU');
|
|
136
|
-
expect(output).to.have.a.property('Network_name');
|
|
137
|
-
expect(output).to.have.a.property('Interface_name');
|
|
138
|
-
expect(output).to.have.a.property('Alias_name');
|
|
139
|
-
expect(output).to.have.a.property('Interface_description');
|
|
140
|
-
expect(output).to.have.a.property('Offset_to_preferred_interface_list');
|
|
141
|
-
expect(output).to.have.a.property('Number_of_entries_in_preferred_interface_list');
|
|
142
|
-
expect(output).to.have.a.property('Length_of_one_preferred_interface_list_entry');
|
|
143
|
-
expect(output).to.have.a.property('DHCP_created');
|
|
144
|
-
expect(output).to.have.a.property('DHCP_dynamic_DNS_updates');
|
|
145
|
-
expect(output).to.have.a.property('DHCP_lease_expiration');
|
|
146
|
-
expect(output).to.have.a.property('DHCP_lease_expiration_-_date');
|
|
147
|
-
expect(output).to.have.a.property('DHCP_lease_expiration_-_time');
|
|
148
|
-
expect(output).to.have.a.property('DHCP_lease_obtained');
|
|
149
|
-
expect(output).to.have.a.property('DHCP_lease_obtained_-_date');
|
|
150
|
-
expect(output).to.have.a.property('DHCP_lease_obtained_-_time');
|
|
151
|
-
expect(output).to.have.a.property('Use_DHCP_unique_identifier');
|
|
152
|
-
expect(output).to.have.a.property('DHCP_server_IP_address');
|
|
153
|
-
expect(output).to.have.a.property('Preferred_interface_Internet_address');
|
|
154
|
-
expect(output).to.have.a.property('Preferred_interface_Internet_address_binary');
|
|
155
|
-
done();
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
});
|
|
@@ -1,349 +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, iObj } = 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
|
-
describe('iObj Functional Tests', function () {
|
|
45
|
-
before(function () {
|
|
46
|
-
printConfig();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
describe('constructor', function () {
|
|
50
|
-
it('creates and returns an instance of iObj', function () {
|
|
51
|
-
const connection = new iConn(database, config.user, password);
|
|
52
|
-
|
|
53
|
-
const obj = new iObj(connection);
|
|
54
|
-
|
|
55
|
-
expect(obj).to.be.instanceOf(iObj);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe('retrUsrAuth', function () {
|
|
60
|
-
it(`returns uses's authority for an object using ${config.transport} tranport`, function (done) {
|
|
61
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
62
|
-
|
|
63
|
-
const obj = new iObj(connection);
|
|
64
|
-
|
|
65
|
-
obj.retrUsrAuth('*PUBLIC', '*PGM', 'XMLCGI', 'QXMLSERV', (output) => {
|
|
66
|
-
expect(output).to.be.an('Object');
|
|
67
|
-
expect(output).to.have.a.property('Object_authority_/_Data_authority');
|
|
68
|
-
expect(output).to.have.a.property('Authorization_list_management');
|
|
69
|
-
expect(output).to.have.a.property('Object_operational');
|
|
70
|
-
expect(output).to.have.a.property('Object_management');
|
|
71
|
-
expect(output).to.have.a.property('Object_existence');
|
|
72
|
-
expect(output).to.have.a.property('Data_read');
|
|
73
|
-
expect(output).to.have.a.property('Data_add');
|
|
74
|
-
expect(output).to.have.a.property('Data_update');
|
|
75
|
-
expect(output).to.have.a.property('Data_delete');
|
|
76
|
-
expect(output).to.have.a.property('Authorization_list');
|
|
77
|
-
expect(output).to.have.a.property('Authority_source');
|
|
78
|
-
expect(output).to.have.a.property('Some_adopted_authority');
|
|
79
|
-
expect(output).to.have.a.property('Adopted_object_authority');
|
|
80
|
-
expect(output).to.have.a.property('Adopted_authorization_list_management');
|
|
81
|
-
expect(output).to.have.a.property('Adopted_object_operational');
|
|
82
|
-
expect(output).to.have.a.property('Adopted_object_management');
|
|
83
|
-
expect(output).to.have.a.property('Adopted_object_existence');
|
|
84
|
-
expect(output).to.have.a.property('Adopted_data_read');
|
|
85
|
-
expect(output).to.have.a.property('Adopted_data_add');
|
|
86
|
-
expect(output).to.have.a.property('Adopted_data_update');
|
|
87
|
-
expect(output).to.have.a.property('Adopted_data_delete');
|
|
88
|
-
expect(output).to.have.a.property('Adopted_data_execute');
|
|
89
|
-
expect(output).to.have.a.property('Adopted_object_alter');
|
|
90
|
-
expect(output).to.have.a.property('Adopted_object_reference');
|
|
91
|
-
expect(output).to.have.a.property('Data_execute');
|
|
92
|
-
expect(output).to.have.a.property('Object_alter');
|
|
93
|
-
expect(output).to.have.a.property('Object_reference');
|
|
94
|
-
expect(output).to.have.a.property('ASP_device_name_of_library');
|
|
95
|
-
expect(output).to.have.a.property('ASP_device_name_of_object');
|
|
96
|
-
expect(output).to.have.a.property('Offset_to_group_information_table');
|
|
97
|
-
expect(output).to.have.a.property('Number_of_group_table_entries_returned');
|
|
98
|
-
done();
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
describe('rtrCmdInfo', function () {
|
|
104
|
-
it('returns command info', function (done) {
|
|
105
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
106
|
-
|
|
107
|
-
const obj = new iObj(connection);
|
|
108
|
-
|
|
109
|
-
obj.retrCmdInfo('CRTLIB', '*LIBL', (output) => {
|
|
110
|
-
expect(output).to.be.an('Object');
|
|
111
|
-
expect(output).to.have.a.property('Command_name');
|
|
112
|
-
expect(output).to.have.a.property('Command_library_name');
|
|
113
|
-
expect(output).to.have.a.property('Command_processing_program_or_proxy_target_command');
|
|
114
|
-
expect(output).to.have.a.property('Command_processing_program\'s_or_proxy_target_command\'s_library_name');
|
|
115
|
-
expect(output).to.have.a.property('Source_file_name');
|
|
116
|
-
expect(output).to.have.a.property('Source_file_library_name');
|
|
117
|
-
expect(output).to.have.a.property('Source_file_member_name');
|
|
118
|
-
expect(output).to.have.a.property('Validity_check_program_name');
|
|
119
|
-
expect(output).to.have.a.property('Validity_check_program_library_name');
|
|
120
|
-
expect(output).to.have.a.property('Mode_information');
|
|
121
|
-
expect(output).to.have.a.property('Where_allowed_to_run');
|
|
122
|
-
expect(output).to.have.a.property('Allow_limited_user');
|
|
123
|
-
expect(output).to.have.a.property('Maximum_positional_parameters');
|
|
124
|
-
expect(output).to.have.a.property('Prompt_message_file_name');
|
|
125
|
-
expect(output).to.have.a.property('Prompt_message_file_library_name');
|
|
126
|
-
expect(output).to.have.a.property('Message_file_name');
|
|
127
|
-
expect(output).to.have.a.property('Message_file_library_name');
|
|
128
|
-
expect(output).to.have.a.property('Help_panel_group_name');
|
|
129
|
-
expect(output).to.have.a.property('Help_panel_group_library_name');
|
|
130
|
-
expect(output).to.have.a.property('Help_identifier');
|
|
131
|
-
expect(output).to.have.a.property('Search_index_name');
|
|
132
|
-
expect(output).to.have.a.property('Search_index_library_name');
|
|
133
|
-
expect(output).to.have.a.property('Current_library');
|
|
134
|
-
expect(output).to.have.a.property('Product_library');
|
|
135
|
-
expect(output).to.have.a.property('Prompt_override_program_name');
|
|
136
|
-
expect(output).to.have.a.property('Prompt_override_program_library_name');
|
|
137
|
-
expect(output).to.have.a.property('Restricted_to_target_release');
|
|
138
|
-
expect(output).to.have.a.property('Text_description');
|
|
139
|
-
expect(output).to.have.a.property('Command_processing_program_call_state');
|
|
140
|
-
expect(output).to.have.a.property('Validity_check_program_call_state');
|
|
141
|
-
expect(output).to.have.a.property('Prompt_override_program_call_state');
|
|
142
|
-
expect(output).to.have.a.property('Offset_to_help_bookshelf_information');
|
|
143
|
-
expect(output).to.have.a.property('Length_of_help_bookshelf_information');
|
|
144
|
-
expect(output).to.have.a.property('Coded_character_set_ID_(CCSID)');
|
|
145
|
-
expect(output).to.have.a.property('Enabled_for_GUI_indicator');
|
|
146
|
-
expect(output).to.have.a.property('Threadsafe_indicator');
|
|
147
|
-
expect(output).to.have.a.property('Multithreaded_job_action');
|
|
148
|
-
expect(output).to.have.a.property('Proxy_command_indicator');
|
|
149
|
-
expect(output).to.have.a.property('Prompt_message_file_text_indicator');
|
|
150
|
-
done();
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
describe('retrPgmInfo', function () {
|
|
156
|
-
it('returns program info', function (done) {
|
|
157
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
158
|
-
|
|
159
|
-
const obj = new iObj(connection);
|
|
160
|
-
|
|
161
|
-
obj.retrPgmInfo('XMLCGI', 'QXMLSERV', (output) => {
|
|
162
|
-
expect(output).to.be.an('Object');
|
|
163
|
-
expect(output).to.have.a.property('Program_name');
|
|
164
|
-
expect(output).to.have.a.property('Program_library_name');
|
|
165
|
-
expect(output).to.have.a.property('Program_owner');
|
|
166
|
-
expect(output).to.have.a.property('Program_attribute');
|
|
167
|
-
expect(output).to.have.a.property('Creation_date_and_time');
|
|
168
|
-
expect(output).to.have.a.property('Source_file_name');
|
|
169
|
-
expect(output).to.have.a.property('Source_file_library_name');
|
|
170
|
-
expect(output).to.have.a.property('Source_file_member_name');
|
|
171
|
-
expect(output).to.have.a.property('Source_file_updated_date_and_time');
|
|
172
|
-
expect(output).to.have.a.property('Observable_information');
|
|
173
|
-
expect(output).to.have.a.property('User_profile_option');
|
|
174
|
-
expect(output).to.have.a.property('Use_adopted_authority');
|
|
175
|
-
expect(output).to.have.a.property('Log_commands');
|
|
176
|
-
expect(output).to.have.a.property('Allow_RTVCLSRC');
|
|
177
|
-
expect(output).to.have.a.property('Fix_decimal_data');
|
|
178
|
-
expect(output).to.have.a.property('Text_description');
|
|
179
|
-
expect(output).to.have.a.property('Type_of_program');
|
|
180
|
-
expect(output).to.have.a.property('Teraspace_storage-enabled_program');
|
|
181
|
-
expect(output).to.have.a.property('Minimum_number_of_parameters');
|
|
182
|
-
expect(output).to.have.a.property('Maximum_number_of_parameters');
|
|
183
|
-
expect(output).to.have.a.property('Program_size');
|
|
184
|
-
expect(output).to.have.a.property('Associated_space_size');
|
|
185
|
-
expect(output).to.have.a.property('Static_storage_size');
|
|
186
|
-
expect(output).to.have.a.property('Automatic_storage_size');
|
|
187
|
-
expect(output).to.have.a.property('Number_of_MI_instructions');
|
|
188
|
-
expect(output).to.have.a.property('Number_of_MI_ODT_entries');
|
|
189
|
-
expect(output).to.have.a.property('Program_state');
|
|
190
|
-
expect(output).to.have.a.property('Compiler_identification');
|
|
191
|
-
expect(output).to.have.a.property('Earliest_release_program_can_run');
|
|
192
|
-
expect(output).to.have.a.property('Sort_sequence_table_name');
|
|
193
|
-
expect(output).to.have.a.property('Sort_sequence_table_library_name');
|
|
194
|
-
expect(output).to.have.a.property('Language_identifier');
|
|
195
|
-
expect(output).to.have.a.property('Program_domain');
|
|
196
|
-
expect(output).to.have.a.property('Conversion_required');
|
|
197
|
-
expect(output).to.have.a.property('Conversion_details');
|
|
198
|
-
expect(output).to.have.a.property('Optimization');
|
|
199
|
-
expect(output).to.have.a.property('Paging_pool');
|
|
200
|
-
expect(output).to.have.a.property('Update_program_automatic_storage_area_(PASA)');
|
|
201
|
-
expect(output).to.have.a.property('Clear_program_automatic_storage_area_(PASA)');
|
|
202
|
-
expect(output).to.have.a.property('Paging_amount');
|
|
203
|
-
expect(output).to.have.a.property('Program_entry_procedure_module');
|
|
204
|
-
expect(output).to.have.a.property('Program_entry_procedure_module_library');
|
|
205
|
-
expect(output).to.have.a.property('Activation_group_attribute');
|
|
206
|
-
expect(output).to.have.a.property('Observable_information_compressed');
|
|
207
|
-
expect(output).to.have.a.property('Run-time_information_compressed');
|
|
208
|
-
expect(output).to.have.a.property('Release_program_created_on');
|
|
209
|
-
expect(output).to.have.a.property('Shared_activation_group');
|
|
210
|
-
expect(output).to.have.a.property('Allow_update');
|
|
211
|
-
expect(output).to.have.a.property('Program_CCSID');
|
|
212
|
-
expect(output).to.have.a.property('Number_of_modules');
|
|
213
|
-
expect(output).to.have.a.property('Number_of_service_programs');
|
|
214
|
-
expect(output).to.have.a.property('Number_of_copyrights');
|
|
215
|
-
expect(output).to.have.a.property('Number_of_unresolved_references');
|
|
216
|
-
expect(output).to.have.a.property('Release_program_created_for');
|
|
217
|
-
expect(output).to.have.a.property('Allow_static_storage_reinitialization');
|
|
218
|
-
expect(output).to.have.a.property('All_creation_data');
|
|
219
|
-
expect(output).to.have.a.property('Allow_bound_*SRVPGM_library_name_update');
|
|
220
|
-
expect(output).to.have.a.property('Profiling_data');
|
|
221
|
-
expect(output).to.have.a.property('Teraspace_storage_enabled_modules');
|
|
222
|
-
expect(output).to.have.a.property('Storage_model');
|
|
223
|
-
expect(output).to.have.a.property('Uses_argument_optimization_(ARGOPT)');
|
|
224
|
-
done();
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
describe('retrSrvPgmInfo', function () {
|
|
230
|
-
it('returns service program info', function (done) {
|
|
231
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
232
|
-
|
|
233
|
-
const obj = new iObj(connection);
|
|
234
|
-
|
|
235
|
-
obj.retrSrvPgmInfo('QZSRVSSL', 'QHTTPSVR', (output) => {
|
|
236
|
-
expect(output).to.be.an('Object');
|
|
237
|
-
expect(output).to.have.a.property('Service_program_name');
|
|
238
|
-
expect(output).to.have.a.property('Service_program_name');
|
|
239
|
-
expect(output).to.have.a.property('Service_program_owner');
|
|
240
|
-
expect(output).to.have.a.property('Service_program_attribute');
|
|
241
|
-
expect(output).to.have.a.property('Creation_date_and_time');
|
|
242
|
-
expect(output).to.have.a.property('Export_source_file_name');
|
|
243
|
-
expect(output).to.have.a.property('Export_source_file_library_name');
|
|
244
|
-
expect(output).to.have.a.property('Export_source_file_member_name');
|
|
245
|
-
expect(output).to.have.a.property('Activation_group_attribute');
|
|
246
|
-
expect(output).to.have.a.property('Current_export_signature');
|
|
247
|
-
expect(output).to.have.a.property('User_profile');
|
|
248
|
-
expect(output).to.have.a.property('Observable_information_compressed');
|
|
249
|
-
expect(output).to.have.a.property('Run-time_information_compressed');
|
|
250
|
-
expect(output).to.have.a.property('Run-time_information_compressed');
|
|
251
|
-
expect(output).to.have.a.property('Service_program_CCSID');
|
|
252
|
-
expect(output).to.have.a.property('Number_of_modules');
|
|
253
|
-
expect(output).to.have.a.property('Number_of_service_programs');
|
|
254
|
-
expect(output).to.have.a.property('Number_of_copyrights');
|
|
255
|
-
expect(output).to.have.a.property('Text_description');
|
|
256
|
-
expect(output).to.have.a.property('Shared_activation_group');
|
|
257
|
-
expect(output).to.have.a.property('Allow_update');
|
|
258
|
-
expect(output).to.have.a.property('Number_of_unresolved_references');
|
|
259
|
-
expect(output).to.have.a.property('Use_adopted_authority');
|
|
260
|
-
expect(output).to.have.a.property('Allow_bound_*SRVPGM_library_name_update');
|
|
261
|
-
expect(output).to.have.a.property('Profiling_data');
|
|
262
|
-
expect(output).to.have.a.property('Teraspace_storage_enabled_modules');
|
|
263
|
-
expect(output).to.have.a.property('Storage_model');
|
|
264
|
-
expect(output).to.have.a.property('Uses_argument_optimization_(ARGOPT)');
|
|
265
|
-
expect(output).to.have.a.property('Service_program_state');
|
|
266
|
-
expect(output).to.have.a.property('Service_program_domain');
|
|
267
|
-
expect(output).to.have.a.property('Associated_space_size');
|
|
268
|
-
expect(output).to.have.a.property('Static_storage_size');
|
|
269
|
-
expect(output).to.have.a.property('Service_program_size');
|
|
270
|
-
expect(output).to.have.a.property('Release_service_program_created_on');
|
|
271
|
-
expect(output).to.have.a.property('Earliest_release_service_program_can_run');
|
|
272
|
-
expect(output).to.have.a.property('Release_service_program_created_for');
|
|
273
|
-
expect(output).to.have.a.property('Allow_static_storage_reinitialization');
|
|
274
|
-
expect(output).to.have.a.property('Conversion_required');
|
|
275
|
-
expect(output).to.have.a.property('All_creation_data');
|
|
276
|
-
expect(output).to.have.a.property('Conversion_details');
|
|
277
|
-
expect(output).to.have.a.property('Paging_pool');
|
|
278
|
-
expect(output).to.have.a.property('Paging_amount');
|
|
279
|
-
done();
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
describe('retrUserInfo', function () {
|
|
285
|
-
it('returns specified user profile info', function (done) {
|
|
286
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
287
|
-
|
|
288
|
-
const obj = new iObj(connection);
|
|
289
|
-
|
|
290
|
-
obj.retrUserInfo('QSYS', (output) => {
|
|
291
|
-
expect(output).to.be.an('Object');
|
|
292
|
-
expect(output).to.have.a.property('User_profile_name');
|
|
293
|
-
expect(output).to.have.a.property('Previous_sign-on_date_and_time');
|
|
294
|
-
expect(output).to.have.a.property('Sign-on_attempts_not_valid');
|
|
295
|
-
expect(output).to.have.a.property('Status');
|
|
296
|
-
expect(output).to.have.a.property('Password_change_date');
|
|
297
|
-
expect(output).to.have.a.property('No_password_indicator');
|
|
298
|
-
expect(output).to.have.a.property('Password_expiration_interval');
|
|
299
|
-
expect(output).to.have.a.property('Date_password_expires');
|
|
300
|
-
expect(output).to.have.a.property('Days_until_password_expires');
|
|
301
|
-
expect(output).to.have.a.property('Set_password_to_expire');
|
|
302
|
-
expect(output).to.have.a.property('Display_sign-on_information');
|
|
303
|
-
expect(output).to.have.a.property('Local_password_management');
|
|
304
|
-
expect(output).to.have.a.property('Block_password_change');
|
|
305
|
-
done();
|
|
306
|
-
});
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
describe('retrUsrAuthToObj', function () {
|
|
311
|
-
it(`retrieves info for users who are authorized to an object using ${config.transport} transpsort`, function (done) {
|
|
312
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
313
|
-
|
|
314
|
-
const obj = new iObj(connection);
|
|
315
|
-
|
|
316
|
-
obj.retrUserAuthToObj('/home', (output) => {
|
|
317
|
-
expect(output).to.be.an('Object');
|
|
318
|
-
expect(output).to.have.a.property('Profile_name');
|
|
319
|
-
expect(output).to.have.a.property('User_or_group_indicator');
|
|
320
|
-
expect(output).to.have.a.property('Data_authority');
|
|
321
|
-
expect(output).to.have.a.property('Authorization_list_management');
|
|
322
|
-
expect(output).to.have.a.property('Object_management');
|
|
323
|
-
expect(output).to.have.a.property('Object_existence');
|
|
324
|
-
expect(output).to.have.a.property('Object_alter');
|
|
325
|
-
expect(output).to.have.a.property('Object_reference');
|
|
326
|
-
expect(output).to.have.a.property('Object_operational');
|
|
327
|
-
expect(output).to.have.a.property('Data_read');
|
|
328
|
-
expect(output).to.have.a.property('Data_add');
|
|
329
|
-
expect(output).to.have.a.property('Data_update');
|
|
330
|
-
expect(output).to.have.a.property('Data_delete');
|
|
331
|
-
expect(output).to.have.a.property('Data_execute');
|
|
332
|
-
done();
|
|
333
|
-
});
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
describe('addToLibraryList', function () {
|
|
338
|
-
it('appends lib to user\'s lib list', function (done) {
|
|
339
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
340
|
-
|
|
341
|
-
const obj = new iObj(connection);
|
|
342
|
-
|
|
343
|
-
obj.addToLibraryList('QHTTPSVR', (output) => {
|
|
344
|
-
expect(output).to.be.a('boolean').and.to.equal(true);
|
|
345
|
-
done();
|
|
346
|
-
});
|
|
347
|
-
});
|
|
348
|
-
});
|
|
349
|
-
});
|
|
@@ -1,104 +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 { parseString } = require('xml2js');
|
|
22
|
-
const { iPgm, iConn } = require('../../../lib/itoolkit');
|
|
23
|
-
const { config, printConfig } = require('../config');
|
|
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('iPgm Functional Tests', function () {
|
|
46
|
-
before(function () {
|
|
47
|
-
printConfig();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
describe('addParam', function () {
|
|
51
|
-
it('calls QWCRSVAL program checks if it ran successfully', function (done) {
|
|
52
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
53
|
-
|
|
54
|
-
const program = new iPgm('QWCRSVAL', { lib: 'QSYS' });
|
|
55
|
-
|
|
56
|
-
const outBuf = [
|
|
57
|
-
[0, '10i0'],
|
|
58
|
-
[0, '10i0'],
|
|
59
|
-
['', '36h'],
|
|
60
|
-
['', '10A'],
|
|
61
|
-
['', '1A'],
|
|
62
|
-
['', '1A'],
|
|
63
|
-
[0, '10i0'],
|
|
64
|
-
[0, '10i0'],
|
|
65
|
-
];
|
|
66
|
-
program.addParam(outBuf, { io: 'out' });
|
|
67
|
-
program.addParam(66, '10i0');
|
|
68
|
-
program.addParam(1, '10i0');
|
|
69
|
-
program.addParam('QCCSID', '10A');
|
|
70
|
-
program.addParam(this.errno, { io: 'both', len: 'rec2' });
|
|
71
|
-
connection.add(program);
|
|
72
|
-
connection.run((xmlOut) => {
|
|
73
|
-
parseString(xmlOut, (parseError, result) => {
|
|
74
|
-
expect(parseError).to.equal(null);
|
|
75
|
-
expect(result.myscript.pgm[0].success[0]).to.include('+++ success QSYS QWCRSVAL');
|
|
76
|
-
done();
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
describe.skip('addReturn', function () {
|
|
83
|
-
// ZZSRV6 program requires XMLSERVICE built with tests
|
|
84
|
-
// Skip for now, we need to add before hook to check if ZZSRV6 is available
|
|
85
|
-
it.skip('calls ZZVARY4 and checks the return value', function (done) {
|
|
86
|
-
const connection = new iConn(database, username, password, restOptions);
|
|
87
|
-
|
|
88
|
-
const program = new iPgm('ZZSRV6', { lib: 'XMLSERVICE', func: 'ZZVARY4' });
|
|
89
|
-
|
|
90
|
-
program.addParam('Gill', '10A', { varying: '4' });
|
|
91
|
-
const testValue = 'NEW_NAME';
|
|
92
|
-
program.addReturn('0', '20A', { varying: '4', name: testValue });
|
|
93
|
-
connection.add(program);
|
|
94
|
-
connection.run((xmlOut) => {
|
|
95
|
-
parseString(xmlOut, (parseError, result) => {
|
|
96
|
-
expect(parseError).to.equal(null);
|
|
97
|
-
expect(result.myscript.pgm[0].success[0]).to.include('+++ success');
|
|
98
|
-
expect(result.myscript.pgm[0].return[0].data[0]._).to.equal('my name is Gill');
|
|
99
|
-
done();
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|