Commit Graph

227 Commits (a1cf1cdc674261677f9832cc6225881ecebba164)

Author SHA1 Message Date
Xilokar a1cf1cdc67 fix non absolute path
Renamming the make_to_src_proj variable to src_proj in commit
 93bd52300e leads to the build_to_src variable
being the result of a double call to os.path.relpath(), breaking builds when using
non absolute path for make_dir

Change-Id: I2dfc26da94434558b202475af636ce336349bba9
2022-03-22 09:59:25 +01:00
Vadim Yanitskiy 1b68dbc826 ttcn3/tmux/ fix incorrectly passed --trx arguments
For some reason, on Arch Linux:

  $ file /bin/sh
  /bin/sh: symbolic link to bash

  $ sh --version
  GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

the '--trx' arguments are getting passed incorrectly:

  $ ./ TRX1@
  fake_trx: error: unrecognized arguments: TRX1@

Let's send each argument separately.

Change-Id: Ibf28ac013c426baba491af45e2ae46f37685a402
2022-03-11 14:33:08 +03:00
Vadim Yanitskiy 5b3b14e5f7 ttcn3/tmux/ fix copy-pasted TRX names
Change-Id: I5959acdf07caa1e9003662b0c11c3df68ca933fe
2022-03-11 14:33:08 +03:00
Oliver Smith 28ed522acc net/templates/osmo-bsc-nat.cfg: omit PC for bsc
With most recent OsmoBSCNAT patches, the addresses from the connecting
BSCs get used, no need to hardcode them in the config anymore.

Depends: osmo-bsc-nat I1556aa665fbb0a97507f98794e74820731fa6935
Change-Id: I78ef36c72ff9a7b801e922eccc89dc44fbba7f23
2022-03-10 13:27:12 +01:00
Oliver Smith bf20106d4e net/templates/ change prefix from CN to NET
osmo-dev's net scripts can be used to run components from RAN too, so
change the title prefix and tmux session name from CN to NET.

Change-Id: I3f46d5a4c7bd20861735c4e01f7cafbc5db08aae
2022-03-08 10:34:42 +01:00
Oliver Smith ef92c180d7 net: move cmds for network components to config
Instead of hardcoding wrappers such as gdb for various commands in, put all commands into a config file so the user can add
gdb/valgrind/strace/udtrace/... to the program they are currently
interested in debugging in their own config.

Change-Id: Ifce731ab61d263e9df7a8dc87dd572ca3d30f8dd
2022-03-08 10:34:42 +01:00
Oliver Smith bb0d4d3ebe net/templates/run: one variable for stp4cn/stp4ran
Make it consistent with osmo-mgw and osmo-bsc where we also have more
than one config, and the config is not part of the variable.

Change-Id: I83301d75814070c29c6362c59fade9044aa2c0cc
2022-03-08 10:34:42 +01:00
Oliver Smith 641b4514f6 net/templates/run: log name input: display last
Make it easier for the user to follow a consistent naming scheme for the
log files if they want do do so, by displaying the last log name.

  enter name to save log (last: 2022-03-07_04-test-log-name):

Change-Id: I6c5b64e15d9a8dabaf65022d6b82b69523a3ca6b
2022-03-08 10:34:42 +01:00
Oliver Smith 74e1584631 net: add mgw for osmo-bsc-nat
Start the OsmoBSCNAT's own instance of OsmoMGW. Launch it on a separate
IP, such as the other MGWs, so it's easy to differentiate in wireshark
which traffic relates to which MGW.

Change-Id: Iaeebb693c81d3aa4b1a46d2543c9872bd49b87c3
2022-03-08 10:34:42 +01:00
Oliver Smith 7f498e2b38 net/templates/ only one variable for mgw
Prepare to add another MGW for the BSCNAT. Use only one variable for the
mgw, always append the -c configfile parameter further below in the
script where it gets used.

Change-Id: I6f3fe11109107b35059ebe731e0a74a91a04504c
2022-03-08 10:34:42 +01:00
Oliver Smith c819ea7458 net/templates: use codec fr2 for bts1
Fix establishing a call to virtual mobile, which wouldn't work for me if
using anything but FR2 (EFR) as codec.

Change-Id: I6a8706923b651c790798a50aad93492de17dd1a5
2022-03-08 10:34:39 +01:00
Oliver Smith cef58b3d09 net/templates/ proper iptables -> /dev/null
Fix displaying unrelated message from iptables by redirecting both
stdout and stderr to /dev/null.

Change-Id: Ibe031725cbb68ec55664dd025b1ffc247db08148
2022-02-25 12:55:21 +01:00
Oliver Smith 67cd47f0e8 net: virtphy, osmo-bts-virtual: use loopback-dev
Use the loopback device for virtual Um traffic, so it doesn't slow down
other net devs.

Change-Id: Ibc7ff3aaaca4872f4105825167eb33b66bc23342
2022-02-25 12:55:21 +01:00
Oliver Smith 5452c6e901 make: add convenience target cn-bsc-nat
Change-Id: Ia2bdc8df3cbe9de305aba4f7592a2362f3802303
2022-02-25 12:55:21 +01:00
Oliver Smith 0d9bacc91f net: don't run osmo-gbproxy by default
osmo-gbproxy is not part of any of the convenience make targets in (cn, cn-bsc, usrp). When using the typical workflow of
building one of these convenience targets first, then attempting to run
the network, the osmo-gbproxy window just says command not found.

With the default config_2g3g, it is not needed when only using one BTS,
so add a new config variable GBPROXY_RUN_IN_OSMO_DEV=0 and use it in

Change-Id: Ib1349809997ea6062ec3c43df92abab9fbfad1ea
2022-02-25 12:55:21 +01:00
Oliver Smith d264ec6310 net/templates: support running MS
New config variables:

Change-Id: I377ca41d18ee6b057559cadb0f0bb44f85643eb6
2022-02-25 12:55:21 +01:00
Oliver Smith 5705a69c16 make: add support for "virtphy" from osmocom-bb
Change-Id: Id4e7a9d948332c03d56e2637badeef78c78e5aa7
2022-02-25 12:55:21 +01:00
Oliver Smith 93bd52300e make: add support for "mobile" from osmocom-bb
Allow building and installing the "mobile" application from
osmocom-bb.git's src/host/layer23 dir.

Change-Id: Ic75cca703e317eaee593b4d6c78784309c056f17
2022-02-25 12:55:21 +01:00
Oliver Smith 107f35d3da follow symlinks with find
Prepare for the next patch, with which {src_proj} may be a subdir in

Change-Id: Ie15e74e61b16cef5e189e4e2a272b7d2061547c6
2022-02-25 12:55:21 +01:00
Oliver Smith ca0d2900be mark convenience targets as phony
Change-Id: Idd7e485e17b178f1bf6feef5d30db57e6467267e
2022-02-25 12:55:21 +01:00
Oliver Smith 76f1647f00 net/templates/ 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:

Change-Id: Ibc8efe75abffcefc0a719b6323a9ceca39f14ea1
2022-02-25 12:55:21 +01:00
Oliver Smith af9b9d8c42 net/templates/common_osmo_bts: drop osmotrx ip
Don't attempt to configure phy0 / osmotrx ip. This only works with
osmo-bts-trx, not with osmo-bts-virtual which we'll run in osmo-dev.
Besides that, seems to be the default anyway.

Change-Id: I20984d00623f31ce9c58a1dc91bcf53d4aec78b2
2022-02-25 12:55:21 +01:00
Oliver Smith d268ec105b net/templates: split off common osmo-bts.cfg part
Change-Id: I4d318942ef07c246e05fd1c59ff0b32c219a45e1
2022-02-25 12:55:21 +01:00
Oliver Smith f4ecc8d670 net/templates/osmo-bts.cfg: modernize
Move logging section to the bottom, include common_logging and

Change-Id: I7b29c644b53e4f1907f33664d6cde6ec76cc8c04
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 19b27b3f98 net/templates: split off common osmo-bsc.cfg part
Prepare to add support running with two osmo-bsc's in order to test

Change-Id: Icb220657888b23ca19546cca78e10ae914f37751
2022-02-25 12:55:21 +01:00
Oliver Smith b2a83f7a17 net/README: update tmux documentation
Change-Id: I5561dae3898bf86176d7693c08732a68a1158a14
2022-02-25 12:55:21 +01:00
Oliver Smith b252b4a043 net: get missing config variables from config_2g3g
Don't ask the user to copy config_2g3g and manually keep it in sync with
config_2g3g with each change anymore. Instead, let the user config be a
diff on top of config_2g3g.

This is in preparation to adding new variables for use with OsmoBSCNAT.

Change-Id: I5870d39aee8be84c2024f8a2a71ee4a734a4fc7c
2022-02-25 12:55:16 +01:00
Oliver Smith 02f2254b23 net/ refactor print 'using config...'
Put each line in a separate, aligned print statement and use f-strings
(Python 3.6 feature, even debian oldstable has > 3.6 by now).
This is in preparation to add a new line about the original config in
the next patch.

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

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/ 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

Change-Id: I7007d7c1e74aef46f1942f4f6f675adebb890955
2022-02-21 11:36:48 +01:00
Oliver Smith e33f85f193 net: 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

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.

Change-Id: Iebb799493f76fd57f24b15c998ded2bd8e284e6b
2022-02-21 11:36:48 +01:00
Oliver Smith cd472bdbf7 net: 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 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: 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: 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 as well, so even if 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 3ffaca828f net/templates/.editorconfig: new file
Change-Id: Ieeb67a10c7b7c27a5e0e9dbc8399fe2add9f34d4
2022-02-08 10:05:34 +00:00
Oliver Smith b6d58c0918 net/templates/osmo-bsc-nat.cfg: add addressbooks
Add MSC and BSC point-codes, as it is currently needed in the initial
message forwarding implementation.

Related: SYS#5560
Related: osmo-bsc-nat I4af398bb433341a98f818822e6c3af28b6d9dacd
Change-Id: Ia396cc677ceffa3fa86da5460f6c890b5f714059
2022-02-08 10:05:34 +00:00
Neels Hofmeyr fd10baa790 add osmo-upf, libgtpnl 2022-02-01 02:53:24 +01:00
Vadim Yanitskiy 3414a48340 Add tmux scripts for ttcn3-{msc,bsc,bts}-test
Change-Id: I201b77c013cbeef9d1a07b9422b27f375811ed69
2022-01-17 15:42:45 +00: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/ 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 5065107a60 all.deps, werror.opts: add osmo-bsc-nat
Change-Id: Ica90826c8bfbf4f295c49702d36e7c88e43f80cd
2022-01-17 09:11:55 +00:00
Oliver Smith 84df01adb8 fix find errors
Don't print find errors if not all dirs were cloned. Found this also
while running osmo-dev on a fresh install.

Change-Id: I7955fedc96484e5703073b63906a03477452db6e
2021-12-10 17:22:58 +01:00
Oliver Smith aa015b1205 README: update deps and recommended opts
In preparation for the OsmoDevCall#19 talk, I'm installing this on a
fresh system and made some adjustments to README so it works without
complaining about missing dependencies.

Change-Id: I7522d8c9346e9823f3977b9190210eb5d5bcfe2d
2021-12-10 17:19:43 +01:00
Oliver Smith 6c7fed8a32 use --auto-distclean
Change-Id: I7d61405dc989eed4935bc6de00e36c1f3b18a428
2021-11-12 15:51:38 +01:00
Oliver Smith adfa0c0cf1 add --auto-distclean
Add a new option that avoids stopping the build with:
  configure: error: source directory already configured; run "make distclean" there first

I run into this frequently, when e.g. running './configure; make release'
inside Osmocom repositories and then attempting to build them with
osmo-dev. It is annoying as it does not fail immediatelly, and I need to
manually go to the source directories where it failed, run 'make
distclean' and then attempt to build again. Then it may fail on another
directory with the same problem.

Check for config.status, as that is also what ./configure checks for
before printing the error.

Change-Id: Iac71333e8c5da8dee4e8f34e2af8db12d2c08021
2021-11-12 15:51:38 +01:00
Oliver Smith f7f8c96e7b proj_files: ignore config.h
Do not consider config.h inside the source tree as modified source file.
This file gets generated when running ./configure to build in-tree,
whereas osmo-dev always builds out-of-tree.

Having config.h inside proj_files causes problems with the next patch,
where conflicting in-tree builds will be automatically be cleaned with
"make distclean". For example:
* "make libosmocore" runs with a previously configured in-tree build
* proj_files contains config.h.
* Before attempting to build libosmocore out-of-tree, with the next
  patch, "make distclean" gets executed.
* config.h is now removed
* target expects all proj_files to exist and
   fails with:
   make: *** No rule to make target '../src/libosmocore/config.h', needed by ''.  Stop.

Change-Id: I10d970f2cadacb5071dcde975c76b15404038a3c
2021-11-12 15:51:38 +01:00