Attention is currently required from: dexter.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/38629?usp=email )
Change subject: pySim-shell_test/utils: treat cmd2 error "not a recognized command... as exception
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/38629?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: I17be6af1547b31170622e17b9cfb9c492597670d
Gerrit-Change-Number: 38629
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 07 Nov 2024 04:20:13 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/38608?usp=email )
Change subject: pySim-shell: add new commandline option "--skip-card-init"
......................................................................
pySim-shell: add new commandline option "--skip-card-init"
by default pySim-shell does all kinds of probing and file selection
on startup. This is to determine the card type and to find a suitable
card profile. However, in case the card is non yet provisioned this
probing may cause a error messages and even might upset the cards
internal state. So let's have a commandline option thrugh which we
can instruct pySim-shell to skip any initialization and to give us
a prompt immediately, so that we can enter custom APDUs
Related: OS#6367
Change-Id: I1d8a57de201fe7ad7cbcbc6f72969ea8521e821d
---
M pySim-shell.py
M pySim/app.py
M tests/pySim-shell_test/utils.py
3 files changed, 15 insertions(+), 4 deletions(-)
Approvals:
laforge: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/pySim-shell.py b/pySim-shell.py
index 413d3f7..b2de874 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -1060,6 +1060,8 @@
help="Use automatic card handling machine")
global_group.add_argument("--noprompt", help="Run in non interactive mode",
action='store_true', default=False)
+global_group.add_argument("--skip-card-init", help="Skip all card/profile initialization",
+ action='store_true', default=False)
adm_group = global_group.add_mutually_exclusive_group()
adm_group.add_argument('-a', '--pin-adm', metavar='PIN_ADM1', dest='pin_adm', default=None,
@@ -1105,7 +1107,7 @@
# is no card in the reader or the card is unresponsive. PysimApp is
# able to tolerate and recover from that.
try:
- rs, card = init_card(sl)
+ rs, card = init_card(sl, opts.skip_card_init)
app = PysimApp(card, rs, sl, ch)
except:
startup_errors = True
diff --git a/pySim/app.py b/pySim/app.py
index 5a93f98..23a4c3c 100644
--- a/pySim/app.py
+++ b/pySim/app.py
@@ -19,7 +19,7 @@
from pySim.transport import LinkBase
from pySim.commands import SimCardCommands
from pySim.filesystem import CardModel, CardApplication
-from pySim.cards import card_detect, SimCardBase, UiccCardBase
+from pySim.cards import card_detect, SimCardBase, UiccCardBase, CardBase
from pySim.runtime import RuntimeState
from pySim.profile import CardProfile
from pySim.cdma_ruim import CardProfileRUIM
@@ -42,7 +42,7 @@
import pySim.global_platform
import pySim.euicc
-def init_card(sl: LinkBase) -> Tuple[RuntimeState, SimCardBase]:
+def init_card(sl: LinkBase, skip_card_init: bool = False) -> Tuple[RuntimeState, SimCardBase]:
"""
Detect card in reader and setup card profile and runtime state. This
function must be called at least once on startup. The card and runtime
@@ -57,6 +57,12 @@
print("Waiting for card...")
sl.wait_for_card(3)
+ # The user may opt to skip all card initialization. In this case only the
+ # most basic card profile is selected. This mode is suitable for blank
+ # cards that need card O/S initialization using APDU scripts first.
+ if skip_card_init:
+ return None, CardBase(scc)
+
generic_card = False
card = card_detect(scc)
if card is None:
diff --git a/tests/pySim-shell_test/utils.py b/tests/pySim-shell_test/utils.py
index c3cf7a2..8dbeebb 100644
--- a/tests/pySim-shell_test/utils.py
+++ b/tests/pySim-shell_test/utils.py
@@ -228,7 +228,8 @@
def runPySimShell(self, cardname:str, script:str,
add_adm:bool = False,
add_csv:bool = False,
- no_exceptions = False):
+ no_exceptions = False,
+ skip_card_init = False):
""" execute pySimShell.py. Each testcase should run pySim-shell at least once. The working directlry is the
testcase directory.
@@ -261,6 +262,8 @@
if add_csv:
adm1 = self.cards[cardname]['adm1']
cmdline += " --csv " + self.top_dir + CARD_DATA_CSV
+ if skip_card_init:
+ cmdline += " --skip-card-init"
# Execute commandline
cmdline += " > " + logfile_name + " 2>&1"
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/38608?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: I1d8a57de201fe7ad7cbcbc6f72969ea8521e821d
Gerrit-Change-Number: 38608
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38663?usp=email )
Change subject: sigtran: Split osmo_ss7_instance allocation into its own function
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38663?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I38f9f19bb43d29999c4a7ba1a537403d1d58e880
Gerrit-Change-Number: 38663
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 07 Nov 2024 04:18:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38662?usp=email )
Change subject: sigtran: Constify osmo_ss7_instance ptr in several APIs
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38662?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I3be025d4a26d12aa305efe0bf2b3955ca5af3da1
Gerrit-Change-Number: 38662
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 07 Nov 2024 04:18:11 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38660?usp=email )
Change subject: sigtran: Add API osmo_ss7_instances_llist_entry
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38660?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I148438aecd64bdd66848d4b3404d379a380c5e9c
Gerrit-Change-Number: 38660
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 07 Nov 2024 04:17:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38645?usp=email )
Change subject: sigtran: Make osmo_ss7_asp struct private
......................................................................
Patch Set 3:
(1 comment)
File src/ipa.c:
https://gerrit.osmocom.org/c/libosmo-sigtran/+/38645/comment/687fbc7b_0668f… :
PS3, Line 50: #i
I think naming-wise it's sad that we no longer have the _internal.h for internal (non-public) header files. That was originally the point of having {xua,ss7}_internal.h.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38645?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I5839b4dd04468af20d1836386dcc722e7a83ac5f
Gerrit-Change-Number: 38645
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 07 Nov 2024 04:17:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38642?usp=email )
Change subject: sigtran: Make osmo_ss7_xua_server APIs private
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38642?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ie03697fdb2c9f95de011b21771261e52befb6018
Gerrit-Change-Number: 38642
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 07 Nov 2024 04:15:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes