laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/27179 )
Change subject: ts_31_102: Use perror() instead of poutput() for errors
......................................................................
ts_31_102: Use perror() instead of poutput() for errors
This adds colorization and ensures they go to stderr and not stdout
Change-Id: I34b8f974b4ff13002679c4700bdf604db7d7f3cd
---
M pySim/ts_31_102.py
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index ce32b20..7fcb08e 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -620,9 +620,9 @@
if exists != should_exist:
num_problems += 1
if exists:
- cmd.poutput(" ERROR: File %s is selectable but should not!" % f)
+ cmd.perror(" ERROR: File %s is selectable but should not!" % f)
else:
- cmd.poutput(" ERROR: File %s is not selectable (%s) but should!" % (f, sw))
+ cmd.perror(" ERROR: File %s is not selectable (%s) but should!" % (f, sw))
finally:
# re-select the EF.UST
cmd.card._scc.select_file(self.fid)
@@ -655,11 +655,11 @@
active_services = selected_file.get_active_services(self._cmd)
# Service n°46 can only be declared "available" if service n°45 is declared "available"
if 46 in active_services and not 45 in active_services:
- self._cmd.poutput("ERROR: Service 46 available, but it requires Service 45")
+ self._cmd.perror("ERROR: Service 46 available, but it requires Service 45")
num_problems += 1
# Service n°125 shall only be taken into account if Service n°124 is declared "available"
if 125 in active_services and not 124 in active_services:
- self._cmd.poutput("ERROR: Service 125 is ignored as Service 124 not available")
+ self._cmd.perror("ERROR: Service 125 is ignored as Service 124 not available")
num_problems += 1
# Service n°95, n°99 and n°115 shall not be declared "available" if an ISIM application is present on the UICC
non_isim_services = [95, 99, 115]
@@ -667,7 +667,7 @@
if 'ADF.ISIM' in app_names:
for s in non_isim_services:
if s in active_services:
- self._cmd.poutput("ERROR: Service %u shall not be available as ISIM application is present" % s)
+ self._cmd.perror("ERROR: Service %u shall not be available as ISIM application is present" % s)
num_problems += 1
self._cmd.poutput("===> %u service / file inconsistencies detected" % num_problems)
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/27179
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I34b8f974b4ff13002679c4700bdf604db7d7f3cd
Gerrit-Change-Number: 27179
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/27175 )
Change subject: ts_31_102: Add "ust_service_check" command.
......................................................................
ts_31_102: Add "ust_service_check" command.
This command performs a consistency check between the services activated
in EF.UST/EF.IST and the files that should (or should not) be
active/selectable for the given service.
Produces output like:
Checking service No 48 (inactive)
ERROR: File EF(EF.MWIS) is selectable but should not!
Checking service No 49 (active)
ERROR: File EF(EF.CFIS) is not selectable (SW=6a82) but should!
Change-Id: Iea7166959e2015eb8fa34d86036560c9e42ce4d3
---
M pySim/ts_31_102.py
1 file changed, 36 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index 17d865d..9105418 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -600,6 +600,42 @@
"""Deactivate a service within EF.UST"""
self._cmd.card.update_ust(int(arg), 0)
+ def do_ust_service_check(self, arg):
+ """Check consistency between services of this file and files present/activated"""
+ # obtain list of currently active services
+ (service_data, sw) = self._cmd.rs.read_binary_dec()
+ for s in service_data.keys():
+ if service_data[s]['activated']:
+ active_services.append(s)
+ # iterate over all the service-constraints we know of
+ selected_file = self._cmd.rs.selected_file
+ files_by_service = selected_file.parent.files_by_service
+ try:
+ for s in sorted(files_by_service.keys()):
+ active_str = 'active' if s in active_services else 'inactive'
+ self._cmd.poutput("Checking service No %u (%s)" % (s, active_str))
+ for f in files_by_service[s]:
+ should_exist = f.should_exist_for_services(active_services)
+ try:
+ (data, sw) = self._cmd.card._scc.select_file(f.fid)
+ exists = True
+ fcp = f.decode_select_response(data)
+ # if we just selected a directory, go back
+ if fcp['file_descriptor']['file_type'] == 'df':
+ self._cmd.card._scc.select_parent_df()
+ except SwMatchError as e:
+ sw = e.sw_actual
+ exists = False
+ if exists != should_exist:
+ if exists:
+ self._cmd.poutput(" ERROR: File %s is selectable but should not!" % f)
+ else:
+ self._cmd.poutput(" ERROR: File %s is not selectable (SW=%s) but should!" % (f, sw))
+ finally:
+ # re-select the EF.UST
+ self._cmd.card._scc.select_file(selected_file.fid)
+
+
# TS 31.103 Section 4.2.7 - *not* the same as DF.GSM/EF.ECC!
class EF_ECC(LinFixedEF):
cc_construct = Rpad(BcdAdapter(Rpad(Bytes(3))), pattern='f')
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/27175
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iea7166959e2015eb8fa34d86036560c9e42ce4d3
Gerrit-Change-Number: 27175
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>
Gerrit-MessageType: merged
Attention is currently required from: dexter.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/27200
to look at the new patch set (#3).
Change subject: ranap_rab_ass_test: cosmetic: correct test function names
......................................................................
ranap_rab_ass_test: cosmetic: correct test function names
The test function naming follows an older scheme, lets use the current
scheme.
Change-Id: Ib9db9d86e01551c8d9d8f8c4933025ca20ce5624
Related: OS#5152
---
M tests/ranap_rab_ass/ranap_rab_ass_test.c
1 file changed, 8 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/00/27200/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/27200
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib9db9d86e01551c8d9d8f8c4933025ca20ce5624
Gerrit-Change-Number: 27200
Gerrit-PatchSet: 3
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-MessageType: newpatchset