osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38285?usp=email )
Change subject: testenv: improve --config argument parsing
......................................................................
testenv: improve --config argument parsing
* Fix that it didn't complain about and invalid --config argument, as
long as there was a valid --config argument before it.
* Let raise_error_config_arg only output the invalid --config argument
instead of all of them.
* Complain if "--config all" is used in combination with another
--config argument.
Change-Id: I66b976b0332be523c084a6b5d38d0f62134b495d
---
M _testenv/testenv/testenv_cfg.py
1 file changed, 21 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/85/38285/1
diff --git a/_testenv/testenv/testenv_cfg.py b/_testenv/testenv/testenv_cfg.py
index 9642ae8..5124a47 100644
--- a/_testenv/testenv/testenv_cfg.py
+++ b/_testenv/testenv/testenv_cfg.py
@@ -134,14 +134,14 @@
get_vty_host_port(cfg, path)
-def raise_error_config_arg(glob_result):
+def raise_error_config_arg(glob_result, config_arg):
valid = []
for path in glob_result:
basename = os.path.basename(path)
if basename != "testenv.cfg":
valid += [basename.split("_", 1)[1].split(".", -1)[0]]
- msg = f"Invalid parameter for --config: {testenv.args.config}"
+ msg = f"Invalid parameter for --config: {config_arg}"
if valid:
msg += f" (valid: all, {', '.join(valid)})"
@@ -185,6 +185,8 @@
def init():
global cfgs
+ cfgs_all = {}
+
config_paths = find_configs()
for path in config_paths:
@@ -201,14 +203,24 @@
handle_latest(cfg, path)
verify(cfg, path)
+ # No --config argument given, and there is only one testenv.cfg
if not testenv.args.config:
cfgs[basename] = cfg
+ return
+
+ cfgs_all[basename] = cfg
+
+ # Select configs based on --config argument(s)
+ for config_arg in testenv.args.config:
+ if config_arg == "all":
+ if len(testenv.args.config) != 1:
+ raise testenv.NoTraceException("Can't use multiple --config arguments if one of them is 'all'")
+ cfgs = cfgs_all
+ return
+
+ basename = f"testenv_{config_arg}.cfg"
+ if basename in cfgs_all:
+ cfgs[basename] = cfgs_all[basename]
continue
- for config_arg in testenv.args.config:
- if config_arg == "all" or f"testenv_{config_arg}.cfg" == basename:
- cfgs[basename] = cfg
- break
-
- if not cfgs:
- raise_error_config_arg(config_paths)
+ raise_error_config_arg(config_paths, config_arg)
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38285?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I66b976b0332be523c084a6b5d38d0f62134b495d
Gerrit-Change-Number: 38285
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Attention is currently required from: dexter, laforge.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/38195?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: filesystem: pass total_len to construct of when encoding file contents
......................................................................
filesystem: pass total_len to construct of when encoding file contents
In our construct models we frequently use a context parameter "total_len",
we also pass this parameter to construct when we decode files, but we
do not pass it when we generate files. This is a problem, because when
total_len is used in the construct model, this parameter must be known
also when decoding the file.
Let's make sure that the total_len is properly determined and and passed
to construct (via pyosmocom)
Related: OS#5714
Change-Id: I1b7a51594fbc5d9fe01132c39354a2fa88d53f9b
---
M pySim/filesystem.py
M pySim/gsm_r.py
M pySim/runtime.py
M pySim/sysmocom_sja2.py
M pySim/ts_31_102.py
M pySim/ts_31_102_telecom.py
M pySim/ts_51_011.py
7 files changed, 94 insertions(+), 37 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/95/38195/4
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/38195?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1b7a51594fbc5d9fe01132c39354a2fa88d53f9b
Gerrit-Change-Number: 38195
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: laforge.
dexter has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/38272?usp=email )
Change subject: osmocom.construct.Asn1DerInteger
......................................................................
Patch Set 4:
(1 comment)
File src/osmocom/construct.py:
https://gerrit.osmocom.org/c/python/pyosmocom/+/38272/comment/74b9bf8f_ff69… :
PS4, Line 633: val = tlv.bertlv_encode_len(obj)
perhaps tlv.bertlv_encode_len() is not the correct API? When I get the docstring right, then it would encode a length value, but the obj is the value of the integer we want to encapsulate. That is why we get the 8180, when we try to encode 128.
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/38272?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I0cfe97daf957919de86453d6d44f9c99ab3075ac
Gerrit-Change-Number: 38272
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 24 Sep 2024 09:38:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: laforge.
dexter has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/38272?usp=email )
Change subject: osmocom.construct.Asn1DerInteger
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
I have tested it, but it appears to be even more off.
pySIM-shell (00:MF/ADF.ISD-R)> remove_notification_from_list 128
-> 80E2910007 bf300480028180
user@work:~/work/git_master/pysim$ ./contrib/unber.py --hex bf300480028180
bf30 l=4
80 l=2 8180
The length seems to be ok now, but the value does not look right.
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/38272?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I0cfe97daf957919de86453d6d44f9c99ab3075ac
Gerrit-Change-Number: 38272
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 24 Sep 2024 09:26:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No