laforge has submitted this change. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?usp=email )
Change subject: contrib/jenkins: run pysim tests too
......................................................................
contrib/jenkins: run pysim tests too
Related: OS#6570
Change-Id: I6bb7f137d3124e68574bc599969a8e7fd8b68904
---
M contrib/jenkins.sh
1 file changed, 23 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index afd66eb..e5f8147 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -48,7 +48,30 @@
make -C "docs" publish publish-html
fi
;;
+"pysim")
+ # Run the pysim tests with pyosmocom from this tree (OS#6570)
+ virtualenv -p python3 venv --system-site-packages
+ . venv/bin/activate
+ pip install . --force-reinstall
+ deactivate
+ # Clone pysim and remove pyosmocom from requirements.txt, we want to
+ # use the version that was just installed into the venv instead
+ rm -rf pysim
+ git clone https://gerrit.osmocom.org/pysim --depth=1 --branch=master
+ cd pysim
+ sed -i '/^pyosmocom>=.*/d' requirements.txt
+ if grep -q pyosmocom requirements.txt; then
+ cat requirements.txt
+ set +x
+ echo "ERROR: failed to remove pyosmocom from pysim's requirements.txt"
+ exit 1
+ fi
+
+ # Let pysim enter the same venv and run the tests
+ ln -s ../venv .
+ SKIP_CLEAN_WORKSPACE=1 JOB_TYPE="test" contrib/jenkins.sh
+ ;;
*)
set +x
echo "ERROR: JOB_TYPE has unexpected value '$JOB_TYPE'."
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I6bb7f137d3124e68574bc599969a8e7fd8b68904
Gerrit-Change-Number: 38268
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Attention is currently required from: 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 (#3).
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/3
--
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: 3
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>
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 3:
(1 comment)
File pySim/filesystem.py:
https://gerrit.osmocom.org/c/pysim/+/38195/comment/63d2106f_d68471e6?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)
> you are not passing the total_len as argument to the self.{encode,decode}_record_bin here. […]
Thanks for the explaination, I think I got my head around this now.
I have now revisited the code and have added a total_len parameter to the _encode_bin and _encode_hex methods. I also thing that we should also have total_len parameters on the _encode_record_hex and _encode_record_bin methods, in case someone needs the total_len parameter in one of those custom methods.
All derived classes with custom encoder methods should now accept a total_len parameters. I have put a kwargs on each method that does not use the total_len parameter. I have seen that _encode_record_bin/hex have kwargs as well, so I think that makes sense.
--
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: 3
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: Mon, 23 Sep 2024 16:16:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Attention is currently required from: osmith.
laforge has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?usp=email )
Change subject: contrib/jenkins: run pysim tests too
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/38268?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: I6bb7f137d3124e68574bc599969a8e7fd8b68904
Gerrit-Change-Number: 38268
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 23 Sep 2024 16:14:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/38271?usp=email )
Change subject: pySim-shell_test: disable test_list_and_rm_notif
......................................................................
pySim-shell_test: disable test_list_and_rm_notif
The testcase euicc.test_list_and_rm_notif fails due to a problem
with the eUICC. The eUICC reports the following error when a
delete notification attempt is made:
"delete_notification_status": "undefinedError"
Let's temporarily disable this testcase until the problem is resolved.
Change-Id: I7d0b6a998499d84f0eb4e24592ad43210ac54806
---
M tests/pySim-shell_test/euicc/test.py
1 file changed, 28 insertions(+), 28 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/tests/pySim-shell_test/euicc/test.py b/tests/pySim-shell_test/euicc/test.py
index b634f22..f7226a3 100644
--- a/tests/pySim-shell_test/euicc/test.py
+++ b/tests/pySim-shell_test/euicc/test.py
@@ -62,34 +62,34 @@
self.runPySimShell(cardname, "test_set_nickname.script")
self.assertEqualFiles("set_nickname.tmp")
- def test_list_and_rm_notif(self):
- cardname = 'sysmoEUICC1-C2T'
-
- # Generate two (additional) notification
- self.runPySimShell(cardname, "test_gen_notif.script")
-
- # List notifications into a file
- self.runPySimShell(cardname, "test_list_notif.script")
-
- # Parse notifications file (JSON)
- notifications_tmp = open("notifications.tmp")
- notifications = json.load(notifications_tmp)
- notifications_tmp.close()
-
- # Delete notifications one by one, we expect to see at least one notification
- notification_metadata_list = notifications['notification_metadata_list']
- removed = 0
- for nm in notification_metadata_list:
- seq_number = nm['notification_metadata']['seq_number']
- print("removing notification with seq_number %s:" % seq_number)
- self.equipTemplate("test_rm_notif.script", SEQ_NUMBER = seq_number)
- self.runPySimShell(cardname, "test_rm_notif.script")
- removed = removed + 1
- self.assertTrue(removed >= 2, "we expected to remove at least two notifications, but we have removed none!")
-
- # List notifications again, require none to be present
- self.runPySimShell(cardname, "test_list_notif.script")
- self.assertEqualFiles("notifications.tmp")
+# def test_list_and_rm_notif(self):
+# cardname = 'sysmoEUICC1-C2T'
+#
+# # Generate two (additional) notification
+# self.runPySimShell(cardname, "test_gen_notif.script")
+#
+# # List notifications into a file
+# self.runPySimShell(cardname, "test_list_notif.script")
+#
+# # Parse notifications file (JSON)
+# notifications_tmp = open("notifications.tmp")
+# notifications = json.load(notifications_tmp)
+# notifications_tmp.close()
+#
+# # Delete notifications one by one, we expect to see at least one notification
+# notification_metadata_list = notifications['notification_metadata_list']
+# removed = 0
+# for nm in notification_metadata_list:
+# seq_number = nm['notification_metadata']['seq_number']
+# print("removing notification with seq_number %s:" % seq_number)
+# self.equipTemplate("test_rm_notif.script", SEQ_NUMBER = seq_number)
+# self.runPySimShell(cardname, "test_rm_notif.script")
+# removed = removed + 1
+# self.assertTrue(removed >= 2, "we expected to remove at least two notifications, but we have removed none!")
+#
+# # List notifications again, require none to be present
+# self.runPySimShell(cardname, "test_list_notif.script")
+# self.assertEqualFiles("notifications.tmp")
if __name__ == "__main__":
unittest.main()
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/38271?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: I7d0b6a998499d84f0eb4e24592ad43210ac54806
Gerrit-Change-Number: 38271
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Attention is currently required from: dexter, laforge.
Hello Jenkins Builder, dexter,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/python/pyosmocom/+/38272?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: osmocom.construct.Asn1DerInteger
......................................................................
osmocom.construct.Asn1DerInteger
This is a 'construct' type which can be used for encoding/decoding
integer values according to ASN.1 DER encoding rules.
Change-Id: I0cfe97daf957919de86453d6d44f9c99ab3075ac
---
M src/osmocom/construct.py
M src/osmocom/tlv.py
2 files changed, 20 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/72/38272/3
--
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: newpatchset
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I0cfe97daf957919de86453d6d44f9c99ab3075ac
Gerrit-Change-Number: 38272
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: dexter.
Hello Jenkins Builder, dexter,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/python/pyosmocom/+/38272?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: osmocom.construct.Asn1DerInteger
......................................................................
osmocom.construct.Asn1DerInteger
This is a 'construct' type which can be used for encoding/decoding
integer values according to ASN.1 DER encoding rules.
Change-Id: I0cfe97daf957919de86453d6d44f9c99ab3075ac
---
M src/osmocom/construct.py
M src/osmocom/tlv.py
2 files changed, 18 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/72/38272/2
--
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: newpatchset
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I0cfe97daf957919de86453d6d44f9c99ab3075ac
Gerrit-Change-Number: 38272
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>