[PATCH] osmo-gsm-tester[master]: fix: free resources when a suite run is done

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon May 29 00:58:15 UTC 2017


Review at  https://gerrit.osmocom.org/2771

fix: free resources when a suite run is done

Add missing code to free resources, not upon program exit, but when a suite is
done.

This allows running more than one suite in a row.

Change-Id: Ic017a1cf07052f5e48812c8553fba6f972d280f0
Related: OS#2301
---
M src/osmo_gsm_tester/suite.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/71/2771/1

diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index ac56ada..6a1796f 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -248,6 +248,7 @@
             # base exception is raised. Make sure to stop processes in this
             # finally section. Resources are automatically freed with 'atexit'.
             self.stop_processes()
+            self.free_resources()
         event_loop.unregister_poll_func(self.poll)
         self.duration = time.time() - self.start_timestamp
         if self.test_failed_ctr:
@@ -268,6 +269,11 @@
         for process in self._processes:
             process.terminate()
 
+    def free_resources(self):
+        if self.reserved_resources is None:
+            return
+        self.reserved_resources.free()
+
     def ip_address(self):
         return self.reserved_resources.get(resource.R_IP_ADDRESS)
 

-- 
To view, visit https://gerrit.osmocom.org/2771
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic017a1cf07052f5e48812c8553fba6f972d280f0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list