dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41250?usp=email )
Change subject: ES2Plus_Tests: cleanup/add module parameters
......................................................................
ES2Plus_Tests: cleanup/add module parameters
The ES2Plus_Tests only have minimal configuration options. Let's remove
hardcoded options and replace them with module parameters. Let's also
document the module parameters.
Change-Id: Ib8e128e4af8e819799c4d7ea3e6a36189462f382
Related: SYS#7339
---
M smdpp/ES2Plus_Tests.ttcn
1 file changed, 39 insertions(+), 17 deletions(-)
Approvals:
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/smdpp/ES2Plus_Tests.ttcn b/smdpp/ES2Plus_Tests.ttcn
index c6e84cd..3303d7d 100644
--- a/smdpp/ES2Plus_Tests.ttcn
+++ b/smdpp/ES2Plus_Tests.ttcn
@@ -30,22 +30,44 @@
const charstring c_eid1 := "89049032123451234512345678901235";
const charstring c_eid2 := "89049032123451234512345678901236";
-// Client certificate paths
-const charstring c_cert_path := "./test_certs/CERT_MNO_ECDSA_NIST.pem";
-const charstring c_key_path := "./test_certs/SK_MNO_ECDSA_NIST.pem";
-
-// Wrong certificate for testing
+// Wrong certificate for testing (randomly picked from the sgp26 directory)
const charstring c_wrong_cert_path := "./sgp26/eUICC/CERT_EUICC_ECDSA_NIST.der";
const charstring c_wrong_key_path := "./sgp26/eUICC/SK_EUICC_ECDSA_NIST.pem";
+// The external function ext_RSPClient_create requires a path and a name filter as input to load test certificates.
+// While those certfiicates are required for the ES9+ interface related tests (smdpp_Tests.ttcn), for the ES2+
+// interface tests those certificates have no relevance.
+const charstring c_es2plus_cert_path := "./sgp26/";
+const charstring c_es2plus_cert_name_filter := "NIST";
+
// Module parameters
modulepar {
+ // The SMDP server host name (FQDN) must match the host name of the SSL certificate of the server. To resolve the
+ // server host name to an IP address, an entry in /etc/hosts is sufficient. It should also be pointed out that this
+ // testsuite (libcurl) will also verify the presented server certificate against the related CA. To ensure that
+ // the server certificate verification is possible, ensure that the related CA certificates are made available in
+ // /etc/ssl/certs
charstring mp_es2plus_server_host := "testsmdpplus1.example.com";
- integer mp_es9_server_port := 8000;
- integer mp_es2plus_server_port := 8000; // NIST tests use port 8000
+
+ // Sets the server port of the ES2+ server (SM-DP+).
+ integer mp_es2plus_server_port := 8000;
+
+ // Sets the client certificate to be used to authenticate towards the ES2+ server (SM-DP+)
+ charstring mp_es2plus_client_cert_path := "./test_certs/CERT_MNO_ECDSA_NIST.pem";
+
+ // Sets the private key to be used to authenticate towards the ES2+ server (SM-DP+)
+ charstring mp_es2plus_client_key_path := "./test_certs/SK_MNO_ECDSA_NIST.pem";
+
+ // Sets the operator ID to be used on the ES2+ interface. (this parameter has no relation to SSL/TLS)
charstring mp_operator_id := "test.operator.com";
- charstring mp_nist_rsp_cert_path := "./sgp26/";
+
+ // ES2+ normally uses SSL with client authentication, however for debug purposes it is possible to disable
+ // SSL entirely.
boolean mp_use_ssl := true; // SSL with mutual TLS authentication enabled
+
+ // ES2+ normally uses SSL with client authentication, however for debug purposes it is possible to disable
+ // mutual authentication.
+ boolean mp_use_mutual_tls := true;
}
// Test component - extend smdpp_ConnHdlr to reuse RSPClient functionality
@@ -175,8 +197,8 @@
g_rsp_client_handle := smdpp_Tests.ext_RSPClient_create(
mp_es2plus_server_host,
mp_es2plus_server_port,
- mp_nist_rsp_cert_path,
- "NIST"
+ c_es2plus_cert_path,
+ c_es2plus_cert_name_filter
);
if (g_rsp_client_handle < 0) {
@@ -187,9 +209,9 @@
// Set authentication parameters once for all ES2+ operations
var integer result := smdpp_Tests.ext_RSPClient_setAuthParams(
g_rsp_client_handle,
- true, // useMutualTLS
- c_cert_path,
- c_key_path
+ mp_use_mutual_tls,
+ mp_es2plus_client_cert_path,
+ mp_es2plus_client_key_path
);
if (result != 0) {
@@ -961,7 +983,7 @@
// Temporarily set wrong authentication parameters
var integer result := smdpp_Tests.ext_RSPClient_setAuthParams(
g_rsp_client_handle,
- true, // useMutualTLS
+ mp_use_mutual_tls,
c_wrong_cert_path, // Using wrong certificate
c_wrong_key_path // Using wrong key
);
@@ -994,9 +1016,9 @@
// Restore correct auth params for cleanup
smdpp_Tests.ext_RSPClient_setAuthParams(
g_rsp_client_handle,
- true,
- c_cert_path,
- c_key_path
+ mp_use_mutual_tls,
+ mp_es2plus_client_cert_path,
+ mp_es2plus_client_key_path
);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41250?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: Ib8e128e4af8e819799c4d7ea3e6a36189462f382
Gerrit-Change-Number: 41250
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Attention is currently required from: dexter, fixeria, laforge.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41229?usp=email
to look at the new patch set (#8).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: pySim-shell: add a logger class to centralize logging
......................................................................
pySim-shell: add a logger class to centralize logging
In many sub modules we still use print() to occassionally print status
messages or warnings. This technically does not hurt, but it is an unclean
solution which we should replace with something more mature.
Let's use python's built in logging framework to create a static logger
class that fits our needs. To maintain compatibility let's also make sure
that the logger class will behave like a normal print() statement when no
configuration parameters are supplied by the API user.
To illustrate how the approach can be used in sub-modules, this patch
replaces the print statements in runtime.py. The other print statements
will the be fixed in follow-up patches.
Related: OS#6864
Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
---
M pySim-shell.py
A pySim/log.py
M pySim/runtime.py
M tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok
A tests/unittests/test_log.py
5 files changed, 289 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/41229/8
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41229?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: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
Gerrit-Change-Number: 41229
Gerrit-PatchSet: 8
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: fixeria, laforge.
Jenkins Builder has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41229?usp=email )
Change subject: pySim-shell: add a logger class to centralize logging
......................................................................
Patch Set 7:
(1 comment)
File tests/unittests/test_log.py:
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/pysim/+/41229/comment/04959703_702d05f8?usp=em… :
PS7, Line 41: # When log messages are sent to an unconfigured PySimLogger class, we expect the unmodified message beeing
'beeing' may be misspelled - perhaps 'being'?
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41229?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: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
Gerrit-Change-Number: 41229
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 24 Oct 2025 10:36:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: fixeria, laforge.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41229?usp=email )
Change subject: pySim-shell: add a logger class to centralize logging
......................................................................
Patch Set 7:
(5 comments)
Patchset:
PS1:
> Yes, I think using pythons logging framework is the better option here.
Done
Patchset:
PS6:
> It would be nice to have a command line option `-v/--verbose` to increase logging verbosity of pySim […]
I have now added method to control the log level and the verbosity. In pySim-shell i have have now added a setable "verbose" that uses both methods in a simplified way. I also don't think that we need much here. In any case debugging will become a lot easier when we see the module name and the line number in the log.
File pySim/log.py:
https://gerrit.osmocom.org/c/pysim/+/41229/comment/307c21c4_a38fae9b?usp=em… :
PS6, Line 62: staticmethod
> You can use the `@classmethod` instead, which allows to reference "this class". […]
I think I have tried that, but _log_callback is passed to PySimLogHandler and this class may have problems with the cls parameter. I think I have tried that. At least @staticmethod worked better for me.
File pySim/runtime.py:
https://gerrit.osmocom.org/c/pysim/+/41229/comment/55f0c876_d059ad11?usp=em… :
PS6, Line 48: self.log = PySimLogger.get("RuntimeState")
> A more usual approach is to have a module-local logger: […]
I have now changed it to a module local logger. Makes sense. I found out that we can always get the module name from the logger (%(module)s). The parameter we give to getLogger may be just an arbitrary name (%(name)s).
So I think we should get the log using
log = PySimLogger.get("ABC")
"ABC" is then the log facility.
File tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok:
https://gerrit.osmocom.org/c/pysim/+/41229/comment/1c43327f_c68d1adb?usp=em… :
PS6, Line 9: USIM: a0000000871002
> is it intentional that we're loosing this output in the unit test? […]
This was intentional with the previous approach (even though it was not a good idea, but I thought that those messages were dispensable in the pySim-trace usecase).
Since the current approach should not alter the behavior of existing code by default we should not get the messages of course. However there still may be slight alterations. Insisting on not changing any output in the slightest way would require a lot of extra code in PySimLogger. At the moment we still lose the "warning: " prefix in one line. I think that this is acceptable.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41229?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: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
Gerrit-Change-Number: 41229
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 24 Oct 2025 10:36:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: fixeria, laforge.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41229?usp=email
to look at the new patch set (#7).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: pySim-shell: add a logger class to centralize logging
......................................................................
pySim-shell: add a logger class to centralize logging
In many sub modules we still use print() to occassionally print status
messages or warnings. This technically does not hurt, but it is an unclean
solution which we should replace with something more mature.
Let's use python's built in logging framework to create a static logger
class that fits our needs. To maintain compatibility let's also make sure
that the logger class will behave like a normal print() statement when no
configuration parameters are supplied by the API user.
To illustrate how the approach can be used in sub-modules, this patch
replaces the print statements in runtime.py. The other print statements
will the be fixed in follow-up patches.
Related: OS#6864
Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
---
M pySim-shell.py
A pySim/log.py
M pySim/runtime.py
M tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok
A tests/unittests/test_log.py
5 files changed, 289 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/41229/7
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41229?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: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
Gerrit-Change-Number: 41229
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: keith.
osmith has posted comments on this change by keith. ( https://gerrit.osmocom.org/c/osmo-msc/+/41221?usp=email )
Change subject: sqlite optimisation: check VLR earlier for dest. subscriber
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
File src/libmsc/db.c:
https://gerrit.osmocom.org/c/osmo-msc/+/41221/comment/62c52f81_b797cdb2?usp… :
PS2, Line 759: "Subscriber %s%s is not attached, skipping SMS.\n",
```suggestion
"Subscriber %s%s is not attached, skipping SMS\n",
```
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/41221?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ibd07b9d200b48108d705ed4c461cc4ddfa421fd2
Gerrit-Change-Number: 41221
Gerrit-PatchSet: 2
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: keith <keith(a)rhizomatica.org>
Gerrit-Comment-Date: Fri, 24 Oct 2025 07:00:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: fixeria, keith, pespin.
osmith has posted comments on this change by keith. ( https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email )
Change subject: sqlite optimisation: Avoid unneeded database operation
......................................................................
Patch Set 7: Code-Review+2
(1 comment)
File src/libmsc/db.c:
https://gerrit.osmocom.org/c/osmo-msc/+/28340/comment/aabee786_c13e0fb3?usp… :
PS4, Line 302: id = $id LIMIT 1
> Not sure if this really a standard practice, given that not all database bacnends support the `LIMIT […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I777155c0f818b979c636bb59953719e472771603
Gerrit-Change-Number: 28340
Gerrit-PatchSet: 7
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: keith <keith(a)rhizomatica.org>
Gerrit-Comment-Date: Fri, 24 Oct 2025 06:44:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: keith <keith(a)rhizomatica.org>