Noctam/DWP/ACS Test Harness/Existing System/CISSIM/SIMD.odt

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

Meetings

Existing System

Specifications

Diary
2009:

Notes

CIS Simulator SIMD

The updated CIS simulator utilises text files to hold PD and DCI data, rather than encoded base64 and XML files. The data in the files is held against the field names of the various BFMs. Updates to the text files will be read immediately without having to restart the simulator.

Additionally, data is stored in folders with application run dates, so data changes can be saved and the appropriate data will be returned according to the application run date. Data is also segregated by service ID, so multiple services (or even applications) can be served from the same simulator if required.

Initial creation of text files

A utility is provided that will read base64 and XML files captured from real CIS calls, and convert them to text in an appropriate folder structure. The data for each NINO is held in 2 text files, one for PD data and one for DCI data. The PD data is held by service, the DCI data is held in a single DCI group.

To run the conversion utility, you point it at a folder containing captured CIS calls and a folder to write the converted output to (which must exist):

python cissim/pdconvertall.py <sourcefolder> <targetfolder>

The utility will output various messages then running, you can redirect the output to a file to check for issues later (e.g. by adding “> log.txt” to the end of the command).

After conversion the target folder will contain a DCI folder (assuming there were DCI calls in the captured data), plus a folder for each service it encountered in the data (assuming there were PD calls in the data). Within those folders will be date folders (in CCYYMMDD format) for each run date it encountered. Finally within the run date folders will be files for each NINO encountered, named <8_CHAR_NINO>.DATA. For example:

sf30spmessages/
├── DCI
│   └── 20190903
│       ├── KK002018.DATA
│       ├── KK002019.DATA
│       ├── KK002020.DATA
│       └── KK002021.DATA
├── JS5W
│   └── 20190213
│       ├── KK002014.DATA
│       ├── ST000001.DATA
│       └── ST000002.DATA
└── SF30
    ├── 20190213
    │   ├── KK002018.DATA
    │   ├── KK002019.DATA
    │   ├── KK002020.DATA
    │   └── KK002021.DATA
    └── 20190214
        ├── KK002018.DATA
        ├── KK002019.DATA
        ├── KK002020.DATA
        ├── KK002021.DATA
        └── KK002021.DATA

You can also use the utility to convert data that you have previously configured for the old version of the simulator.

Editing the text files

The text files can be edited using any text editor. The field data is held between square brackets, padded out with spaces/zeros to the full field length. Make sure that you do not change the field lengths (you could edit in overwrite mode to prevent that), otherwise you may not get the correct data returned. There are comments in the text files that describe which dialogs use which data fields. There are example empty and populated text files for both PD and DCI data that you can refer to if you need to check the format. For example for PD (edited for brevity):

[H1151]

# CP650  - CIS1151RSTRTDIA
# PD350  - CIS1151RSTRTDIA
# PD350  - CIS6084RCURRINT
# PD380  - CIS6084RCURRINT

H1151-ACCSS-TP                          : [01]
H1151-DECEASED-FG                       : [N]
H1151-SPRSDNG-NINO-GP                   : [         ]
H1151-NON-MGRTD-PAB-FG                  : [ ]
H1151-XPC-MKR                           : [0000]
H1151-DEL-INIT-CC-FG                    : [ ]
H1151-BCST-SUBSET-CHNG-FG               : [N]
H1151-ACCT-LAST-UPD-DT                  : [99999999]
H1151-PDCS-CRTN-DT                      : [19980101]
H1151-ACCT-DEL-DT                       : [00000000]
H1151-ACCT-DEL-RSN-CDE                  : [0000]
H1151-NINO                              : [        ]
H1151-NINO-SFX-TX                       : [ ]
H1151-CUST-PAB-REL-TP                   : [0000]
H1151-FBK-NINO-GP                       : [KK002000A]
H1151-FBK-NINO-VFN-TP                   : [0001]
H1151-FBK-SNME                          : [CAMPBELL        ]

Running the simulator

A new script is provided to start and stop the simulator. You can also use the script to check whether the simulator is already running, or restart it. The script keeps track of the simulator process ID, and also archives log files.

You specify the base folder(s) containing the NINO data when calling the simulator, for both PD and DCI.

For example, if you want to start a simulator on port 9231 pointing at PD data in /home/fdacs_mgr/cissimtest/sf30spmessages and DCI data in /home/fdacs_mgr/cissimtest/sf30spmessages, the run command in the script would be:

nohup python /home/fdacs_mgr/cissimtest/cissim/pdserved.py 9231 \
  -P /home/fdacs_mgr/cissimtest/sf30spmessages \
  -D /home/fdacs_mgr/cissimtest/sf30spmessages >${thisscriptspec}.log 2>&1 &

and you would start the script (assuming it is in the “serve” folder) with:

bash serve/sf30r32.1.sh start

You can specify multiple -P and -D options to the script to serve data from multiple folders.

The other parameters the script accepts are stop/restart/status.

When starting the simulator, a log file will be created with the script name followed by “.log”. It will also create a PID file with the script name followed by “.PID.” and the process ID of the simulator. Do not delete the PID file as the simulator uses that to stop/restart and check the status of the simulator. For example, for the script command above, the files would be:

sf30r32.1.sh.log
sf30r32.1.sh.PID.8828

When you stop or restart the simulator, the old log file will be renamed to include a timestamp, for example:

sf30r32.1.sh.log.20200303_123328

When a transaction is sent to the simulator, it will use the service/dialog/NINO/rundate (and surname/enquiry type for DCI) from the transaction to find the appropriate data within the folders you specified when starting it. As long as there is a file that matches the NINO and rundate, or one where the rundate folder is earlier than the application run date, then the simulator will return data. If there is no data in the data file for the particular transaction type, the simulator will return empty values for the transaction. The file that the simulator used to get data from will be written to the log file, along with the data that was sent and returned.

The simulator creates pre-processed versions of the NINO data files, in a messages sub-folder of the date folder, when any PD or DCI transaction is run. It creates 2 versions of each file, one that can be used by ACS, and one that can be used directly by the VMER app. These files should not be updated, they will be automatically regenerated if any data in the NINO data file is changed and a subsequent PD/DCI call is made. Note that if you rename a rundate folder (to change the rundate), you should make sure you delete the contents of any messages sub-folder within the date folder.

Notes

Describe current lack of DCI908 support Add description of NPS support