Change in mncc-python[master]: mncc_test: add calls() to initiate series of calls

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/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Mar 8 22:48:46 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/mncc-python/+/17406 )

Change subject: mncc_test: add calls() to initiate series of calls
......................................................................

mncc_test: add calls() to initiate series of calls

Change-Id: I0cec9e5dc52e62247da8a3bec47917f929bde5be
---
M mncc_mt_loadgen.py
M mncc_test.py
2 files changed, 25 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved; Verified



diff --git a/mncc_mt_loadgen.py b/mncc_mt_loadgen.py
index 6603e00..a4c0c85 100755
--- a/mncc_mt_loadgen.py
+++ b/mncc_mt_loadgen.py
@@ -176,6 +176,14 @@
     call_conn.start_call(msisdn_called, msisdn_calling)
     return call_conn
 
+def calls(nr, ramp=1.0):
+    for i in range(nr):
+        a = 90001 + i
+        a = str(a)
+        print("%d: mt_call(%r)" % (i, a))
+        mt_call(a)
+        time.sleep(ramp)
+
 log.info("")
 log.info("")
 log.info("Start calls by typing:")
diff --git a/mncc_test.py b/mncc_test.py
index f92c94b..1fe0fca 100755
--- a/mncc_test.py
+++ b/mncc_test.py
@@ -16,6 +16,7 @@
 import logging as log
 import signal, sys, time
 import readline, code
+import time
 
 # MnccActor provides an interface for GsmCallFsm to send MNCC messages
 class MnccActor(pykka.ThreadingActor):
@@ -64,6 +65,20 @@
     call_conn.start_call_ab(msisdn_a, msisdn_b)
     return call_conn
 
+def calls(nr, ramp=1.0):
+    if (nr & 1):
+        print('Only even numbers allowed, because each invocation has two call legs')
+	return
+    nr /= 2
+    for i in range(nr):
+	a = 90001 + 2*i
+	b = a + 1
+	a = str(a)
+	b = str(b)
+	print('%d: connect_call(%r, %r)' % (i, a, b))
+	connect_call(a, b)
+	time.sleep(ramp)
+
 # start a first bogus call
 
 log.info("")
@@ -71,6 +86,8 @@
 log.info("Start calls by typing:")
 log.info('    c = connect_call("90001", "90002")')
 log.info('    c.release()')
+log.info('or')
+log.info('    calls(200)')
 log.info("")
 log.info("")
 

-- 
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/17406
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: I0cec9e5dc52e62247da8a3bec47917f929bde5be
Gerrit-Change-Number: 17406
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200308/9815eb95/attachment.htm>


More information about the gerrit-log mailing list