laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/28870 )
Change subject: Fix printing of SwMatchError after introduction of logical channels
......................................................................
Fix printing of SwMatchError after introduction of logical channels
the interpret_sw() method was moved from RuntimeState to RuntimeLchan
in Change-Id I7aa994b625467d4e46a2edd8123240b930305360 - but the code
in pySim/exceptions.py was not adjusted accordingly.
Change-Id: I0614436c99c6a6ebc22c4dc14fb361c5f5f16686
---
M pySim/exceptions.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/70/28870/1
diff --git a/pySim/exceptions.py b/pySim/exceptions.py
index 24aff85..c6a81a1 100644
--- a/pySim/exceptions.py
+++ b/pySim/exceptions.py
@@ -53,8 +53,8 @@
self.rs = rs
def __str__(self):
- if self.rs:
- r = self.rs.interpret_sw(self.sw_actual)
+ if self.rs and self.rs.lchan[0]:
+ r = self.rs.lchan[0].interpret_sw(self.sw_actual)
if r:
return "SW match failed! Expected %s and got %s: %s - %s" % (self.sw_expected, self.sw_actual, r[0], r[1])
return "SW match failed! Expected %s and got %s." % (self.sw_expected, self.sw_actual)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28870
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0614436c99c6a6ebc22c4dc14fb361c5f5f16686
Gerrit-Change-Number: 28870
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/28871 )
Change subject: ts_31_102: Fix terminal_profile, envelope and envelope_sms commands
......................................................................
ts_31_102: Fix terminal_profile, envelope and envelope_sms commands
In commit Ib88bb7d12faaac7d149ee1f6379bc128b83bbdd5 I accidentially
broke those commands by adding argparse definitions for better
documentation. When adding the @cmd2.with_argparser decorator,
the method argument changes from the raw string to an argparse.Namespace
object.
This patch fixes the below exception:
pySIM-shell (MF/ADF.USIM)> terminal_profile ffffffff
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/cmd2/cmd2.py", line 2129, in onecmd_plus_hooks
stop = self.onecmd(statement, add_to_history=add_to_history)
File "/usr/local/lib/python3.10/dist-packages/cmd2/cmd2.py", line 2559, in onecmd
stop = func(statement)
File "/usr/local/lib/python3.10/dist-packages/cmd2/decorators.py", line 336, in cmd_wrapper
return func(*args_list, **kwargs)
File "/space/home/laforge/projects/git/pysim/pySim/ts_31_102.py", line 1274, in do_terminal_profile
(data, sw) = self._cmd.card._scc.terminal_profile(arg)
File "/space/home/laforge/projects/git/pysim/pySim/commands.py", line 583, in terminal_profile
data_length = len(payload) // 2
TypeError: object of type 'Namespace' has no len()
Change-Id: Ia861eeb2970627d3ecfd0ca73f75ca571c6885b2
Fixes: Ib88bb7d12faaac7d149ee1f6379bc128b83bbdd5
---
M pySim/ts_31_102.py
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/71/28871/1
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index 7850459..02ef005 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -1264,40 +1264,40 @@
term_prof_parser.add_argument('PROFILE', help='Hexstring of encoded terminal profile')
@cmd2.with_argparser(term_prof_parser)
- def do_terminal_profile(self, arg):
+ def do_terminal_profile(self, opts):
"""Send a TERMINAL PROFILE command to the card.
This is used to inform the card about which optional
features the terminal (modem/phone) supports, particularly
in the context of SIM Toolkit, Proactive SIM and OTA. You
must specify a hex-string with the encoded terminal profile
you want to send to the card."""
- (data, sw) = self._cmd.card._scc.terminal_profile(arg)
+ (data, sw) = self._cmd.card._scc.terminal_profile(opts.PROFILE)
self._cmd.poutput('SW: %s, data: %s' % (sw, data))
envelope_parser = argparse.ArgumentParser()
envelope_parser.add_argument('PAYLOAD', help='Hexstring of encoded payload to ENVELOPE')
@cmd2.with_argparser(envelope_parser)
- def do_envelope(self, arg):
+ def do_envelope(self, opts):
"""Send an ENVELOPE command to the card. This is how a
variety of information is communicated from the terminal
(modem/phone) to the card, particularly in the context of
SIM Toolkit, Proactive SIM and OTA."""
- (data, sw) = self._cmd.card._scc.envelope(arg)
+ (data, sw) = self._cmd.card._scc.envelope(opts.PAYLOAD)
self._cmd.poutput('SW: %s, data: %s' % (sw, data))
envelope_sms_parser = argparse.ArgumentParser()
envelope_sms_parser.add_argument('TPDU', help='Hexstring of encoded SMS TPDU')
@cmd2.with_argparser(envelope_sms_parser)
- def do_envelope_sms(self, arg):
+ def do_envelope_sms(self, opts):
"""Send an ENVELOPE(SMS-PP-Download) command to the card.
This emulates a terminal (modem/phone) having received a SMS
with a PID of 'SMS for the SIM card'. You can use this
command in the context of testing OTA related features
without a modem/phone or a cellular netwokr."""
tpdu_ie = SMS_TPDU()
- tpdu_ie.from_bytes(h2b(arg))
+ tpdu_ie.from_bytes(h2b(opts.TPDU))
dev_ids = DeviceIdentities(
decoded={'source_dev_id': 'network', 'dest_dev_id': 'uicc'})
sms_dl = SMSPPDownload(children=[dev_ids, tpdu_ie])
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28871
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia861eeb2970627d3ecfd0ca73f75ca571c6885b2
Gerrit-Change-Number: 28871
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28868 )
Change subject: BTS_Tests: increate Tguard to 30.0s for TC_rsl_ms_pwr_dyn_up
......................................................................
BTS_Tests: increate Tguard to 30.0s for TC_rsl_ms_pwr_dyn_up
A comment in f_TC_rsl_ms_pwr_dyn_up() states:
> By default, the MS power loop gets triggered every 4th SACCH block (1.92s).
> We need 9 * 4 dB steps to get from 0 dBm to 33 dBm, so 9 * 1.92s total.
> Add an extra offset to avoid race conditions: +1.92s.
so the alt statement is expected to block for 19.2s, while the guard
timer is set to 20.0s by default. This is not enough, given that
f_TC_rsl_ms_pwr_dyn_up() also needs to wait for the first SACCH block
before entering the alt statement.
Let's give it more time to run in order to avoid sporadic failures.
Change-Id: Ib7de8383c95ac9e00560f786ec4c56f79f7d81bc
Related: OS#5635
---
M bts/BTS_Tests.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/68/28868/1
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 58a7e44..ed5d316 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -3337,7 +3337,7 @@
f_init();
f_vty_config(BTSVTY, "phy 0", "osmotrx ms-power-loop -10");
for (var integer tn := 1; tn <= 1; tn := tn+1) {
- pars := valueof(t_Pars(t_RslChanNr_Bm(tn), ts_RSL_ChanMode_SIGN));
+ pars := valueof(t_Pars(t_RslChanNr_Bm(tn), ts_RSL_ChanMode_SIGN, t_guard := 30.0));
pars.bts0_band := f_vty_get_bts0_band();
vc_conn := f_start_handler(refers(f_TC_rsl_ms_pwr_dyn_up), pars, trxc_comp := true);
vc_conn.done;
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28868
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib7de8383c95ac9e00560f786ec4c56f79f7d81bc
Gerrit-Change-Number: 28868
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange