remsim: Move PIPEasp generic helper code to library/PIPEasp_Templates.ttcn

This way code can be used and extended for other testsuites.

Change-Id: I4a5ededbd958c87537f84155092b6a6cd715865a
diff --git a/remsim/RemsimClient_Tests.ttcn b/remsim/RemsimClient_Tests.ttcn
index 219573c..d747eef 100644
--- a/remsim/RemsimClient_Tests.ttcn
+++ b/remsim/RemsimClient_Tests.ttcn
@@ -20,6 +20,7 @@
 /* the PIPEasp port allows us to interact with osmo-remsim-client-shell via stdin/stdout */
 import from PIPEasp_PortType all;
 import from PIPEasp_Types all;
+import from PIPEasp_Templates all;
 
 import from RSPRO all;
 import from RSPRO_Types all;
@@ -196,34 +197,13 @@
  * Tests interacting with local remsim-bankd-client via PIPE port
  ***********************************************************************/
 
-template (value) ASP_PExecuteBackground ts_ExecBg(charstring cmd) := {
-	command := cmd
-}
-
-template (present) ASP_PStdout tr_Stdout(template (present) charstring line) := {
-	stdout := line
-}
-
-template (present) ASP_PStderr tr_Stderr(template (present) charstring line) := {
-	stderr := line
-}
-
-template (value) ASP_PStdin ts_Stdin(template (value) charstring line) := {
-	stdin :=line
-}
-
-/* osmo-remsim-client logs to stderr, so we need to ignore that log output */
-private altstep as_ignore_stderr() runs on client_test_CT {
-[] PIPE.receive(tr_Stderr(?)) { repeat; }
-}
-
 /* start a local osmo-remsim-client as sub-process and attach it to PIPE port */
 private function f_init_client_pipe(ClientSlot cs) runs on client_test_CT {
 	var charstring cmdline := mp_client_shell_cmd & " -i 127.0.0.1";
 	map(self:PIPE, system:PIPE);
 	PIPE.send(ts_ExecBg(cmdline & " -c " & int2str(cs.clientId)
 				    & " -n " & int2str(cs.slotNr)));
-	activate(as_ignore_stderr());
+	activate(as_ignore_stderr(PIPE));
 }
 
 /* pretty-print an octet string as series of ASCII encoded hex bytes with spaces */