<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.panglossian.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Noctam%2FDWP%2FACS_Test_Harness%2FExisting_System%2FCISSIM%2FPVTstub.odt</id>
	<title>Noctam/DWP/ACS Test Harness/Existing System/CISSIM/PVTstub.odt - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.panglossian.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Noctam%2FDWP%2FACS_Test_Harness%2FExisting_System%2FCISSIM%2FPVTstub.odt"/>
	<link rel="alternate" type="text/html" href="https://wiki.panglossian.net/wiki/index.php?title=Noctam/DWP/ACS_Test_Harness/Existing_System/CISSIM/PVTstub.odt&amp;action=history"/>
	<updated>2026-07-07T19:47:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.panglossian.net/wiki/index.php?title=Noctam/DWP/ACS_Test_Harness/Existing_System/CISSIM/PVTstub.odt&amp;diff=365&amp;oldid=prev</id>
		<title>Stuart: Copy of PVTstub.odt from Mark&#039;s user docs</title>
		<link rel="alternate" type="text/html" href="https://wiki.panglossian.net/wiki/index.php?title=Noctam/DWP/ACS_Test_Harness/Existing_System/CISSIM/PVTstub.odt&amp;diff=365&amp;oldid=prev"/>
		<updated>2021-10-07T08:51:24Z</updated>

		<summary type="html">&lt;p&gt;Copy of PVTstub.odt from Mark&amp;#039;s user docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;{{nav/ACS Test Harness}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== PVT Stub ==&lt;br /&gt;
The PVT stub utilises the Python CIS simulator to return defined responses to PDD and DCI messages sent via ACS.&lt;br /&gt;
&lt;br /&gt;
Rules defining which message to return for a particular PDD/DCI transaction are configured in a configuration file. Messages themselves are contained in individual text files (base64 encoded EBCDIC for PDD, ASCII XML for DCI).&lt;br /&gt;
&lt;br /&gt;
A bash script is run to invoke the simulator on a particular port, the simulator reads the configuration file and processes requests sent to it accordingly.&lt;br /&gt;
&lt;br /&gt;
An instance of the simulator acts as a swimlane, but can process messages from multiple applications/services. Multiple simulators can be run concurrently on different ports, to simulate multiple swimlanes.&lt;br /&gt;
&lt;br /&gt;
=== Install ===&lt;br /&gt;
A minimal install of the simulator requires the following:&lt;br /&gt;
* The simulator Python package (optionally added to the Python path ($PYTHONPATH))&lt;br /&gt;
* A folder to contain the config and start script&lt;br /&gt;
* A folder to contain the message files&lt;br /&gt;
* A folder to contain test data&lt;br /&gt;
&lt;br /&gt;
See the pvtstub.zip file for an example install (containing cissim, serve, messages and test folders).&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
The configuration file contains the following sections:&lt;br /&gt;
* [CONFIG] – to define the folder containing the reply messages&lt;br /&gt;
* [STATIC-PARAMS] – to define parameter values to be substituted at runtime&lt;br /&gt;
* [NAMESPACES] – to define namespaces for DCI message fields (not currently used)&lt;br /&gt;
* [REPLACEMENTS] to define rules for determining which reply message to return for a given request message, optionally making substitutions in the reply message&lt;br /&gt;
&lt;br /&gt;
The replacement entries contain the following details:&lt;br /&gt;
* service/systemid – the service for PDD calls, the systemid for DCI calls&lt;br /&gt;
* transaction – the transaction identifier for a particular transaction type (see appendix)&lt;br /&gt;
* transaction file – the file containing the PDD or DCI message&lt;br /&gt;
* searches (optional) – zero, one or more search parameters&lt;br /&gt;
* replacements (optional) – zero, one or more replacement parameters&lt;br /&gt;
&lt;br /&gt;
Searches refer to fields in the request message, and define values to check those fields against.&lt;br /&gt;
Replacements refer to fields in the reply message and define values to replace the content of those fields with.&lt;br /&gt;
&lt;br /&gt;
See the example serve/configfile.stub.pvt for details of how to configure searches and replacements.&lt;br /&gt;
&lt;br /&gt;
The transaction files can be viewed and edited using Python simulator utilities. Running pdedit.py against a reply file allows editing of the content, both the header and the payload.&lt;br /&gt;
&lt;br /&gt;
==== Configuration test ====&lt;br /&gt;
To test whether a configuration file is coherent, for instance that the searches and replacements are correct and refer to valid layout fields, you can run the simulator in check mode by supplying a port value of 0. This will process the configuration file and report what it post-processes it to, including showing any errors, then immediately exit.&lt;br /&gt;
&lt;br /&gt;
Once you have a configuration file that loads successfully, you can run the simulator and call it directly using Python simulator utilities to check each transaction. Example calls are shown in test/testcall.sh in the example test folder. Running the pdcall.py utility against an input message:&lt;br /&gt;
* Displays the request message in layout format (optionally allowing edit)&lt;br /&gt;
* Calls the simulator&lt;br /&gt;
* Displays the reply message in layout format (optionally allowing edit)&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
The simulator should be run on the ACS VM(s).&lt;br /&gt;
&lt;br /&gt;
You usually run the simulator in the background and leave it running, see the example bash script serve/pvtstub.sh for how to do that and send its output to a log file. You can also run it in the foreground when testing the configuration. To stop the simulator kill its PID.&lt;br /&gt;
&lt;br /&gt;
To configure ACS to talk to the stub, set the PDD and DCI URLs in /opt/osmp/fdacs/conf/common/acs/fdacs.ini for the required services to point to localhost:&amp;lt;simport&amp;gt; (instead of np-cel-pri:&amp;lt;slport&amp;gt;). You will need to restart ACS after updating the ini file.&lt;br /&gt;
&lt;br /&gt;
The simulator(s) can be started and stopped independently of ACS.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
* For PDD:&lt;br /&gt;
** When creating reply messages:&lt;br /&gt;
*** You can create error scenarios by setting the apporpriate fields in the W90 header&lt;br /&gt;
** When calling from the command line:&lt;br /&gt;
*** Make sure you set the service identifier in all three places in the W80 header (W80-E1-INIT-SERVICE, W80-E3B-INFR-TPSVCE-NME, W80-L1-FULL-UNAME)&lt;br /&gt;
*** If using the request header to find the NINO, make sure you set it in W80-R1C-DAM-RQST-FN-KEY&lt;br /&gt;
*** For PD001 calls, set the calling dialog to the appropriate one for the application in W80-E1-PROCESS-NAME&lt;br /&gt;
* For DCI:&lt;br /&gt;
** Make sure you use the correct namespace for fields&lt;br /&gt;
* COBOL layouts:&lt;br /&gt;
** PDD:&lt;br /&gt;
*** COBOL layouts for each record type can be listed by running the cissim/getfieldoffset.py utility (edit that code to add a line for the required layout, setting the field to DUMMY). Alternatively, you can run the pdedit.py utility against an empty file&lt;br /&gt;
** DCI:&lt;br /&gt;
*** Request and reply XML can be found in the cissim/pdlayouts folder&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
* Transaction identifiers:&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
</feed>