Noctam/DWP/ACS Test Harness/Existing System/CISSIM/PDSIM demo.odt

From The Dreaming
Jump to navigation Jump to search
ACS Test Harness

Meetings

Existing System

Specifications

Diary
2009:

Notes

Overview

To run a server that simulates CIS, you need to capture a copy of the request and reply for each CIS transaction you want to simulate. For PD those transactions are base64 EBCDIC, for DCI they are ASCII XML.

Once you have a transaction pair, you can use pdedit to edit the fields and save the transaction files to new names.

Once you have a set of transactions, you can use pddb to extract the key information from those transactions to a key file.

You can now create a config file that points to the key file, and use pdserve to serve a CIS interface. You can test that pdserve is working correctly using pdcall or curl.

If you want to access that pdserve instance from an app, you need to point the app to it. For VMER, you edit fdacs.ini and put the IP address of pdserve instead of the CIS IP address (and restart ACS). For VME, you update the DTS link.

You can run multiple pdserve's concurrently on different ports, they can serve the same transactions or a different set (so you can essentially have unlimited swimlanes).

For creating a small set of transaction pairs, it is simple enough to edit the transactions manually. For a larger set, it is better to either capture them from a swimlane, or create them in a text file and use the utilities to convert them.

Prerequisites

The Python routines all run under either Windows/Cygwin or Linux (assuming Python 2.7 is installed on the machine).

Creation of the data can be done on a different machine to the one used to run the simulator.

To capture data from CIS, you will need access to a CIS swimlane, from a machine that can run the Python code. If you are just editing pre-captured calls, you don't need this.

Transaction display/edit

The rest of this document considers a single PD transaction (PD350), and doesn't further discuss DCI. The same principles cover all PD and DCI transactions.

This is a PD350 CIS request (base64 encoded EBCDIC):

AAAAMMPJ4vHx9fHZ4uPZ48TJwUDnbdbD48XjQAAAAAAAAAAB48Hn08XywsPX+Pj44+fkQMXxAAAAO0BAQPDw8Pbw+fjx1dfE8/XwQEBAQEBAQEBAQED0+PDw8PDx8PT38fDw8NHi9eZAQEBAQEBAQEBAQEBAxfMAAAAP8PHR4vXm4/Dw8PDw8PDwyfEAAABG8PHy8/Lw9/XFQNZAwtPBw9LX1tPV2eNg48XB1NHiwcfZ1uTX8PDw8PDw8EBAQMnC1MHJ5/Dz8EBAQEBAQEBAQEBAQEDXxNPxAAAAIeXw8PDR4vXmQOXUxdkAAAAAAOkSHgAAAAADUWQGAAAAAtnxAAAALMPJ4vHx9fHZ4uPZ48TJwUBAQEBAQEBAQEBAQEBAQEBA4uPw8PDw8PHBQEBAwfEAAAAp4uPw8PDw8PHB8vDx+fDy8fPXxPP18EDw8PDw8PDw8PTz8fD09/Hw+PU=

To view the request (to stdout), if the request is in a file, run:

python pdutils.py DUMP PD350_1151_R_RQST RQST <requestfile>

which gives:

   B4 CIS-IN-MSG-LGTH                         : [       48] (00 00 00 30)
  X16 CIS-IN-MSG-ID                           : [CIS1151RSTRTDIA ]
   X8 CIS-IN-MSG-XATMI-TP                     : [X_OCTET ]
   B4 CIS-IN-MSG-APPN-RESP-CODE               : [        0] (00 00 00 00)
   B4 CIS-IN-MSG-EVENT                        : [        1] (00 00 00 01)
   X1 CIS-IN-MSG-SERV-TP-FG                   : [T]
  X15 CIS-IN-MSG-SERV-NAME                    : [AXLE2BCP888TXU ]
   X2 FILLER E1                               : [E1]
   B4 FILLER 59                               : [       59] (00 00 00 3b)
   N2 W80-E1-USR-GD-TP                        : [  ]
   N1 W80-E1-OPER-CHCK-FG                     : [ ]
   N8 W80-E1-DSS-DAYS                         : [00060981]
   X1 W80-E1-SENS-REC-FG                      : [N]
  X16 W80-E1-PROCESS-NAME                     : [PD350           ]
   N2 W80-E1-SYS-NO                           : [48]
  N12 W80-E1-LOC-NO                           : [000010471000]
   X7 W80-E1-INIT-SERVICE                     : [JS5W   ]
  X10 W80-E1-SECTION-ID                       : [          ]
   X2 FILLER E3                               : [E3]
   B4 FILLER 15                               : [       15] (00 00 00 0f)
   X2 W80-E3A-ENV-ID-DATA                     : [01]
   X4 W80-E3B-INFR-TPSVCE-NME                 : [JS5W]
   X1 W80-E3C-INFR-TP2                        : [T]
   X8 W80-E3D-INFR-INIT-MPT                   : [00000000]
   X2 FILLER I1                               : [I1]
   B4 FILLER 70                               : [       70] (00 00 00 46)
   N8 W80-I1-USER-ID                          : [01232075]
  X20 W80-I1-USER-NME                         : [E O BLACKPOLNRT-TEAM]
   X8 W80-I1-USER-GP                          : [JSAGROUP]
   N2 W80-I1-SENS-CASE-ACCSS                  : [00]
   X8 W80-I1-OFFICE-ID                        : [00000   ]
  X22 W80-I1-CONTROLLER-ID                    : [IBMAIX030             ]
   X2 W80-I1-SYS-ID                           : [PD]
   X2 FILLER L1                               : [L1]
   B4 FILLER 33                               : [       33] (00 00 00 21)
   X1 W80-L1-V                                : [V]
   N3 W80-L1-FULL-SYS                         : [000]
   X5 W80-L1-FULL-UNAME                       : [JS5W ]
   X4 W80-L1-FULL-JOB-TAG                     : [VMER]
   B8 W80-L1-FULL-TIME                        : [          15274526] (00 00 00 00 00 e9 12 1e)
   B8 W80-L1-FULL-MICRO                       : [          55665670] (00 00 00 00 03 51 64 06)
   B4 W80-L1-FULL-INCR-NUM                    : [        2] (00 00 00 02)
   X2 FILLER R1                               : [R1]
   B4 FILLER 44                               : [       44] (00 00 00 2c)
  X16 W80-R1A-RQST-FN-NME                     : [CIS1151RSTRTDIA ]
  X16 W80-R1B-RQST-ALT-FN                     : [                ]
  X12 W80-R1C-DAM-RQST-FN-KEY                 : [ST000001A   ]
   X2 FILLER A1                               : [A1]
   B4 W80-A1-LGTH                             : [       41] (00 00 00 29)
      02 H1151-RQST-DATA-GP
      03 H1151-RQST-PARAM-GP
      04 H1151-RQST-NINO-GP
   X8 05 H1151-NINO                           : [ST000001]
   X1 05 H1151-NINO-SFX-TX                    : [A]
   N8 04 H1151-RQST-DSS-DAYS                  : [20190213]
   X6 04 H1151-RQST-DIA-ID                    : [PD350 ]
   N4 04 H1151-RQST-USR-NS-LVL                : [0000]
   N4 04 H1151-RQST-USR-LS-LVL                : [0000]
   N2 04 H1151-RQST-USR-BUS-SYS-NO            : [43]
      04 H1151-RQST-USR-LOC-GP
   N1 05 H1151-DEPT-ID-TP                     : [1]
   N5 05 H1151-OFF-LOC-NO                     : [04710]
   N2 04 H1151-RQST-SPCFC-BUS-TP              : [85]

This shows both the header for the request (the CIS and W80 groups), and the payload (the H1151 group).

To edit the message, run:

python pdedit.py PD350_1151_R_RQST RQST <sourcefile> <destinationfile>

This opens a command line editor, initially showing the following for this request:

PDD RQST Editor - PD350_1151_R_RQST H1151_RQST

 X8  05 H1151-NINO                           : [ST000001]
 X1  05 H1151-NINO-SFX-TX                    : [A]
 N8  04 H1151-RQST-DSS-DAYS                  : [20190213]
 X6  04 H1151-RQST-DIA-ID                    : [PD350 ]
 N4  04 H1151-RQST-USR-NS-LVL                : [0000]
 N4  04 H1151-RQST-USR-LS-LVL                : [0000]
 N2  04 H1151-RQST-USR-BUS-SYS-NO            : [43]
 N1  05 H1151-DEPT-ID-TP                     : [1]
 N5  05 H1151-OFF-LOC-NO                     : [04710]
 N2  04 H1151-RQST-SPCFC-BUS-TP              : [85]

<F1> save <F2> quit, <F3> W80_HEADER, <F4> H1151_RQST.

The editor initially shows the payload (in this case the H1151 group). You can use the cursor keys to move around the fields, and then update them as necessary. You can edit the header if you select it with the F3 key. The header is specific to a service, so care should be taken when updating it.

If there are more rows in the layout than will fit on the screen, you can page up and down (or move up/down line by line). An example for the header is shown below (note the <MORE UP> and <MORE DOWN> blocks):

PDD RQST Editor - PD350_1151_R_RQST W80_HEADER
                                               <MORE UP>
 N2  W80-E1-USR-GD-TP                        : [  ]
 N1  W80-E1-OPER-CHCK-FG                     : [ ]
 N8  W80-E1-DSS-DAYS                         : [00060981]
 X1  W80-E1-SENS-REC-FG                      : [N]
X16  W80-E1-PROCESS-NAME                     : [PD350           ]
 N2  W80-E1-SYS-NO                           : [48]
N12  W80-E1-LOC-NO                           : [000010471000]
 X7  W80-E1-INIT-SERVICE                     : [JS5W   ]
X10  W80-E1-SECTION-ID                       : [          ]
 X2  FILLER E3                               : [E3]
 B4  FILLER 15                               : [       15]
 X2  W80-E3A-ENV-ID-DATA                     : [01]
 X4  W80-E3B-INFR-TPSVCE-NME                 : [JS5W]
 X1  W80-E3C-INFR-TP2                        : [T]
 X8  W80-E3D-INFR-INIT-MPT                   : [00000000]
 X2  FILLER I1                               : [I1]
 B4  FILLER 70                               : [       70]
 N8  W80-I1-USER-ID                          : [01232075]
X20  W80-I1-USER-NME                         : [E O BLACKPOLNRT-TEAM]
 X8  W80-I1-USER-GP                          : [JSAGROUP]
                                               <MORE DOWN>
<F1> save <F2> quit, <F3> W80_HEADER, <F4> H1151_RQST.

Some dialogs split the payload up into two sections, in that case there will also be a screen accessible via F5.

When all changes have been made, selecting F1 will save it to the destination name.

You repeat the above process for the transaction replies.

Transaction database

For each pair of requests and replies that you have, you need to run a script to extract the request key information and associate the reply with that info:

python pddb.py PD350_1151_R_RQST <requestfile> <replyfile> EBCDIC

The output (to stdout) in this case is:

PD350_1151_R_RQST:PD350.CIS1151RSTRTD1A.152745.0ed1249b558f.out:H1151-NINO=ST000001;H1151-NINO-SFX-TX=A;H1151-RQST-DSS-DAYS=20190213;H1151-RQST-DIA-ID=PD350 ;H1151-RQST-USR-NS-LVL=0000;H1151-RQST-USR-LS-LVL=0000;H1151-RQST-USR-BUS-SYS-NO=43;H1151-DEPT-ID-TP=1;H1151-OFF-LOC-NO=04710;H1151-RQST-SPCFC-BUS-TP=85;

You then combine all the extracted data into a single file. Normally you would create a simple script to run pddb.py on a set of transactions, and append the output directly to a file, something like:

python pddb.py PD350_1151_R_RQST <requestfile1> <replyfile1> EBCDIC > <service>.CIS.TXT
python pddb.py PD350_1151_R_RQST <requestfile2> <replyfile2> EBCDIC >> <service>.CIS.TXT
python pddb.py PD350_1151_R_RQST <requestfile3> <replyfile3> EBCDIC >> <service>.CIS.TXT
python pddb.py PD350_1151_R_RQST <requestfile4> <replyfile4> EBCDIC >> <service>.CIS.TXT

You now have a “database” of CIS calls (actually simply a text file).

Simulator

You should now create a config file to use with the simulator. In that file you will state where the request and reply files are located, and also the database file. For this example we will put the requests/replies and the database file in a folder call simtest.

Create a text file called CONFIGFILE.<service> containing:

simtest/<service>.CIS.TXT:simtest

You can put multiple lines in the config file, to point to multiple database files and request/reply locations.

You can now start the simulator, pointing it to the config file and telling it what port to serve on:

python pdserve.py CONFIGFILE.<service> 9130

Starting the simulator in this way will run it in the foreground in your current command prompt, and display the config file as it reads it followed by any requests/replies that are made to it. Doing it this way is only useful for initial testing, to start it on Linux in the background and write its output to a logfile use something like:

nohup python pdserve.py configfile.sf30 9130 >sf30.log &

This can be saved as a script and run with bash.

To stop the simulator when running in the foreground, use Ctrl-C. If running in the background, you will need to find the process ID and kill it.

On Linux, use:

ps -ef | grep pdserve

which gives as an example:

fdacs_m+  3286     1  0 Apr21 ?        00:01:41 python ../cis/pdserve.py configfile.jsa 9127
fdacs_m+ 10412  8010  0 15:22 pts/3    00:00:00 grep --color=auto pdserve
fdacs_m+ 22087     1  0 Apr04 ?        00:04:50 python ../cis/pdserve.py configfile.eofftrans 9128

Choose the entry with the port you specified, and kill it by passing its PID to the kill command (3286 in this case for port 9127):

kill 3286

To run a test transaction through the simulator, you can use pdcall as follows:

python pdcall.py 9130 PD350_1151_R_RQST simtest/<requestfile> dummy

(a dummy file was used for the reply as we don't need it). pdcall displays the request using pdedit, allows you to send the request with F1, displays the response (which you can also edit), then allows you to save the response. The response in this case had 2 screens for the payload (note the <F4> and <F5> blocks):

PDD RPLY Editor - PD350_1151_R_RQST H0053_RPLY

 N4  04 H0053XP-PRSN-XPC-MKR                 : [0000]
 X8  07 H0053PR-NINO                         : [ST000001]
 X1  07 H0053PR-NINO-SFX-TX                  : [A]
 N8  06 H0053PR-PDCS-CRTN-DT                 : [19980101]
 N8  06 H0053PR-ACC-LAST-UPD-DT              : [99999999]
 N4  06 H0053PR-ACC-STAT-TP                  : [0001]
 N8  06 H0053PR-ACC-STAT-DT                  : [99999999]
 N1  07 H0053PR-CHNG-MADE-DEPT-ID-TP         : [0]
 N5  07 H0053PR-CHNG-MADE-OFF-LOC-NO         : [00000]
 N2  07 H0053PR-CHNG-MADE-BEN-SYS-NO         : [00]
 N4  04 H0053AL-CNT                          : [0000]
 X8  07 H0053AL-ALT-ID-NINO (1)              : [        ]
 X1  07 H0053AL-ALT-ID-NINO-SFX-TX (1)       : [ ]
 N4  06 H0053AL-ALT-ID-TP (1)                : [0000]
 N8  07 H0053AL-STRT-DT-APLD-DT (1)          : [00000000]
 N8  07 H0053AL-END-DT-APLD-DT (1)           : [00000000]
 N1  08 H0053AL-CHNG-MADE-DEPT-ID-TP (1)     : [0]
 N5  08 H0053AL-CHNG-MADE-OFF-LOC-NO (1)     : [00000]
                                               <MORE DOWN>
<F1> save <F2> quit, <F3> W90_HEADER, <F4> H0053_RPLY, <F5> H1151_RPLY.

For the response, the W90_HEADER shows the response code (press F3 to see it):

PDD RPLY Editor - PD350_1151_R_RQST W90_HEADER

 A9  LEADING                                 : [000000000]
 B4  CIS-OUT-MSG-LGTH                        : [       48]
X16  CIS-OUT-MSG-ID                          : [CIS1151RSTRTD1A ]
 X8  CIS-OUT-MSG-XATMI-TP                    : [X_OCTET ]
 B4  CIS-OUT-MSG-APPN-RESP-CODE              : [        0]
 B4  CIS-OUT-MSG-EVENT                       : [        1]
 X1  CIS-OUT-MSG-SERV-TP-FG                  : [T]
X15  CIS-OUT-MSG-SERV-NAME                   : [AXLE2BCP888TXU ]
 X2  W90-A2-T                                : [A2]
 B4  W90-A2-LGTH                             : [     5402]

<F1> save <F2> quit, <F3> W90_HEADER, <F4> H0053_RPLY, <F5> H1151_RPLY.

If you want to simulate failures, you can set the response to appropriate values.

You can see how the simulator processed the request/reply by looking in the log file (or on the screen if running in the foreground):

less sf30.log

For the example, that shows (the first part within the braces is the read of the database file, the end out the reply is snipped):

{'PD350_1151_R_RQST;H1151-NINO=ST000001;H1151-NINO-SFX-TX=A;H1151-RQST-DSS-DAYS=20190213;H1151-RQST-DIA-ID=PD350 ;H1151-RQST-USR-NS-LVL=0000;H1151-RQST-USR-LS-LVL=0000;H1151-RQST-USR-BUS-SYS-NO=43;H1151-DEPT-ID-TP=1;H1151-OFF-LOC-NO=04710;H1151-RQST-SPCFC-BUS-TP=85;': 'PD350.CIS1151RSTRTD1A.152745.0ed1249b558f.out'}
15:44:03.480340 POST received
BaseHTTP/0.3
Python/2.7.5
HTTP/1.1
/IB_CIS_VME_WEB/base64
accept=text/plain
content-length=468
content-type=text/plain
host=localhost:9130
user-agent=PycURL/7.29.0
AAAAMMPJ4vHx9fHZ4uPZ48TJwUDnbdbD48XjQAAAAAAAAAAB48Hn08XywsPX+Pj44+fkQMXxAAAAO0BAQPDw8Pbw+fjx1dfE8/XwQEBAQEBAQEBAQED0+PDw8PDx8PT38fDw8NHi9eZAQEBAQEBAQEBAQEBAxfMAAAAP8PHR4vXm4/Dw8PDw8PDwyfEAAABG8PHy8/Lw9/XFQNZAwtPBw9LX1tPV2eNg48XB1NHiwcfZ1uTX8PDw8PDw8EBAQMnC1MHJ5/Dz8EBAQEBAQEBAQEBAQEDXxNPxAAAAIeXw8PDR4vXmQOXUxdkAAAAAAOkSHgAAAAADUWQGAAAAAtnxAAAALMPJ4vHx9fHZ4uPZ48TJwUBAQEBAQEBAQEBAQEBAQEBA4uPw8PDw8PHBQEBAwfEAAAAp4uPw8PDw8PHB8vDx+fDy8fPXxPP18EDw8PDw8PDw8PTz8fD09/Hw+PU=
15:44:03.519700 body read
CIS1151RSTRTDIA PD350 01232075
PD350_1151_R_RQST
PD350_1151_R_RQST;H1151-NINO=ST000001;H1151-NINO-SFX-TX=A;H1151-RQST-DSS-DAYS=20190213;H1151-RQST-DIA-ID=PD350 ;H1151-RQST-USR-NS-LVL=0000;H1151-RQST-USR-LS-LVL=0000;H1151-RQST-USR-BUS-SYS-NO=43;H1151-DEPT-ID-TP=1;H1151-OFF-LOC-NO=04710;H1151-RQST-SPCFC-BUS-TP=85;
15:44:03.520918 BASE64 processed
PD350.CIS1151RSTRTD1A.152745.0ed1249b558f.out
15:44:03.521028 response read
MDAwMDAwMDAwAAAAMMPJ4vHx9fHZ4uPZ48TxwUDnbdbD48XjQAAAAAAAAAAB48Hn08XywsPX+Pj44+fkQMHyAAAVGvDx1UBAQEBAQEBAQEDw8PDwQNX5+fn5+fn5+fH5+fjw8fDx8PDw8PDw8PDw8PDwQEBAQEBAQEBA8PDw8OLj8PDw8PDxwfDw8PHmwejVxUBAQEBAQEBAQEBA8fn38PHx8PTw8PDx8PDw8fDw8PHR1sjVQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQPDw8PHw8PDw8PDw8EDw8PDw8PDw8PDw8PDw8PDw+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fnw8PDw8PDw8NXw8PDw8PDw8EBAQEBAQEBAQPDw8PDw8PDw8PDw8Pn5+fn5+fn5QEBAQEBAQEBA8PDw8PDw8PDw8PDw+fn5+fn5+flAQEBAQEBAQEDw8PDw8PDw8PDw8PD5+fn5+fn5+UBAQEBAQEBAQPDw8PDw8PDw8PDw8Pn5+fn5+fn5QEBAQEBAQEBA8PDw8PDw8PDw8PDw+fn5+fn5+fnw8PDw8PDw8PDw8PDw8PDw8PD5+fn5+fn5+fDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw+fn5+fn5+fnw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8Pn5+fn5+fn58PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD5+fn5+fn5+fDw8PDw8PDw8PDw8PDw8PDw
<...snip...>

You can also send requests using curl, if you don't need to be able to edit them, but you will need to use the appropriate certificates.

Swimlane

Now you have proved that the simulator is working as expected, you need to point your application at it.

For VMER, the simulator usually runs as localhost on the ACS VM, though it can run on any VM. For VME, we need a VM to run it on (that has Python 2.7 installed), a port to use and a route to that VM and port.

Demo

A zip file is available containing the Python project (an install package could be made available so that the project is available on the path).

A zip file is also available containing a demo set of files.

A zip file can also be made available containing a full set of PD and DCI transactions, though it can be easier to capture those from a swimlane set up for the appropriate service to reduce the amount of editing required.