The test scripts warn about missing documentation, untested configs, check common errors, and stub out testing individual VTY commands. The scripts have been moved to the another osmocom repository, python/osmo-python-tests The features were requested by zecke.neels/jolly/new_handover
parent
cc6b2d2fa3
commit
e0aee7aaa9
@ -1,57 +0,0 @@ |
||||
#!/usr/bin/env python |
||||
|
||||
""" |
||||
Start the process and dump the documentation to the doc dir. This is |
||||
copied from the BTS directory and a fix might need to be applied there |
||||
too. |
||||
""" |
||||
|
||||
import socket, subprocess, time,os |
||||
|
||||
|
||||
def dump_doc(end, port, filename): |
||||
sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
||||
sck.setblocking(1) |
||||
sck.connect(("localhost", port)) |
||||
sck.recv(4096) |
||||
|
||||
# Now send the command |
||||
sck.send("show online-help\r") |
||||
xml = "" |
||||
while True: |
||||
data = sck.recv(4096) |
||||
xml = "%s%s" % (xml, data) |
||||
if data.endswith(end): |
||||
break |
||||
|
||||
# Now write everything until the end to the file |
||||
out = open(filename, 'w') |
||||
out.write(xml[18:len(end)*-1]) |
||||
out.close() |
||||
|
||||
|
||||
apps = [ |
||||
# The same could be done with an empty config file but this way |
||||
# the example files are properly tested. |
||||
(4242, "src/osmo-nitb/osmo-nitb", "doc/examples/osmo-nitb/nanobts/openbsc.cfg", "OpenBSC", "nitb"), |
||||
(4242, "src/osmo-bsc/osmo-bsc", "doc/examples/osmo-bsc/osmo-bsc.cfg", "OsmoBSC", "bsc"), |
||||
(4243, "src/osmo-bsc_mgcp/osmo-bsc_mgcp", "doc/examples/osmo-bsc_mgcp/mgcp.cfg", "OpenBSC MGCP", "mgcp"), |
||||
(4244, "src/osmo-bsc_nat/osmo-bsc_nat", "doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg", "OsmoBSCNAT", "nat"), |
||||
(4245, "src/gprs/osmo-sgsn", "doc/examples/osmo-sgsn/osmo-sgsn.cfg", "OsmoSGSN", "sgsn"), |
||||
(4246, "src/gprs/osmo-gbproxy", "doc/examples/osmo-gbproxy/osmo-gbproxy.cfg", "OsmoGbProxy", "gbproxy"), |
||||
] |
||||
|
||||
# Dump the config of all our apps |
||||
for app in apps: |
||||
print "Starting app for %s" % app[4] |
||||
|
||||
cmd = [app[1], "-c", app[2]] |
||||
proc = subprocess.Popen(cmd, stdin=None, stdout=None) |
||||
time.sleep(1) |
||||
try: |
||||
dump_doc('\r\n%s> ' % app[3], app[0], 'doc/%s_vty_reference.xml' % app[4]) |
||||
finally: |
||||
# Clean-up |
||||
proc.kill() |
||||
proc.wait() |
||||
|
@ -1,3 +1,64 @@ |
||||
nat |
||||
! |
||||
! OsmoBSCNAT (0.12.0.266-2daa9) configuration saved from vty |
||||
!! |
||||
! |
||||
log stderr |
||||
logging filter all 1 |
||||
logging color 1 |
||||
logging timestamp 0 |
||||
logging level all everything |
||||
logging level rll notice |
||||
logging level cc notice |
||||
logging level mm notice |
||||
logging level rr notice |
||||
logging level rsl notice |
||||
logging level nm info |
||||
logging level mncc notice |
||||
logging level pag notice |
||||
logging level meas notice |
||||
logging level sccp notice |
||||
logging level msc notice |
||||
logging level mgcp notice |
||||
logging level ho notice |
||||
logging level db notice |
||||
logging level ref notice |
||||
logging level gprs everything |
||||
logging level ns info |
||||
logging level bssgp everything |
||||
logging level llc everything |
||||
logging level sndcp everything |
||||
logging level nat notice |
||||
logging level ctrl notice |
||||
logging level smpp everything |
||||
logging level lglobal notice |
||||
logging level llapd notice |
||||
logging level linp notice |
||||
logging level lmux notice |
||||
logging level lmi notice |
||||
logging level lmib notice |
||||
logging level lsms notice |
||||
! |
||||
line vty |
||||
no login |
||||
! |
||||
mgcp |
||||
call agent ip 127.0.0.1 |
||||
bind ip 0.0.0.0 |
||||
bind port 2427 |
||||
rtp bts-base 4000 |
||||
rtp net-base 16000 |
||||
rtp ip-dscp 0 |
||||
no rtcp-omit |
||||
sdp audio-payload number 126 |
||||
sdp audio-payload name AMR/8000 |
||||
loop 0 |
||||
number endpoints 1 |
||||
call-agent ip 127.0.0.1 |
||||
rtp transcoder-base 0 |
||||
transcoder-remote-base 4000 |
||||
nat |
||||
msc ip 127.0.0.1 |
||||
msc port 5000 |
||||
timeout auth 2 |
||||
timeout ping 20 |
||||
timeout pong 5 |
||||
ip-dscp 0 |
||||
|
@ -0,0 +1,52 @@ |
||||
#!/usr/bin/env python |
||||
|
||||
# (C) 2013 by Katerina Barone-Adesi <kat.obsc@gmail.com> |
||||
# This program is free software: you can redistribute it and/or modify |
||||
# it under the terms of the GNU General Public License as published by |
||||
# the Free Software Foundation, either version 3 of the License, or |
||||
# (at your option) any later version. |
||||
|
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
|
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program. If not, see <http://www.gnu.org/licenses/> |
||||
|
||||
|
||||
# Most systems won't be able to use these, so they're separated out |
||||
nitb_e1_configs = [ |
||||
"doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg", |
||||
"doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg", |
||||
"doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg", |
||||
"doc/examples/osmo-nitb/bs11/openbsc.cfg", |
||||
"doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg", |
||||
"doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", |
||||
"doc/examples/osmo-nitb/rbs2308/openbsc.cfg" |
||||
] |
||||
|
||||
|
||||
app_configs = { |
||||
"osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], |
||||
"nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], |
||||
"mgcp": ["doc/examples/osmo-bsc_mgcp/mgcp.cfg"], |
||||
"gbproxy": ["doc/examples/osmo-gbproxy/osmo-gbproxy.cfg"], |
||||
"sgsn": ["doc/examples/osmo-sgsn/osmo-sgsn.cfg"], |
||||
"nitb": ["doc/examples/osmo-nitb/hsl/openbsc.cfg", |
||||
"doc/examples/osmo-nitb/nanobts/openbsc.cfg"] |
||||
} |
||||
|
||||
|
||||
apps = [(4242, "src/osmo-bsc/osmo-bsc", "OsmoBSC", "osmo-bsc"), |
||||
(4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat"), |
||||
(4243, "src/osmo-bsc_mgcp/osmo-bsc_mgcp", "OpenBSC MGCP", "mgcp"), |
||||
(4246, "src/gprs/osmo-gbproxy", "OsmoGbProxy", "gbproxy"), |
||||
(4245, "src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn"), |
||||
(4242, "src/osmo-nitb/osmo-nitb", "OpenBSC", "nitb") |
||||
] |
||||
|
||||
vty_command = ["./src/osmo-nitb/osmo-nitb", "-c", |
||||
"doc/examples/osmo-nitb/hsl/openbsc.cfg"] |
||||
|
||||
vty_app = apps[-1] |
Loading…
Reference in new issue