fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmo-dev/+/26485 )
Change subject: Add tmux scripts for ttcn3-{msc,bsc,bts}-test
......................................................................
Add tmux scripts for ttcn3-{msc,bsc,bts}-test
Change-Id: I201b77c013cbeef9d1a07b9422b27f375811ed69
---
M README
A ttcn3/tmux/ttcn3-bsc-test.sh
A ttcn3/tmux/ttcn3-bts-test.sh
A ttcn3/tmux/ttcn3-msc-test.sh
4 files changed, 132 insertions(+), 0 deletions(-)
Approvals:
osmith: Looks good to me, approved
fixeria: Verified
diff --git a/README b/README
index 7f1b594..f4f4eda 100644
--- a/README
+++ b/README
@@ -169,6 +169,15 @@
[1]
https://jenkins.osmocom.org/jenkins/view/TTCN3/
+=== ttcn3/tmux
+
+It's possible to run TTCN-3 test cases without using Docker. This directory
+contains scripts for starting a testsuite and the related binaries in a tmux
+session. For example, ttcn3-bsc-test.sh does the following:
+
+* Starts osmo-bsc, osmo-stp, and three instances of osmo-bts-omldummy.
+* Prepares a command for execuring the test suite.
+
=== Troubleshooting
When using sanitize.opts, osmo-trx is not built with the address sanitizer
diff --git a/ttcn3/tmux/ttcn3-bsc-test.sh b/ttcn3/tmux/ttcn3-bsc-test.sh
new file mode 100755
index 0000000..c0d9709
--- /dev/null
+++ b/ttcn3/tmux/ttcn3-bsc-test.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+SESSION="ttcn3-bsc-test"
+
+OSMO_DIR="/home/$USER/osmocom"
+SUITE_DIR="$OSMO_DIR/osmo-ttcn3-hacks"
+RESPAWN="$OSMO_DIR/scripts/respawn.sh"
+
+if [ ! -d $SUITE_DIR ]; then
+ echo "Directory '$SUITE_DIR' does not exist"
+ echo "Please specify where to find osmo-ttcn3-hacks"
+ exit 1
+fi
+
+if [ ! -f $RESPAWN ]; then
+ echo "Script '$RESPAWN' does not exist"
+ echo "Please specify where to find respawn.sh"
+ exit 1
+fi
+
+tmux new-session -s $SESSION -n $SESSION -d
+
+tmux split-window -t $SESSION:0 -v
+tmux send-keys -t $SESSION:0.0 "cd $SUITE_DIR/bsc" C-m
+tmux send-keys -t $SESSION:0.0 "osmo-bsc -c osmo-bsc.cfg" C-m
+tmux send-keys -t $SESSION:0.1 "cd $SUITE_DIR/bsc" C-m
+tmux send-keys -t $SESSION:0.1 "../start-testsuite.sh ./BSC_Tests
BSC_Tests.cfg"
+
+tmux new-window -t $SESSION:1
+tmux split-window -t $SESSION:1 -v
+tmux split-window -t $SESSION:1 -v
+tmux split-window -t $SESSION:1 -v
+tmux split-window -t $SESSION:1 -v
+
+# Start osmo-stp
+tmux send-keys -t $SESSION:1.0 "cd $SUITE_DIR/bsc" C-m
+tmux send-keys -t $SESSION:1.0 "osmo-stp -c osmo-stp.cfg" C-m
+# Start osmo-bts-omldummy
+tmux send-keys -t $SESSION:1.1 "$RESPAWN osmo-bts-omldummy 127.0.0.1 1234" C-m
+tmux send-keys -t $SESSION:1.2 "$RESPAWN osmo-bts-omldummy 127.0.0.1 1235" C-m
+tmux send-keys -t $SESSION:1.3 "$RESPAWN osmo-bts-omldummy 127.0.0.1 1236" C-m
+
+tmux attach -t $SESSION:0
diff --git a/ttcn3/tmux/ttcn3-bts-test.sh b/ttcn3/tmux/ttcn3-bts-test.sh
new file mode 100755
index 0000000..78acad9
--- /dev/null
+++ b/ttcn3/tmux/ttcn3-bts-test.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+SESSION="ttcn3-bts-test"
+
+OSMO_DIR="/home/$USER/osmocom"
+OBB_DIR="$OSMO_DIR/osmocom-bb"
+SUITE_DIR="$OSMO_DIR/osmo-ttcn3-hacks"
+RESPAWN="$OSMO_DIR/scripts/respawn.sh"
+
+if [ ! -d $SUITE_DIR ]; then
+ echo "Directory '$SUITE_DIR' does not exist"
+ echo "Please specify where to find osmo-ttcn3-hacks"
+ exit 1
+fi
+
+if [ ! -d $OBB_DIR ]; then
+ echo "Directory '$OBB_DIR' does not exist"
+ echo "Please specify where to find osmocom-bb"
+ exit 1
+fi
+
+if [ ! -f $RESPAWN ]; then
+ echo "Script '$RESPAWN' does not exist"
+ echo "Please specify where to find respawn.sh"
+ exit 1
+fi
+
+tmux new-session -s $SESSION -n $SESSION -d
+
+tmux split-window -t $SESSION:0 -v
+tmux send-keys -t $SESSION:0.0 "cd $SUITE_DIR/bts" C-m
+tmux send-keys -t $SESSION:0.0 "$RESPAWN osmo-bts-trx -c osmo-bts.cfg"
+tmux send-keys -t $SESSION:0.1 "cd $SUITE_DIR/bts" C-m
+tmux send-keys -t $SESSION:0.1 "../start-testsuite.sh ./BTS_Tests
BTS_Tests.cfg"
+
+
+tmux new-window -t $SESSION:1
+tmux split-window -t $SESSION:1 -v
+tmux split-window -t $SESSION:1 -v
+
+# Start osmo-bsc
+tmux send-keys -t $SESSION:1.0 "cd $SUITE_DIR/bts" C-m
+tmux send-keys -t $SESSION:1.0 "osmo-bsc -c osmo-bsc.cfg" C-m
+# Start trxcon
+tmux send-keys -t $SESSION:1.1 "cd $OBB_DIR/src/host/trxcon" C-m
+tmux send-keys -t $SESSION:1.1 "./trxcon -s /tmp/osmocom_l2" C-m
+# Start fake_trx.py
+tmux send-keys -t $SESSION:1.2 "cd $OBB_DIR/src/target/trx_toolkit" C-m
+tmux send-keys -t $SESSION:1.2 "./fake_trx.py \
+ --trx TRX1@127.0.0.1:5700/1 \
+ --trx TRX1@127.0.0.1:5700/2 \
+ --trx TRX1@127.0.0.1:5700/3" C-m
+
+tmux attach -t $SESSION:0
diff --git a/ttcn3/tmux/ttcn3-msc-test.sh b/ttcn3/tmux/ttcn3-msc-test.sh
new file mode 100755
index 0000000..fee1383
--- /dev/null
+++ b/ttcn3/tmux/ttcn3-msc-test.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+SESSION="ttcn3-msc-test"
+
+OSMO_DIR="/home/$USER/osmocom"
+SUITE_DIR="$OSMO_DIR/osmo-ttcn3-hacks"
+
+if [ ! -d $SUITE_DIR ]; then
+ echo "Directory '$SUITE_DIR' does not exist"
+ echo "Please specify where to find osmo-ttcn3-hacks"
+ exit 1
+fi
+
+tmux new-session -s $SESSION -n $SESSION -d
+
+tmux split-window -t $SESSION:0 -v
+tmux send-keys -t $SESSION:0.0 "cd $SUITE_DIR/msc" C-m
+tmux send-keys -t $SESSION:0.0 "osmo-msc -c osmo-msc.cfg" C-m
+tmux send-keys -t $SESSION:0.1 "cd $SUITE_DIR/msc" C-m
+tmux send-keys -t $SESSION:0.1 "../start-testsuite.sh ./MSC_Tests
MSC_Tests.cfg"
+
+tmux new-window -t $SESSION:1
+tmux send-keys -t $SESSION:1.0 "cd $SUITE_DIR/msc" C-m
+tmux send-keys -t $SESSION:1.0 "osmo-stp -c osmo-stp.cfg" C-m
+
+tmux attach -t $SESSION:0
--
To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/26485
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I201b77c013cbeef9d1a07b9422b27f375811ed69
Gerrit-Change-Number: 26485
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: merged