laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21633 )


Change subject: gbproxy: properly shutdown at the end of the test
......................................................................

gbproxy: properly shutdown at the end of the test

Destroying at least most of the components in an orderly fashion avoids
at least most of the race conditions during test shutdown.

Change-Id: I2aa4ef8a70c1139893c9621f5a6b6007b221c13d
---
M gbproxy/GBProxy_Tests.ttcn
1 file changed, 20 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/33/21633/1

diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 7811a01..9bd0550 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -14,6 +14,7 @@

 import from General_Types all;
 import from Osmocom_Types all;
+import from Misc_Helpers all;
 import from GSM_Types all;
 import from Native_Functions all;
 import from NS_Types all;
@@ -398,6 +399,15 @@
 }


+private function f_destroy_gb(inout GbInstance gb) runs on test_CT {
+       gb.vc_NS.stop;
+       gb.vc_BSSGP.stop;
+
+       for (var integer i := 0; i < lengthof(gb.cfg.bvc); i := i + 1) {
+               gb.vc_BSSGP_BVC[i].stop;
+       }
+}
+
 private function f_init_vty() runs on test_CT {
        map(self:GBPVTY, system:GBPVTY);
        f_vty_set_prompts(GBPVTY);
@@ -513,7 +523,16 @@
 }

 function f_cleanup() runs on test_CT {
-       self.stop;
+       var integer i;
+
+       for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) {
+               f_destroy_gb(g_sgsn[i]);
+       }
+       for (i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) {
+               f_destroy_gb(g_pcu[i]);
+       }
+
+       Misc_Helpers.f_shutdown(__BFILE__, __LINE__, pass);
 }

 type function void_fn(charstring id) runs on BSSGP_ConnHdlr;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21633
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2aa4ef8a70c1139893c9621f5a6b6007b221c13d
Gerrit-Change-Number: 21633
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-MessageType: newchange

Reply via email to