library/Misc_Helpers: add f_osmo_repo_is()

Create functions to check which from Osmocom repository the SUT is
running. Put it in Misc_Helpers instead of a new library file since
Misc_Helpers is already available in many/all? tests and it fits there
too.

Depends: docker-playground Ic06532f7a67e59458652c5cf4c8f6fee8113e703
Related: OS#5327
Change-Id: Ic33d08992ea84af006d133db6aec508a7b7c7f28
This commit is contained in:
Oliver Smith 2021-11-26 13:30:13 +01:00 committed by laforge
parent fff454062a
commit 8b6d1804e1
1 changed files with 17 additions and 0 deletions

View File

@ -1,5 +1,22 @@
module Misc_Helpers {
modulepar {
charstring mp_osmo_repo := "nightly";
}
/* Test the Osmocom repository (nightly, latest, 2021q4, ...), from which the
* SUT is running (OS#4878). Usage examples:
* if (Misc_Helpers.f_osmo_repo_is("nightly")) {
* ...
* }
* if (Misc_Helpers.f_osmo_repo_is(("nightly", "2021q4"))) {
* ...
* }
*/
function f_osmo_repo_is(template charstring ver) return boolean {
return match(mp_osmo_repo, ver);
}
/* Try to properly shutdown a testcase.
* The reliable method to stop a testcase without running into dynamic
* testcase errors due to unconnected ports receiving messages is to call