hlr: Reduce code duplication by using template

Change-Id: I7dcf0d27144e5dcf29babcb679ca9ef04b1f46a3
diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn
index 48233ed..44e713e 100644
--- a/hlr/HLR_Tests.ttcn
+++ b/hlr/HLR_Tests.ttcn
@@ -180,9 +180,12 @@
 	}
 }
 
+private template (value) charstring t_subscr_prefix(hexstring imsi) :=
+	"subscriber imsi " & hex2str(imsi) & " ";
+
 /* create a given subscriber using the VTY */
 function f_vty_subscr_create(HlrSubscriber sub) runs on test_CT {
-	var charstring prefix := "subscriber imsi " & hex2str(sub.imsi) & " ";
+	var charstring prefix := valueof(t_subscr_prefix(sub.imsi));
 	f_vty_transceive_match(VTY, prefix & "create", pattern "% Created subscriber *");
 	f_vty_transceive_match(VTY, prefix & "update msisdn " & hex2str(sub.msisdn),
 				pattern "% Updated subscriber *");
@@ -209,14 +212,14 @@
 
 /* perform 'delete' on subscriber */
 function f_vty_subscr_delete(HlrSubscriber sub) runs on test_CT {
-	var charstring prefix := "subscriber imsi " & hex2str(sub.imsi) & " ";
+	var charstring prefix := valueof(t_subscr_prefix(sub.imsi));
 	f_vty_transceive_match(VTY, prefix & "delete",
 				pattern "% Deleted subscriber for IMSI *");
 }
 
 /* perform 'show' on subscriber; match result with pattern 'exp' */
 function f_vty_subscr_show(HlrSubscriber sub, template charstring exp) runs on test_CT {
-	var charstring prefix := "subscriber imsi " & hex2str(sub.imsi) & " ";
+	var charstring prefix := valueof(t_subscr_prefix(sub.imsi));
 	f_vty_transceive_match(VTY, prefix & "show", exp);
 }