laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42742?usp=email )
Change subject: RemsimServer Tests: give the remsim server some time to update the slotmap
......................................................................
RemsimServer Tests: give the remsim server some time to update the slotmap
The check of the slotmap can race if it is requests straight away,
because the slotmap might be still in the slotmap list as long the
bankd hasn't responded yet.
Change-Id: I6784e05380d844aa4bb9cde2bbe648ff37bee91b
---
M remsim/RemsimServer_Tests.ttcn
1 file changed, 9 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/remsim/RemsimServer_Tests.ttcn b/remsim/RemsimServer_Tests.ttcn
index 5850d29..de2c478 100644
--- a/remsim/RemsimServer_Tests.ttcn
+++ b/remsim/RemsimServer_Tests.ttcn
@@ -512,6 +512,9 @@
/* delete the slotmap via REST */
res := f_rsres_delete_slotmap(sm.bank);
+ /* an immediate slotmaps check doesn't work */
+ f_sleep(1.0);
+
/* verify the slotmap is gone */
f_ensure_slotmaps({});
}
@@ -549,6 +552,9 @@
/* delete the slotmap via REST */
res := f_rsres_delete_slotmap(sm.bank);
+ /* an immediate slotmaps check doesn't work */
+ f_sleep(1.0);
+
/* verify the slotmap is gone from REST interface immediately */
f_ensure_slotmaps({});
@@ -600,6 +606,9 @@
/* delete the slotmap via REST */
res := f_rsres_delete_slotmap(sm.bank);
+ /* an immediate slotmaps check doesn't work */
+ f_sleep(1.0);
+
/* verify the slotmap is gone from REST interface immediately */
f_ensure_slotmaps({});
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42742?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6784e05380d844aa4bb9cde2bbe648ff37bee91b
Gerrit-Change-Number: 42742
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Attention is currently required from: lynxis lazus.
laforge has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42742?usp=email )
Change subject: RemsimServer Tests: give the remsim server some time to update the slotmap
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42742?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6784e05380d844aa4bb9cde2bbe648ff37bee91b
Gerrit-Change-Number: 42742
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Wed, 13 May 2026 13:17:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42736?usp=email )
Change subject: card_key_provider: add a static method to parse --column-keys args
......................................................................
card_key_provider: add a static method to parse --column-keys args
The contents of the --column-keys arguments are currently parsed
in init_card_key_provider. Let's add a static method in
CardKeyFieldCryptor to simplify re-usage of the CardKeyFieldCryptor
Related: SYS#6959
Change-Id: Ic955f271b1de1b1b855b21c82ed10343044e45fa
---
M pySim/card_key_provider.py
1 file changed, 19 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/card_key_provider.py b/pySim/card_key_provider.py
index e71daa6..6991cfa 100644
--- a/pySim/card_key_provider.py
+++ b/pySim/card_key_provider.py
@@ -140,6 +140,23 @@
arg_parser.add_argument('--csv-column-key', metavar='FIELD:AES_KEY_HEX', default=[], action='append',
help=argparse.SUPPRESS, dest='column_key')
+ @staticmethod
+ def transport_keys_from_opts(opts: argparse.Namespace) -> dict:
+ """
+ Transport keys are passed via the commandline using the '--column-key' option. Each column requires a
+ dedicated transport key. This method can be used to extract the column keys parameters from the commandline
+ options into a dict that can be directly passed to the construtor with the transport_keys argument.
+
+ Args:
+ opts: parsed commandline options (Namespace)
+ """
+
+ transport_keys = {}
+ for par in opts.column_key:
+ name, key = par.split(':')
+ transport_keys[name] = key
+ return transport_keys
+
class CardKeyProvider(abc.ABC):
"""Base class, not containing any concrete implementation."""
@@ -345,11 +362,8 @@
def card_key_provider_init(opts: argparse.Namespace):
"""Initialize card key provider depending on the user provided commandline options"""
- column_keys = {}
- for par in opts.column_key:
- name, key = par.split(':')
- column_keys[name] = key
- card_key_field_cryptor = CardKeyFieldCryptor(column_keys)
+ transport_keys = CardKeyFieldCryptor.transport_keys_from_opts(opts)
+ card_key_field_cryptor = CardKeyFieldCryptor(transport_keys)
if os.path.isfile(os.path.expanduser(opts.csv)):
card_key_provider_register(CardKeyProviderCsv(os.path.expanduser(opts.csv), card_key_field_cryptor))
if os.path.isfile(os.path.expanduser(opts.pgsql)):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42736?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic955f271b1de1b1b855b21c82ed10343044e45fa
Gerrit-Change-Number: 42736
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42738?usp=email )
Change subject: pySim/app: use pySimLogger instead of print
......................................................................
pySim/app: use pySimLogger instead of print
let's replace the stray print statements with proper logger calls.
Related: SYS#6959
Change-Id: I95b4536cc8853e7ba6a5dd573b903dfb85e56b9a
---
M pySim/app.py
1 file changed, 7 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/app.py b/pySim/app.py
index 23a4c3c..4e88788 100644
--- a/pySim/app.py
+++ b/pySim/app.py
@@ -26,6 +26,9 @@
from pySim.ts_102_221 import CardProfileUICC
from pySim.utils import all_subclasses
from pySim.exceptions import SwMatchError
+from pySim.log import PySimLogger
+
+log = PySimLogger.get(__name__)
# we need to import this module so that the SysmocomSJA2 sub-class of
# CardModel is created, which will add the ATR-based matching and
@@ -54,7 +57,7 @@
# Wait up to three seconds for a card in reader and try to detect
# the card type.
- print("Waiting for card...")
+ log.info("Waiting for card...")
sl.wait_for_card(3)
# The user may opt to skip all card initialization. In this case only the
@@ -66,7 +69,7 @@
generic_card = False
card = card_detect(scc)
if card is None:
- print("Warning: Could not detect card type - assuming a generic card type...")
+ log.warning("Could not detect card type - assuming a generic card type...")
card = SimCardBase(scc)
generic_card = True
@@ -76,7 +79,7 @@
# just means that pySim was unable to recognize the card profile. This
# may happen in particular with unprovisioned cards that do not have
# any files on them yet.
- print("Unsupported card type!")
+ log.warning("Unsupported card type!")
return None, card
# ETSI TS 102 221, Table 9.3 specifies a default for the PIN key
@@ -87,7 +90,7 @@
if generic_card and isinstance(profile, CardProfileUICC):
card._adm_chv_num = 0x0A
- print("Info: Card is of type: %s" % str(profile))
+ log.info("Card is of type: %s", str(profile))
# FIXME: this shouldn't really be here but somewhere else/more generic.
# We cannot do it within pySim/profile.py as that would create circular
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42738?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I95b4536cc8853e7ba6a5dd573b903dfb85e56b9a
Gerrit-Change-Number: 42738
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42737?usp=email )
Change subject: pySimLogger: fix default log format string
......................................................................
pySimLogger: fix default log format string
In format string we prepend when we log in verbose mode. We use %(module)s
as format string quaifier. This qualifier is replaced with the name of the
module from where the logger was called. This is mostly equal to the logger
name (__name__) we pass when we create the logger.
However, this is not the behavior we actually want. We want to log the
logger name that we passed when the logger was created. For this, we must
use %(name)s as qualifier.
Related: SYS#6959
Change-Id: I3951a70ad6ce864a7158b093cba46ae9fc1cb5bd
---
M pySim/log.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/log.py b/pySim/log.py
index 801ad69..345cf78 100644
--- a/pySim/log.py
+++ b/pySim/log.py
@@ -44,7 +44,7 @@
"""
LOG_FMTSTR = "%(levelname)s: %(message)s"
- LOG_FMTSTR_VERBOSE = "%(module)s.%(lineno)d -- " + LOG_FMTSTR
+ LOG_FMTSTR_VERBOSE = "%(name)s.%(lineno)d -- " + LOG_FMTSTR
__formatter = logging.Formatter(LOG_FMTSTR)
__formatter_verbose = logging.Formatter(LOG_FMTSTR_VERBOSE)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42737?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I3951a70ad6ce864a7158b093cba46ae9fc1cb5bd
Gerrit-Change-Number: 42737
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>