Attention is currently required from: laforge.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/38195?usp=email )
Change subject: filesystem: pass total_len to construct of when encoding file contents
......................................................................
Patch Set 5:
(1 comment)
File pySim/filesystem.py:
https://gerrit.osmocom.org/c/pysim/+/38195/comment/85398d26_0eeb58bd?usp=em… :
PS2, Line 1338: def _decode_bin(self, raw_bin_data: bytearray):
: chunks = [raw_bin_data[i:i+self.rec_len]
: for i in range(0, len(raw_bin_data), self.rec_len)]
: return [self.decode_record_bin(x) for x in chunks]
:
: def _encode_bin(self, abstract_data) -> bytes:
: chunks = [self.encode_record_bin(x) for x in abstract_data]
: # FIXME: pad to file size
: return b''.join(chunks)
> Thanks for the explaination, I think I got my head around this now. […]
I am still not sure about the kwargs scheme used with the methods. I wonder if it makes sense to have this. We probably won't add new parameters all too often. Maybe it makes more sense to have explicit keyword parameters instead. Let me know what you think.
--
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: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1b7a51594fbc5d9fe01132c39354a2fa88d53f9b
Gerrit-Change-Number: 38195
Gerrit-PatchSet: 5
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-Comment-Date: Tue, 24 Sep 2024 10:44:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38285?usp=email
to look at the new patch set (#2).
Change subject: testenv: improve --config argument parsing
......................................................................
testenv: improve --config argument parsing
* Fix that it didn't complain about an 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/2
--
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: newpatchset
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I66b976b0332be523c084a6b5d38d0f62134b495d
Gerrit-Change-Number: 38285
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
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 (#5).
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
M tests/pySim-shell_test/file_content/test_record_uicc.ok
8 files changed, 98 insertions(+), 41 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/95/38195/5
--
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: 5
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>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38284?usp=email )
Change subject: Cosmetic: testenv: fix line length
......................................................................
Cosmetic: testenv: fix line length
Run "ruff format", so there isn't a diff anymore when running it on
future patches.
Change-Id: I766a07c6d54d0da11ad47acce1fc07b4b3a4801b
---
M _testenv/testenv/podman.py
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/84/38284/1
diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py
index 53806a4..0ecf12d 100644
--- a/_testenv/testenv/podman.py
+++ b/_testenv/testenv/podman.py
@@ -132,8 +132,7 @@
def exec_cmd(cmd, podman_opts=[], cwd=None, env={}, *args, **kwargs):
if not container_name:
- raise RuntimeError("Attempting to execute a command in podman, but the"
- f" container isn't running anymore: {cmd}")
+ raise RuntimeError(f"Attempting to execute a command in podman, but the container isn't running anymore: {cmd}")
podman_opts = list(podman_opts)
podman_opts += generate_env_podman(env)
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38284?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: I766a07c6d54d0da11ad47acce1fc07b4b3a4801b
Gerrit-Change-Number: 38284
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38283?usp=email )
Change subject: ruff.toml: new file
......................................................................
ruff.toml: new file
Add a file in the root dir of the repository to allow running
"ruff format" in order to auto-format the code with expected max line
length, PEP-8, etc.
Replace _testenv/pyproject.toml with .ruff.toml in the root directory of
the repository, so we can exclude "compare-results.py" which doesn't
follow that code style. Otherwise it would get formatted too when
running "ruff format" in the root dir of the repository.
Change-Id: I97ed1ececba85008ca754cf91bf46522e168a894
---
A .ruff.toml
D _testenv/pyproject.toml
2 files changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/83/38283/1
diff --git a/.ruff.toml b/.ruff.toml
new file mode 100644
index 0000000..ad8c0b5
--- /dev/null
+++ b/.ruff.toml
@@ -0,0 +1,4 @@
+line-length = 120
+exclude = [
+ "compare-results.py",
+]
diff --git a/_testenv/pyproject.toml b/_testenv/pyproject.toml
deleted file mode 100644
index 3719b74..0000000
--- a/_testenv/pyproject.toml
+++ /dev/null
@@ -1,2 +0,0 @@
-[tool.ruff]
-line-length=120
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38283?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: I97ed1ececba85008ca754cf91bf46522e168a894
Gerrit-Change-Number: 38283
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
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