Attention is currently required from: osmith.
pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37887?usp=email )
Change subject: testenv: add TESTENV_REBUILD_OUTDATED_IMAGE
......................................................................
Patch Set 1:
(1 comment)
File _testenv/testenv/podman.py:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37887/comment/8f9c5ccd_6ba0… :
PS1, Line 60: logging.debug("Building anyway since --force was used")
oh, so there's already a cmdline param for that? then this commit is just adding yet another way to do the same?
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37887?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: Ia1243320b6d310c69ef9291cca69a1594b1a8a70
Gerrit-Change-Number: 37887
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 21 Aug 2024 14:36:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: osmith.
pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37886?usp=email )
Change subject: testenv/README: describe architecture
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File _testenv/README.md:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37886/comment/13c7a783_fbfc… :
PS1, Line 7: Testenv builds and runs a testsuite and all its test components in the same
One of the problems I faced initially as a user is that I thought it would run by default under a container, but it was not the case unless --podman is passed.
May be worth better explicitly stating what the default behavior is.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37886?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: Ie9eee8cf14ba2069c1cd5bd6ab703f3f6ccdc100
Gerrit-Change-Number: 37886
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 21 Aug 2024 14:34:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37884?usp=email )
Change subject: testenv: cmd: pass all env vars without --podman
......................................................................
testenv: cmd: pass all env vars without --podman
As suggested by Pau, pass all environment variables to through testenv
if it is running without podman. This way a custom TTCN3_DIR,
TTCN3_BIN_DIR and more variables that may make sense when running
directly on the host, work as expected.
Closes: OS#6544
Change-Id: I5e710a1ee7185a3f6f4f1e98f201f3f6fda2be55
---
M _testenv/testenv/cmd.py
1 file changed, 7 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/_testenv/testenv/cmd.py b/_testenv/testenv/cmd.py
index cb8386a..6f502fc 100644
--- a/_testenv/testenv/cmd.py
+++ b/_testenv/testenv/cmd.py
@@ -78,6 +78,13 @@
for var in env:
ret[var] = env[var]
+
+ # Without podman: pass all environment variables from host (OS#6544)
+ if not podman:
+ for var in os.environ:
+ if var not in ret:
+ ret[var] = os.environ.get(var)
+
return ret
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37884?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: I5e710a1ee7185a3f6f4f1e98f201f3f6fda2be55
Gerrit-Change-Number: 37884
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/37888?usp=email )
Change subject: gen_makefile: support symlinks for src + src_proj
......................................................................
gen_makefile: support symlinks for src + src_proj
Support the src and src_proj directories to be symlinks by checking if
these paths exist only (-e), instead of checking if these are
directories (-d).
Add a second check to detect broken symlinks and inform the user about
those, so it does not fail later on with a more confusing error. This
may happen if the user runs testenv inside podman, and has a symlink
pointing to a directory that is not mounted inside podman.
Related: OS#6494
Change-Id: Ic5ffa132b29e0a2ca78b02e4c8c05492471b3966
---
M gen_makefile.py
1 file changed, 19 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/88/37888/1
diff --git a/gen_makefile.py b/gen_makefile.py
index 0476a3f..50405fa 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -221,8 +221,25 @@
return f'''
.make.{proj}.clone:
@echo "\\n\\n\\n===== $@\\n"
- test -d {src} || mkdir -p {src}
- test -d {src_proj} || ( {cmd_clone} && {cmd_set_push_url} )
+
+ @if ! [ -e {src} ]; then \\
+ if [ -L {src} ]; then \\
+ echo "ERROR: broken symlink: {src}"; \\
+ exit 1; \\
+ fi; \\
+ set -x; \\
+ mkdir -p {src}; \\
+ fi
+
+ @if ! [ -e {src_proj} ]; then \\
+ if [ -L {src_proj} ]; then \\
+ echo "ERROR: broken symlink: {src_proj}"; \\
+ exit 1; \\
+ fi; \\
+ set -x; \\
+ ( {cmd_clone} && {cmd_set_push_url} ); \\
+ fi
+
sync
touch $@
'''
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/37888?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: Ic5ffa132b29e0a2ca78b02e4c8c05492471b3966
Gerrit-Change-Number: 37888
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37846?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: pySim.esim.saip: Fix key used in FsProfileElement.files2pe
......................................................................
pySim.esim.saip: Fix key used in FsProfileElement.files2pe
The self.files member is a dict. Hence we should use those dict
keys when [re]building the decoded dict. The previous code ignored
it and re-constructed the key from File.pe_name - but that's not
always identical.
Change-Id: I0e6c97721fb1cfc6b5c21595d85bd374d485b573
---
M pySim/esim/saip/__init__.py
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index 037f7cc..20e2cb4 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -371,9 +371,9 @@
self.files[file.pe_name] = file
def files2pe(self):
- """Update the "decoded" member with the contents of the files member."""
- for f in self.files:
- self.decoded[f.pename] = f.to_tuples()
+ """Update the "decoded" member with the contents of the "files" member."""
+ for k, f in self.files.items():
+ self.decoded[k] = f.to_tuples()
def pe2files(self):
"""Update the "files" member with the contents of the "decoded" member."""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37846?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: I0e6c97721fb1cfc6b5c21595d85bd374d485b573
Gerrit-Change-Number: 37846
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37847?usp=email )
Change subject: pySim.esim.saip.File: move away from stream for file content
......................................................................
pySim.esim.saip.File: move away from stream for file content
Let's linearize the file content in a bytes member variable self.body.
Change-Id: I6cb23a3a644854abd3dfd3b50b586ce80da21353
---
M pySim/esim/saip/__init__.py
1 file changed, 12 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index 20e2cb4..27327b0 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -97,7 +97,7 @@
self.pe_name = pename
self.template = template
self.fileDescriptor = {}
- self.stream = None
+ self.body = None
# apply some defaults from profile
if self.template:
self.from_template(self.template)
@@ -173,7 +173,7 @@
raise ValueError("No fileDescriptor found in tuple, and none set by template before")
if fd:
self.fileDescriptor.update(dict(fd))
- self.stream = self.linearize_file_content(l)
+ self.body = self.linearize_file_content(l)
def from_gfm(self, d: Dict):
print(d)
@@ -184,7 +184,7 @@
raise NotImplementedError
@staticmethod
- def linearize_file_content(l: List[Tuple]) -> Optional[io.BytesIO]:
+ def linearize_file_content(l: List[Tuple]) -> Optional[bytes]:
"""linearize a list of fillFileContent / fillFileOffset tuples into a stream of bytes."""
stream = io.BytesIO()
for k, v in l:
@@ -199,7 +199,14 @@
stream.write(v)
else:
return ValueError("Unknown key '%s' in tuple list" % k)
- return stream
+ return stream.getvalue()
+
+ def file_content_to_tuples(self) -> List[Tuple]:
+ # FIXME: simplistic approach. needs optimization. We should first check if the content
+ # matches the expanded default value from the template. If it does, return empty list.
+ # Next, we should compute the diff between the default value and self.body, and encode
+ # that as a sequence of fillFileOffset and fillFileContent tuples.
+ return [('fillFileContent', self.body)]
def __str__(self) -> str:
return "File(%s)" % self.pe_name
@@ -819,7 +826,7 @@
@property
def imsi(self) -> Optional[str]:
f = File('ef-imsi', self.decoded['ef-imsi'])
- return dec_imsi(b2h(f.stream.getvalue()))
+ return dec_imsi(b2h(f.body))
class ProfileElementOptUSIM(FsProfileElement):
type = 'opt-usim'
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37847?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: I6cb23a3a644854abd3dfd3b50b586ce80da21353
Gerrit-Change-Number: 37847
Gerrit-PatchSet: 6
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37837?usp=email )
Change subject: pySim.esim.saip: Move AKA specific post_dec + pre_enc to AKA subclass
......................................................................
pySim.esim.saip: Move AKA specific post_dec + pre_enc to AKA subclass
Having AKA specific code in the generic ProfileElement base class dated
back to when we didn't have a ProfileElementAKA subclass.
Change-Id: Icd332183758b8ef20a77507b728f5e455698def0
---
M pySim/esim/saip/__init__.py
1 file changed, 31 insertions(+), 31 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index 90d63db..fb2097a 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -235,33 +235,6 @@
if mandated:
self.decoded[self.header_name] = { 'mandated': None}
- def _fixup_sqnInit_dec(self) -> None:
- """asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around
- this."""
- if self.type != 'akaParameter':
- return
- sqn_init = self.decoded.get('sqnInit', None)
- if not sqn_init:
- return
- # this weird '0x' value in a string is what we get from our (slightly hacked) ASN.1 syntax
- if sqn_init == '0x000000000000':
- # SEQUENCE (SIZE (32)) OF OCTET STRING (SIZE (6))
- self.decoded['sqnInit'] = [b'\x00'*6] * 32
-
- def _fixup_sqnInit_enc(self) -> None:
- """asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around
- this."""
- if self.type != 'akaParameter':
- return
- sqn_init = self.decoded.get('sqnInit', None)
- if not sqn_init:
- return
- for s in sqn_init:
- if any(s):
- return
- # none of the fields were initialized with a non-default (non-zero) value, so we can skip it
- del self.decoded['sqnInit']
-
@property
def header_name(self) -> str:
"""Return the name of the header field within the profile element."""
@@ -337,8 +310,6 @@
else:
inst = ProfileElement(decoded)
inst.type = pe_type
- # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF
- inst._fixup_sqnInit_dec()
# run any post-decoder a derived class may have
if hasattr(inst, '_post_decode'):
inst._post_decode()
@@ -349,8 +320,6 @@
# run any pre-encoder a derived class may have
if hasattr(self, '_pre_encode'):
self._pre_encode()
- # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF
- self._fixup_sqnInit_enc()
return asn1.encode('ProfileElement', (self.type, self.decoded))
def __str__(self) -> str:
@@ -861,6 +830,37 @@
# provide some reasonable defaults for a MNO-SD
self.set_milenage(b'\x00'*16, b'\x00'*16)
+ def _fixup_sqnInit_dec(self) -> None:
+ """asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around
+ this."""
+ sqn_init = self.decoded.get('sqnInit', None)
+ if not sqn_init:
+ return
+ # this weird '0x' value in a string is what we get from our (slightly hacked) ASN.1 syntax
+ if sqn_init == '0x000000000000':
+ # SEQUENCE (SIZE (32)) OF OCTET STRING (SIZE (6))
+ self.decoded['sqnInit'] = [b'\x00'*6] * 32
+
+ def _fixup_sqnInit_enc(self) -> None:
+ """asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around
+ this."""
+ sqn_init = self.decoded.get('sqnInit', None)
+ if not sqn_init:
+ return
+ for s in sqn_init:
+ if any(s):
+ return
+ # none of the fields were initialized with a non-default (non-zero) value, so we can skip it
+ del self.decoded['sqnInit']
+
+ def _post_decode(self):
+ # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF
+ self._fixup_sqnInit_dec()
+
+ def _pre_encode(self):
+ # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF
+ self._fixup_sqnInit_enc()
+
def set_milenage(self, k: bytes, opc: bytes):
"""Configure akaParametes for MILENAGE."""
self.decoded['algoConfiguration'] = ('algoParameter', {
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37837?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: Icd332183758b8ef20a77507b728f5e455698def0
Gerrit-Change-Number: 37837
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>