aboutsummaryrefslogtreecommitdiffstats
path: root/suites
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-08-31 18:30:59 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-12-05 15:06:53 +0100
commit3c9b80d53bcebb46c544d9e69f8db6b0d07aa1d4 (patch)
tree58ed056e7a0d0bb93bcc27a330df48bffa4d3447 /suites
parenta5ed18ac7e2d8161d8438762404b55e20fe6a329 (diff)
suites: gprs: Introduce suite with ping test
Only GPRS signalling setup is supported so far by osmo-gsm-tester, thus we don't test sending data yet here, but at least we can already test pdp context activation. This test will be extended to run ping once we support setting up the GPRS data plane in osmo-gsm-tester. Change-Id: I8695029cb7a43cd48f650c88f38b4c054da0bc6b
Diffstat (limited to 'suites')
-rwxr-xr-xsuites/gprs/ping.py54
-rw-r--r--suites/gprs/suite.conf9
2 files changed, 63 insertions, 0 deletions
diff --git a/suites/gprs/ping.py b/suites/gprs/ping.py
new file mode 100755
index 0000000..46ab540
--- /dev/null
+++ b/suites/gprs/ping.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python3
+from osmo_gsm_tester.testenv import *
+
+hlr = suite.hlr()
+bts = suite.bts()
+pcu = bts.pcu()
+mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+mgw_bsc = suite.mgw()
+stp = suite.stp()
+ggsn = suite.ggsn()
+sgsn = suite.sgsn(hlr, ggsn)
+msc = suite.msc(hlr, mgcpgw, stp)
+bsc = suite.bsc(msc, mgw_bsc, stp)
+ms = suite.modem()
+
+bsc.bts_add(bts)
+sgsn.bts_add(bts)
+
+print('start network...')
+hlr.start()
+stp.start()
+ggsn.start()
+sgsn.start()
+msc.start()
+mgcpgw.start()
+mgw_bsc.start()
+bsc.start()
+
+bts.start()
+print('Waiting for bts to be ready...')
+wait(bts.ready_for_pcu)
+pcu.start()
+
+hlr.subscriber_add(ms)
+
+ms.connect(msc.mcc_mnc())
+ms.attach()
+
+ms.log_info()
+
+print('waiting for modems to attach...')
+wait(ms.is_connected, msc.mcc_mnc())
+wait(msc.subscriber_attached, ms)
+
+print('waiting for modems to attach to data services...')
+wait(ms.is_attached)
+ctx_id_v4 = ms.activate_context(apn='internet', protocol=ms.CTX_PROT_IPv4)
+# IPv6 no supported in EC20: org.ofono.Error.NotImplemented: Implementation not provided (36)
+# ctx_id_v6 = ms.activate_context(apn='inet6', protocol=ms.CTX_PROT_IPv6)
+# IPv46 (dual) not supported in EC20: org.ofono.Error.Failed: Operation failed (36)
+# ctx_id_v46 = ms.activate_context(apn='inet6', protocol=ms.CTX_PROT_IPv46)
+sleep(5)
+# TODO: send ping to server or open TCP conn with a socket in python
+ms.deactivate_context(ctx_id_v4)
diff --git a/suites/gprs/suite.conf b/suites/gprs/suite.conf
new file mode 100644
index 0000000..1590b7d
--- /dev/null
+++ b/suites/gprs/suite.conf
@@ -0,0 +1,9 @@
+resources:
+ ip_address:
+ - times: 8 # msc, bsc, hlr, stp, mgw*2, sgsn, ggsn
+ bts:
+ - times: 1
+ modem:
+ - times: 1
+ features:
+ - gprs