tests: Introduce vty-transcript-test tests

Add a few commands to make sure it's working fine, and print all
available timers with default values.

Change-Id: Ifd092b9561d49be1f62769d95ba49f6e4aeb4066
This commit is contained in:
Pau Espin 2019-08-14 20:22:59 +02:00
parent 1b8364d0b5
commit 4330ea9630
2 changed files with 89 additions and 5 deletions

View File

@ -33,6 +33,7 @@ EXTRA_DIST = \
$(TESTSUITE) \
vty_test_runner.py \
ctrl_test_runner.py \
test_nodes.vty \
$(NULL)
TESTSUITE = $(srcdir)/testsuite
@ -43,16 +44,38 @@ DISTCLEANFILES = \
if ENABLE_EXT_TESTS
python-tests: $(BUILT_SOURCES)
osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
$(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v
$(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v
rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count
$(MAKE) vty-test
$(MAKE) ctrl-python-test
else
python-tests: $(BUILT_SOURCES)
echo "Not running python-based tests (determined at configure-time)"
endif
vty-python-test: $(BUILT_SOURCES)
osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
$(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v
rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count
# To update the VTY script from current application behavior,
# pass -u to vty_script_runner.py by doing:
# make vty-transcript-test U=-u
vty-transcript-test:
osmo_verify_transcript_vty.py -v \
-n OsmoSGSN -p 4245 \
-r "$(top_builddir)/src/gprs/osmo-sgsn -c $(top_srcdir)/doc/examples/osmo-sgsn/osmo-sgsn.cfg" \
$(U) $${T:-$(srcdir)/*.vty}
rm -f $(builddir)/sms.db $(builddir)/gsn_restart
# don't run multiple tests concurrently so that the ports don't conflict
vty-test:
$(MAKE) vty-python-test
$(MAKE) vty-transcript-test
ctrl-python-test: $(BUILT_SOURCES)
$(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v
rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count
check-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
$(MAKE) $(AM_MAKEFLAGS) python-tests

61
tests/test_nodes.vty Normal file
View File

@ -0,0 +1,61 @@
OsmoSGSN> enable
OsmoSGSN# show timer
T3312 = 600 s Periodic RA Update timer (s) (default: 600 s)
T3313 = 30 s Waiting for paging response timer (s) (default: 30 s)
T3314 = 44 s Force to STANDBY on expiry timer (s) (default: 44 s)
T3316 = 44 s AA-Ready timer (s) (default: 44 s)
T3322 = 6 s Detach request -> accept timer (s) (default: 6 s)
T3350 = 6 s Waiting for ATT/RAU/TMSI_COMPL timer (s) (default: 6 s)
T3360 = 6 s Waiting for AUTH/CIPH response timer (s) (default: 6 s)
T3370 = 6 s Waiting for IDENTITY response timer (s) (default: 6 s)
T3385 = 8 s Wait for ACT PDP CTX REQ timer (s) (default: 8 s)
T3386 = 8 s Wait for MODIFY PDP CTX ACK timer (s) (default: 8 s)
T3395 = 8 s Wait for DEACT PDP CTX ACK timer (s) (default: 8 s)
T3397 = 8 s Wait for DEACT AA PDP CTX ACK timer (s) (default: 8 s)
OsmoSGSN# configure terminal
OsmoSGSN(config)# list
...
sgsn
ctrl
...
ns
bssgp
...
OsmoSGSN(config)# sgsn
OsmoSGSN(config-sgsn)# list
...
gtp local-ip A.B.C.D
ggsn <0-255> remote-ip A.B.C.D
ggsn <0-255> gtp-version (0|1)
ggsn <0-255> echo-interval <1-36000>
ggsn <0-255> no echo-interval
imsi-acl (add|del) IMSI
auth-policy (accept-all|closed|acl-only|remote)
authentication (optional|required)
encryption (GEA0|GEA1|GEA2|GEA3|GEA4)
gsup ipa-name NAME
gsup remote-ip A.B.C.D
gsup remote-port <0-65535>
gsup oap-id <0-65535>
gsup oap-k K
gsup oap-opc OPC
apn APNAME ggsn <0-255>
apn APNAME imsi-prefix IMSIPRE ggsn <0-255>
access-point-name NAME
no access-point-name NAME
cdr filename NAME
no cdr filename
cdr trap
no cdr trap
cdr interval <1-2147483647>
ggsn dynamic
grx-dns-add A.B.C.D
timer [TNNNN] [(<0-2147483647>|default)]
no compression rfc1144
compression rfc1144 active slots <1-256>
compression rfc1144 passive
no compression v42bis
compression v42bis active direction (ms|sgsn|both) codewords <512-65535> strlen <6-250>
compression v42bis passive
...