[PATCH] osmo-gsm-tester[master]: suites: gprs: Introduce suite with ping test

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Nov 23 16:39:45 UTC 2017


Review at  https://gerrit.osmocom.org/5011

suites: gprs: Introduce suite with ping test

Change-Id: I8695029cb7a43cd48f650c88f38b4c054da0bc6b
---
M example/resources.conf
A suites/gprs/ping.py
A suites/gprs/suite.conf
3 files changed, 63 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/11/5011/1

diff --git a/example/resources.conf b/example/resources.conf
index d503a48..26e1d80 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -7,6 +7,8 @@
 - addr: 10.42.42.5
 - addr: 10.42.42.6
 - addr: 10.42.42.7
+- addr: 10.42.42.8
+- addr: 10.42.42.9
 
 bts:
 - label: sysmoBTS 1002
diff --git a/suites/gprs/ping.py b/suites/gprs/ping.py
new file mode 100755
index 0000000..3a0eb3a
--- /dev/null
+++ b/suites/gprs/ping.py
@@ -0,0 +1,52 @@
+#!/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()
+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

-- 
To view, visit https://gerrit.osmocom.org/5011
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8695029cb7a43cd48f650c88f38b4c054da0bc6b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list