Commit Graph

22 Commits

Author SHA1 Message Date
Oliver Smith d264ec6310 net/templates: support running MS
New config variables:
* MS_RUN_IN_OSMO_DEV
* MS_SUBSCR_ID
* MS_IMSI
* MS_KI
* MS_MSISDN

Change-Id: I377ca41d18ee6b057559cadb0f0bb44f85643eb6
2022-02-25 12:55:21 +01:00
Oliver Smith 76f1647f00 net/templates/run.sh: don't sleep .2 for tmux
It doesn't seem necessary to do the "sleep .2" for tmux, so only do it
when starting with regular terminals.

Change-Id: I70931922aac56dad3d1e4dec67ca2b78d7cca7ff
2022-02-25 12:55:21 +01:00
Oliver Smith 321a47c451 net/templates: support running osmo-bts-virtual
New config variables:
* BTS0_RUN_IN_OSMO_DEV
* BTS0_IP
* BTS1_RUN_IN_OSMO_DEV
* BTS1_IP

Change-Id: Ibc8efe75abffcefc0a719b6323a9ceca39f14ea1
2022-02-25 12:55:21 +01:00
Oliver Smith e76581931f net/templates: support running a second bsc
New config variables: BSC_COUNT, BSC1_*

Change-Id: If0fa5c5b4c76ae037d109211bbb27132689b4f80
2022-02-25 12:55:21 +01:00
Oliver Smith 97f58d4c2e net/templates: move bsc cfg/vars to bsc0
Prepare support for a second BSC, in order to test OsmoBSCNAT.

* Rename BSC_* variables to BSC0_*
* Rename MGW4BSC_* variables to MGW4BSC0_*
* Rename osmo-bsc.cfg to osmo-bsc-0.cfg
* Rename osmo-mgw-for-bsc.cfg to osmo-mgw-for-bsc-0.cfg

Change-Id: Iaba2e3143b7bb6451a0104042e69d47ee5f48d3c
2022-02-25 12:55:21 +01:00
Oliver Smith f34a9443eb net/templates/run.sh: drop 'fg'
This was related to attempting to fix the infinite "q Enter to close"
msgs bug, which has been properly fixed in
Iebb799493f76fd57f24b15c998ded2bd8e284e6b.

Remove fg to get rid of this error:
  zsh:fg:1: no job control in this shell.

Change-Id: Iba7a1adbc4f48b0477a53590ffec8af518fdf467
2022-02-23 12:31:42 +01:00
Oliver Smith 2cfd792312 net/templates/run.sh: put log name in trace.pcap
It's hard to distinguish multiple wireshark windows with trace.pcap
files, as only the file name and not the path is shown in the title.
Make it easier to distinguish them by adding the log name to the file
name.

Change-Id: I7007d7c1e74aef46f1942f4f6f675adebb890955
2022-02-21 11:36:48 +01:00
Oliver Smith e33f85f193 net: run.sh: fix infinite "q Enter to close" msgs
Fix the logic that is supposed to display a "q Enter to close" message
once and wait for user input, in case one of the Osmocom programs
crashed.

Explicitly read from /dev/tty, as it may not be connected as default
stdin anymore at this point. This happens when using the new code paths
with tmux as terminal, but also happened before recent refactorings for
me with all terminals.

Related: https://media.ccc.de/v/osmodevcall-20211210-osmith-osmo-dev-ttcn3#t=801
Change-Id: Iebb799493f76fd57f24b15c998ded2bd8e284e6b
2022-02-21 11:36:48 +01:00
Oliver Smith cd472bdbf7 net: run.sh: support tmux as terminal
Create one tmux session, with each Osmocom program in one window, if
tmux is chosen as "terminal". This allows using osmo-dev's run.sh over
ssh without X forwarding. Also the existing supported terminals
automatically scroll to the bottom as soon as there is new output,
making it hard to read logs.

Change-Id: Iaef08fb3cb3c6f58cd8490a631e177a03af9c974
2022-02-21 11:36:38 +01:00
Oliver Smith 6327371e4c net: run.sh: write launcher command to shell script
Instead of passing a whole script to the terminal via command-line
argument, write it to a file. This is in preparation to use the same
script with tmux, see next patch.

Change-Id: I15760d706b20628421c10a16514120f442d5477f
2022-02-21 10:45:25 +01:00
Oliver Smith 669f1dbe5c net: run.sh: store all spawned pids in files
Replace the previous approach of only storing the PIDs of the spawned
terminals, and then attempting to kill all other processes (the ones
running inside the spawned terminals and tcpdump) with "killall".
Instead, store PIDs of all spawned programs:
* Terminals
* Osmocom programs (new)
* Tcpdump (new)

Kill old processes at the start of run.sh as well, so even if run.sh was
killed before it could clean up, the Osmocom programs don't fail to
start anymore (as it was the case before).

Change-Id: I379ef71de2f1ab0ac4a28064e5cf9e275c4c61e9
2022-02-21 10:42:24 +01:00
Oliver Smith b28a9100ed net: require terminal to be configured
Prepare to add "tmux" as new terminal. As discussed in code review, we
decided to drop support for auto-detection.

Change-Id: I0afb6b0242c399334a2c37f18a5d26d5beeabedc
2022-02-18 18:58:37 +01:00
Oliver Smith a3a1a0d94a net: add osmo-bsc-nat
Make STP_CN_IP and STP_RAN_IP configurable. If they are not set to the
same IP, run a second OsmoSTP and OsmoBSCNAT to connect both OsmoSTP.

Related: OS#2545
Change-Id: I8bfbd00bfeeebc6e1b87a8cd6333212db4380653
2022-01-17 09:11:55 +00:00
Oliver Smith 8fd5098f3f net/templates/run.sh: refactor kill logic
Put the terminal PIDs into a variable instead of running kill %1 %2 etc.
This makes it easier to conditionally spawn some of the programs.

Change-Id: Iaf6c175de2edf720009af13eace2b0ef83b0735b
2022-01-17 09:11:55 +00:00
Oliver Smith 4186b95259 net/templates/run.sh: tweak masquerade
Replace the old check with an exact check for the given rule. The old
check doesn't work on my system if docker is running and sets up other
masquerading rules.

Change -A to -I, so it is less likely to be affected by whatever other
rules may already be above in the chain.

Change-Id: I30c22fe4e7683611e8dada329dbf7d51f78b6016
2021-07-12 08:35:49 +00:00
Neels Hofmeyr ba0a8280a9 clean up naming: s/SIPCON_REMOTE/PBX_SIP etc
Change-Id: Ie66b32466f80d930150ea940d236cfbbe026fc50
2019-12-04 03:58:17 +01:00
Oliver Smith 667f19b199 add freeswitch
Change-Id: If948de9e9e7e288b0a031ab973f453cd91a9e99b
2019-12-04 03:16:59 +01:00
Neels Hofmeyr fecf156c11 kamailio: fixes and tweaks
This is what I did to get external MNCC with kamailio to work.

(As before, only change MSC_MNCC from "internal" to "external ..." in config_*
to enable use of kamailio as external MNCC.)

Change-Id: I18c991bf914dedeb69cb8a2fcde117633e51a899
2019-08-08 15:43:54 +02:00
Neels Hofmeyr 0dc7326b0f run.sh: drop -M mncc-socket option from osmo-msc cmdline
Since commit [1], the MNCC socket path is configured in the .cfg file. There is
no need to pass the -M option to osmo-msc on the cmdline anymore.

Also, the udtrace example to launch osmo-msc in run.sh includes a '| tee' so
that the -M would be passed as option to tee and breaks that example.

[1] cbdd7180a6 / Ie6352c584c0fce57c617387160c285abf40a5f90

Change-Id: Id5c177a7fe98b752881ddd0d98152a2e30380d0e
2019-08-08 15:43:54 +02:00
Neels Hofmeyr 8e4948421c run.sh: add comment to show how to enable MNCC udtrace
Change-Id: I94fdc87e8adea345ad735449558b75a56953fcc5
2019-08-08 15:20:38 +02:00
Oliver Smith 2490f69804 run.sh: fix $TO_RAN_IP and $TO_RAN_IU_IP usage
Add curly braces around both variables, so they get replaced properly
again.

Change-Id: I1f0f749b74fe5fd3982e045283735151f69c2487
2019-03-13 15:16:16 +01:00
Neels Hofmeyr cbdd7180a6 net/: refactor cfg templates
Adopt "foreach" and "common_" features and generally take in the improved
templates as used at 35c3.

If your config file relies on the tmpl_std that is now removed, you can locally
resurrect it with

  git checkout 2c6a55baa7 -- tmpl_std

but it's probably better to make a new copy of config_2g3g and insert your
local config there.

Change-Id: Ie6352c584c0fce57c617387160c285abf40a5f90
2019-03-07 16:28:06 +01:00