osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/36845?usp=email )
Change subject: doc: set state-dir to /var/lib/osmocom/osmo-sgsn
......................................................................
doc: set state-dir to /var/lib/osmocom/osmo-sgsn
Be consistent with osmo-ggsn, and set the state dir to
/var/lib/osmocom/osmo-sgsn. Without this patch, it defaults to the
current directory, which means in case of running with the systemd
service, /var/lib/osmocom.
Copy osmo-sgsn.cfg and osmo-sgsn-accept-all.cfg to the tests dir and do
not set the state-dir there. Usually the user that runs the VTY and CTRL
tests is not allowed to write to /var/lib/osmocom. (I've also tried
generating these on the fly, but that breaks in 'make distcheck', as I
would need to write to the source dir or would need to change
osmo-python-tests etc. to read the config file from another directory.)
Related: osmo-ggsn I5b51529b4f8bd2462e54f58a1ce2e2d7c76ff46a
Depends: osmo-python-tests Ic312d546da1c21f68a80b6a188616ef9bc84f4c6
Change-Id: I309807ff0bc125d4653222b2b4ba69ded3bbff70
---
M doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
M doc/examples/osmo-sgsn/osmo-sgsn.cfg
M doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
M osmoappdesc.py
M tests/Makefile.am
M tests/ctrl_test_runner.py
A tests/osmo-sgsn-accept-all.cfg
A tests/osmo-sgsn.cfg
M tests/vty_test_runner.py
9 files changed, 111 insertions(+), 8 deletions(-)
Approvals:
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
index 69000b4..9bc1520 100644
--- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
+++ b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
@@ -14,6 +14,7 @@
no login
!
sgsn
+ gtp state-dir /var/lib/osmocom/osmo-sgsn
gtp local-ip 127.0.0.1
ggsn 0 remote-ip 127.0.0.2
ggsn 0 gtp-version 1
diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg
index 0b5ef4b..8104725 100644
--- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg
+++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg
@@ -14,6 +14,7 @@
no login
!
sgsn
+ gtp state-dir /var/lib/osmocom/osmo-sgsn
gtp local-ip 127.0.0.1
ggsn 0 remote-ip 127.0.0.2
ggsn 0 gtp-version 1
diff --git a/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
b/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
index a7ed9cf..d7fbd75 100644
--- a/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
+++ b/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
@@ -23,6 +23,7 @@
asp asp-clnt-OsmoSGSN-A
routing-key 3 0.23.4
sgsn
+ gtp state-dir /var/lib/osmocom/osmo-sgsn
gtp local-ip 127.0.0.1
ggsn 0 remote-ip 127.0.0.2
ggsn 0 gtp-version 1
diff --git a/osmoappdesc.py b/osmoappdesc.py
index c327597..b0a9164 100644
--- a/osmoappdesc.py
+++ b/osmoappdesc.py
@@ -16,7 +16,7 @@
app_configs = {
- "sgsn": ["doc/examples/osmo-sgsn/osmo-sgsn.cfg"],
+ "sgsn": ["tests/osmo-sgsn.cfg"],
"gtphub": ["doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg"]
}
@@ -25,7 +25,6 @@
(4253, "src/gtphub/osmo-gtphub", "OsmoGTPhub",
"gtphub")
]
-vty_command = ["./src/sgsn/osmo-sgsn", "-c",
- "doc/examples/osmo-sgsn/osmo-sgsn.cfg"]
+vty_command = ["./src/sgsn/osmo-sgsn", "-c",
"tests/osmo-sgsn.cfg"]
vty_app = apps[0]
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2c07ac9..fc5af0b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -32,6 +32,8 @@
$(TESTSUITE) \
vty_test_runner.py \
ctrl_test_runner.py \
+ osmo-sgsn-accept-all.cfg \
+ osmo-sgsn.cfg \
osmo-sgsn_test-nodes.vty \
$(NULL)
@@ -62,7 +64,7 @@
vty-transcript-test: $(top_builddir)/src/sgsn/osmo-sgsn
osmo_verify_transcript_vty.py -v \
-n OsmoSGSN -p 4245 \
- -r "$(top_builddir)/src/sgsn/osmo-sgsn -c
$(top_srcdir)/doc/examples/osmo-sgsn/osmo-sgsn.cfg" \
+ -r "$(top_builddir)/src/sgsn/osmo-sgsn -c $(top_srcdir)/tests/osmo-sgsn.cfg"
\
$(U) $${T:-$(srcdir)/osmo-sgsn*.vty}
rm -f $(builddir)/gsn_restart
diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py
index 69b2478..20c59eb 100755
--- a/tests/ctrl_test_runner.py
+++ b/tests/ctrl_test_runner.py
@@ -145,8 +145,7 @@
class TestCtrlSGSN(TestCtrlBase):
def ctrl_command(self):
- return ["./src/sgsn/osmo-sgsn", "-c",
- "doc/examples/osmo-sgsn/osmo-sgsn.cfg"]
+ return ["./src/sgsn/osmo-sgsn", "-c",
"tests/osmo-sgsn.cfg"]
def ctrl_app(self):
return (4251, "./src/sgsn/osmo-sgsn", "OsmoSGSN",
"sgsn")
diff --git a/tests/osmo-sgsn-accept-all.cfg b/tests/osmo-sgsn-accept-all.cfg
new file mode 100644
index 0000000..46a5d61
--- /dev/null
+++ b/tests/osmo-sgsn-accept-all.cfg
@@ -0,0 +1,38 @@
+# Same as doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg, but without 'gtp
state-dir'
+!
+! Osmocom SGSN configuration
+!
+!
+log stderr
+ logging color 1
+ logging print category-hex 0
+ logging print category 1
+ logging timestamp 0
+ logging print file basename last
+ logging print level 1
+
+line vty
+ no login
+!
+sgsn
+ gtp local-ip 127.0.0.1
+ ggsn 0 remote-ip 127.0.0.2
+ ggsn 0 gtp-version 1
+ ggsn 0 echo-interval 60
+ authentication optional
+ auth-policy accept-all
+!
+ns
+ timer tns-block 3
+ timer tns-block-retries 3
+ timer tns-reset 3
+ timer tns-reset-retries 3
+ timer tns-test 30
+ timer tns-alive 3
+ timer tns-alive-retries 10
+ bind udp local
+ listen 127.0.0.1 23000
+ accept-ipaccess
+!
+bssgp
+!
diff --git a/tests/osmo-sgsn.cfg b/tests/osmo-sgsn.cfg
new file mode 100644
index 0000000..cf8509c
--- /dev/null
+++ b/tests/osmo-sgsn.cfg
@@ -0,0 +1,40 @@
+# Same as doc/examples/osmo-sgsn/osmo-sgsn.cfg, but without 'gtp state-dir'
+!
+! Osmocom SGSN configuration
+!
+!
+log stderr
+ logging color 1
+ logging print category-hex 0
+ logging print category 1
+ logging timestamp 0
+ logging print file basename last
+ logging print level 1
+
+line vty
+ no login
+!
+sgsn
+ gtp local-ip 127.0.0.1
+ ggsn 0 remote-ip 127.0.0.2
+ ggsn 0 gtp-version 1
+ ggsn 0 echo-interval 60
+ authentication required
+ auth-policy remote
+ gsup remote-ip 127.0.0.1
+ gsup remote-port 4222
+!
+ns
+ timer tns-block 3
+ timer tns-block-retries 3
+ timer tns-reset 3
+ timer tns-reset-retries 3
+ timer tns-test 30
+ timer tns-alive 3
+ timer tns-alive-retries 10
+ bind udp local
+ listen 127.0.0.1 23000
+ accept-ipaccess
+!
+bssgp
+!
diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py
index 0b7df8c..aaa76ed 100755
--- a/tests/vty_test_runner.py
+++ b/tests/vty_test_runner.py
@@ -70,8 +70,7 @@
class TestVTYSGSN(TestVTYBase):
def vty_command(self):
- return ["./src/sgsn/osmo-sgsn", "-c",
- "doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg"]
+ return ["./src/sgsn/osmo-sgsn", "-c",
"tests/osmo-sgsn-accept-all.cfg"]
def vty_app(self):
return (4245, "./src/sgsn/osmo-sgsn", "OsmoSGSN",
"sgsn")
--
To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/36845?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I309807ff0bc125d4653222b2b4ba69ded3bbff70
Gerrit-Change-Number: 36845
Gerrit-PatchSet: 6
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
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-MessageType: merged