@@ -114,8 +114,8 @@ describe("BundlePusher01", () => {
114
114
lstatSpy = jest . spyOn ( fs , "lstatSync" ) . mockImplementation ( ( ) => ( IS_NOT_DIRECTORY ) ) ;
115
115
cmciSpy = jest . spyOn ( cmci , "getResource" ) . mockImplementation ( ( ) => ( { response : { records : { } } } ) ) ;
116
116
consoleText = "" ;
117
- zosmfProfile = { } ;
118
- sshProfile = { } ;
117
+ zosmfProfile = { host : "testhost" , user : "testuser" } ;
118
+ sshProfile = { host : "testhost" , user : "testuser" } ;
119
119
cicsProfile = undefined ;
120
120
} ) ;
121
121
afterEach ( ( ) => {
@@ -210,29 +210,27 @@ describe("BundlePusher01", () => {
210
210
expect ( sshSpy ) . toHaveBeenCalledTimes ( 1 ) ;
211
211
} ) ;
212
212
it ( "should complain with mismatching zOSMF and SSH profile host names" , async ( ) => {
213
- zosmfProfile = { host : "wibble" } ;
214
- sshProfile = { host : "wobble" } ;
213
+ zosmfProfile = { host : "wibble" , user : "user" } ;
214
+ sshProfile = { host : "wobble" , user : "user" } ;
215
215
216
216
await runPushTest ( "__tests__/__resources__/ExampleBundle01" , true ,
217
217
"PUSH operation completed." ) ;
218
218
expect ( consoleText ) . toContain ( "WARNING: ssh profile --host value 'wobble' does not match zosmf value 'wibble'." ) ;
219
219
} ) ;
220
220
it ( "should not complain with matching zOSMF and SSH profile host names" , async ( ) => {
221
- zosmfProfile = { host : "wibble" } ;
222
- sshProfile = { host : "wibble" } ;
221
+ zosmfProfile = { host : "wibble" , user : "user" } ;
222
+ sshProfile = { host : "wibble" , user : "user" } ;
223
223
224
224
await runPushTest ( "__tests__/__resources__/ExampleBundle01" , true ,
225
225
"PUSH operation completed." ) ;
226
226
expect ( consoleText ) . not . toContain ( "WARNING: ssh profile" ) ;
227
227
} ) ;
228
228
it ( "should complain with mismatching zOSMF and CICS profile host names" , async ( ) => {
229
- zosmfProfile = { host : "wibble" } ;
230
- sshProfile = { host : "wibble" } ;
231
- cicsProfile = { host : "wobble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
229
+ cicsProfile = { host : "wibble" , user : "testuser" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
232
230
233
231
await runPushTest ( "__tests__/__resources__/ExampleBundle01" , true ,
234
232
"PUSH operation completed." ) ;
235
- expect ( consoleText ) . toContain ( "WARNING: cics profile --host value 'wobble ' does not match zosmf value 'wibble '." ) ;
233
+ expect ( consoleText ) . toContain ( "WARNING: cics profile --host value 'wibble ' does not match zosmf value 'testhost '." ) ;
236
234
} ) ;
237
235
it ( "should not complain with matching zOSMF and CICS profile host names" , async ( ) => {
238
236
zosmfProfile = { host : "wibble" , user : "user" } ;
@@ -259,6 +257,14 @@ describe("BundlePusher01", () => {
259
257
"PUSH operation completed." ) ;
260
258
expect ( consoleText ) . not . toContain ( "WARNING: ssh profile" ) ;
261
259
} ) ;
260
+ it ( "should not complain with matching zOSMF and SSH profile user names - case" , async ( ) => {
261
+ zosmfProfile = { host : "wibble" , user : "fred" } ;
262
+ sshProfile = { host : "wibble" , user : "FRED" } ;
263
+
264
+ await runPushTest ( "__tests__/__resources__/ExampleBundle01" , true ,
265
+ "PUSH operation completed." ) ;
266
+ expect ( consoleText ) . not . toContain ( "WARNING: ssh profile" ) ;
267
+ } ) ;
262
268
it ( "should complain with mismatching zOSMF and CICS profile user names" , async ( ) => {
263
269
zosmfProfile = { host : "wibble" , user : "fred" } ;
264
270
sshProfile = { host : "wibble" , user : "fred" } ;
@@ -1043,6 +1049,13 @@ describe("BundlePusher01", () => {
1043
1049
zosmfProfile = { host : "wibble" , user : "user" } ;
1044
1050
sshProfile = { host : "wibble" , user : "user" } ;
1045
1051
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" } ;
1052
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1053
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1054
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1055
+ "<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/WIBBLE\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1056
+ "</manifest>" ;
1057
+ }
1058
+ } ) ;
1046
1059
cmciSpy . mockImplementation ( ( cicsSession : any , regionData : cmci . IResourceParms ) => {
1047
1060
if ( regionData . name === "CICSRegion" ) {
1048
1061
return { response : {
@@ -1112,7 +1125,14 @@ describe("BundlePusher01", () => {
1112
1125
sshProfile = { host : "wibble" , user : "user" } ;
1113
1126
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" } ;
1114
1127
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1115
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2055I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1128
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2055I" } ] ) ;
1129
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1130
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1131
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1132
+ "<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1133
+ "</manifest>" ;
1134
+ }
1135
+ } ) ;
1116
1136
cmciSpy . mockImplementation ( ( cicsSession : any , regionData : cmci . IResourceParms ) => {
1117
1137
if ( regionData . name === "CICSRegion" ) {
1118
1138
return { response : {
@@ -1186,7 +1206,14 @@ describe("BundlePusher01", () => {
1186
1206
sshProfile = { host : "wibble" , user : "user" } ;
1187
1207
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1188
1208
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1189
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1209
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1210
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1211
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1212
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1213
+ "<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1214
+ "</manifest>" ;
1215
+ }
1216
+ } ) ;
1190
1217
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1191
1218
if ( nodejsData . name === "CICSNodejsapp" ) {
1192
1219
throw new Error ( "Injected CMCI GET error" ) ;
@@ -1226,7 +1253,14 @@ describe("BundlePusher01", () => {
1226
1253
sshProfile = { host : "wibble" , user : "user" } ;
1227
1254
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1228
1255
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1229
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1256
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1257
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1258
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1259
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1260
+ "<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1261
+ "</manifest>" ;
1262
+ }
1263
+ } ) ;
1230
1264
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1231
1265
if ( nodejsData . name === "CICSNodejsapp" ) {
1232
1266
return { } ;
@@ -1266,7 +1300,14 @@ describe("BundlePusher01", () => {
1266
1300
sshProfile = { host : "wibble" , user : "user" } ;
1267
1301
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1268
1302
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1269
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1303
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1304
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1305
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1306
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1307
+ "<define name=\"name\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1308
+ "</manifest>" ;
1309
+ }
1310
+ } ) ;
1270
1311
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1271
1312
if ( nodejsData . name === "CICSNodejsapp" ) {
1272
1313
return { response : {
@@ -1318,7 +1359,14 @@ describe("BundlePusher01", () => {
1318
1359
sshProfile = { host : "wibble" , user : "user" } ;
1319
1360
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1320
1361
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1321
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1362
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1363
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1364
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1365
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1366
+ "<define name=\"name\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1367
+ "</manifest>" ;
1368
+ }
1369
+ } ) ;
1322
1370
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1323
1371
if ( nodejsData . name === "CICSNodejsapp" ) {
1324
1372
return { response : {
@@ -1370,7 +1418,15 @@ describe("BundlePusher01", () => {
1370
1418
sshProfile = { host : "wibble" , user : "user" } ;
1371
1419
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1372
1420
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1373
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1421
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1422
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1423
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1424
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1425
+ "<define name=\"name\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1426
+ "<define name=\"name2\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1427
+ "</manifest>" ;
1428
+ }
1429
+ } ) ;
1374
1430
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1375
1431
if ( nodejsData . name === "CICSNodejsapp" ) {
1376
1432
return { response : {
0 commit comments