pcu: Support Neighbor Address Resolution over PCUIF

New versions of osmo-pcu support Neighbor Address Resolution over this
interface, and deprecated the old CTRL interface.
Let's use it by default while still keeping support for the old one for
a while to avoid breakage of existing deployments.

Tests run to validate:
* Old osmo-pcu still passes tests using CTRL interface
* New osmo-pcu (with new iface support) still passes tests using CTRL
  interface
* New osmo-pcu (with new iface support) passes tests using new iface

Related: SYS#4971
Change-Id: I05f1aabc64fc5bc4740b0d8afd8990b485eacd50
diff --git a/library/Osmocom_CTRL_Adapter.ttcn b/library/Osmocom_CTRL_Adapter.ttcn
index 34ea300..6a9706e 100644
--- a/library/Osmocom_CTRL_Adapter.ttcn
+++ b/library/Osmocom_CTRL_Adapter.ttcn
@@ -22,6 +22,7 @@
 
 type component CTRL_Adapter_CT {
 	var IPA_Emulation_CT vc_CTRL_IPA;
+	var boolean ipa_is_up := false;
 	/* test port for the CTRL interface of the BSC */
 	port IPA_CTRL_PT IPA_CTRL;
 }
@@ -29,10 +30,13 @@
 /* wait for IPA CTRL link to connect and send UP */
 function f_ipa_ctrl_wait_link_up()
 runs on CTRL_Adapter_CT {
+	if (ipa_is_up == true) {
+		return;
+	}
 	timer T := 10.0;
 	T.start;
 	alt {
-	[] IPA_CTRL.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_UP)) { }
+	[] IPA_CTRL.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_UP)) { ipa_is_up := true; }
 	[] T.timeout {
 		setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP");
 		mtc.stop;
@@ -40,13 +44,16 @@
 	}
 }
 
-/* wait for IPA CTRL link to connect and send UP */
+/* wait for IPA CTRL link to connect and send DOWN */
 function f_ipa_ctrl_wait_link_down()
 runs on CTRL_Adapter_CT {
+	if (ipa_is_up == false) {
+		return;
+	}
 	timer T := 10.0;
 	T.start;
 	alt {
-	[] IPA_CTRL.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_DOWN)) { }
+	[] IPA_CTRL.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_DOWN)) { ipa_is_up := false; }
 	[] T.timeout {
 		setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_DOWN");
 		mtc.stop;