Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38021?usp=email )
Change subject: update osmo-stp.cfg to make STP_Tests work at all again
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38021/comment/dc2e31f8_e886… :
PS1, Line 12: I'm really getting tired at fixing up those kind of issues. It's
: well-known that config changes must be made first here and then in
: docker-playground.
But `osmo-stp-tcp.confmerge` was there in osmo-ttcn3-hacks.git since March. The problem is that we forgot to confmerge it into `osmo-stp.cfg` after tagging new releases last time. It's the old known problem of having to maintain config files in three different places...
Please also remove `osmo-stp-tcp.confmerge` in this patch, since you're merging it into the main config file now.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38021?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7f0cef55a9a54f1cc4b23df781dab2afd52aae78
Gerrit-Change-Number: 38021
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 04 Sep 2024 07:36:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37932?usp=email )
Change subject: pySim-shell: rework startup procedure and introduce non interactive mode
......................................................................
pySim-shell: rework startup procedure and introduce non interactive mode
When pySim-shell is used in a scripted environment, we may easily get trapped in
the pySim-shell prompt. This may happen in particular in case the script file
is not executed due to problem with the reader initialization. In such a case
pySim-shell will not exit automatically and the shellscript that was calling
pySim-shell will stall indefinetly.
To make the use of pySim-shell more reliable in scripted environments, let's
add a --noprompt option that ensures the interactive mode is never entered.
Let's also exit with an appropriate return code in case of initialization
errors, so that the calling script can know that something went wrong.
Related: OS#6531
Change-Id: I07ecb27b37e2573629981a0d032cc95cd156be7e
---
M pySim-shell.py
1 file changed, 36 insertions(+), 19 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim-shell.py b/pySim-shell.py
index d3f9d91..16a6b97 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -1028,6 +1028,8 @@
help='per-CSV-column AES transport key')
global_group.add_argument("--card_handler", dest="card_handler_config", metavar="FILE",
help="Use automatic card handling machine")
+global_group.add_argument("--noprompt", help="Run in non interactive mode",
+ 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,
@@ -1043,22 +1045,15 @@
if __name__ == '__main__':
- # Parse options
+ startup_errors = False
opts = option_parser.parse_args()
- # If a script file is specified, be sure that it actually exists
- if opts.script:
- if not os.access(opts.script, os.R_OK):
- print("Invalid script file!")
- sys.exit(2)
-
+ # Register csv-file as card data provider, either from specified CSV
+ # or from CSV file in home directory
csv_column_keys = {}
for par in opts.csv_column_key:
name, key = par.split(':')
csv_column_keys[name] = key
-
- # Register csv-file as card data provider, either from specified CSV
- # or from CSV file in home directory
csv_default = str(Path.home()) + "/.osmocom/pysim/card_data.csv"
if opts.csv:
card_key_provider_register(CardKeyProviderCsv(opts.csv, csv_column_keys))
@@ -1079,18 +1074,18 @@
# able to tolerate and recover from that.
try:
rs, card = init_card(sl)
- app = PysimApp(card, rs, sl, ch, opts.script)
+ app = PysimApp(card, rs, sl, ch)
except:
+ startup_errors = True
print("Card initialization (%s) failed with an exception:" % str(sl))
print("---------------------8<---------------------")
traceback.print_exc()
print("---------------------8<---------------------")
- print("(you may still try to recover from this manually by using the 'equip' command.)")
- print(" it should also be noted that some readers may behave strangely when no card")
- print(" is inserted.)")
- print("")
- if opts.script:
- print("will not execute startup script due to card initialization errors!")
+ if not opts.noprompt:
+ print("(you may still try to recover from this manually by using the 'equip' command.)")
+ print(" it should also be noted that some readers may behave strangely when no card")
+ print(" is inserted.)")
+ print("")
app = PysimApp(None, None, sl, ch)
# If the user supplies an ADM PIN at via commandline args authenticate
@@ -1102,9 +1097,31 @@
try:
card._scc.verify_chv(card._adm_chv_num, h2b(pin_adm))
except Exception as e:
+ startup_errors = True
+ print("ADM verification (%s) failed with an exception:" % str(pin_adm))
+ print("---------------------8<---------------------")
print(e)
+ print("---------------------8<---------------------")
+ # Run optional command
if opts.command:
- app.onecmd_plus_hooks('{} {}'.format(opts.command, ' '.join(opts.command_args)))
- else:
+ if not startup_errors:
+ app.onecmd_plus_hooks('{} {}'.format(opts.command, ' '.join(opts.command_args)))
+ else:
+ print("Errors during startup, refusing to execute command (%s)" % opts.command)
+
+ # Run optional script file
+ if opts.script:
+ if not startup_errors:
+ if not os.access(opts.script, os.R_OK):
+ print("Error: script file (%s) not readable!" % opts.script)
+ startup_errors = True
+ else:
+ app.onecmd_plus_hooks('{} {}'.format('run_script', opts.script), add_to_history = False)
+ else:
+ print("Errors during startup, refusing to execute script (%s)" % opts.script)
+
+ if not opts.noprompt:
app.cmdloop()
+ elif startup_errors:
+ sys.exit(2)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37932?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: I07ecb27b37e2573629981a0d032cc95cd156be7e
Gerrit-Change-Number: 37932
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38021?usp=email )
Change subject: update osmo-stp.cfg to make STP_Tests work at all again
......................................................................
update osmo-stp.cfg to make STP_Tests work at all again
This syncs osmo-stp.cfg with changes introduced to docker-playground
in Change-Id I210b7d62845075dcfe147f2f77603625cc1e64f9 on March 4th.
I'm really getting tired at fixing up those kind of issues. It's
well-known that config changes must be made first here and then in
docker-playground.
Change-Id: I7f0cef55a9a54f1cc4b23df781dab2afd52aae78
---
M stp/osmo-stp.cfg
1 file changed, 22 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/21/38021/1
diff --git a/stp/osmo-stp.cfg b/stp/osmo-stp.cfg
index 13b1b71..9a6540a 100644
--- a/stp/osmo-stp.cfg
+++ b/stp/osmo-stp.cfg
@@ -37,6 +37,28 @@
!
cs7 instance 0
point-code format 24
+ asp asp-sender-tcp 9999 2905 m3ua tcp
+ local-ip 127.0.0.1
+ remote-ip 127.0.0.1
+ role sg
+ transport-role server
+ asp asp-client0-tcp 10002 2906 m3ua tcp
+ local-ip 127.0.0.1
+ remote-ip 127.0.0.1
+ role asp
+ transport-role client
+ as as-sender-tcp m3ua
+ asp asp-sender-tcp
+ routing-key 1123 123
+ as as-client-tcp m3ua
+ routing-key 1155 155
+ asp asp-client0-tcp
+ route-table system
+ update route 123 16777215 linkset as-sender-tcp
+ update route 155 16777215 linkset as-client-tcp
+ listen m3ua 2905 tcp
+ local-ip 127.0.0.1
+ accept-asp-connections dynamic-permitted
!
!M3UA AS/ASP:
!
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38021?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7f0cef55a9a54f1cc4b23df781dab2afd52aae78
Gerrit-Change-Number: 38021
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Attention is currently required from: neels, pespin.
laforge has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37882?usp=email )
Change subject: ctrl, hnbgw: access rate counter groups by given ID instead of index
......................................................................
Patch Set 4: Code-Review+1
(1 comment)
Patchset:
PS4:
There's now also the proposal to revert to the original behaviour (always use numeric index 0): https://gerrit.osmocom.org/c/osmo-hnbgw/+/38002
Ideally libosmocore should enforce the "unique ID" rule only if there are no unique names being set. However, our API first creates the objcet with numeric ID, and then optionally sets the name in a second call - so there's no point where we can print a related error/warning message 😞
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37882?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I70e74e7554482df67aa1d90bc04314124dea444f
Gerrit-Change-Number: 37882
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 04 Sep 2024 06:57:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes