pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/mncc-python/+/39143?usp=email )
Change subject: mncc_mt_loadgen.py: Allow configuring first_msisdn_called in calls()
......................................................................
mncc_mt_loadgen.py: Allow configuring first_msisdn_called in calls()
The msisdns to use actually depen on external configuration. Hence allow
passing an initial MSIDN to incrementally setup calls.
Take the chance to match the default msisdn first value with abis-load-test.
Change-Id: I2dd6b96ea2da117d67a368bc076969f25fa61a52
---
M mncc_mt_loadgen.py
1 file changed, 11 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/mncc-python refs/changes/43/39143/1
diff --git a/mncc_mt_loadgen.py b/mncc_mt_loadgen.py
index 8e7a65b..1a4a998 100755
--- a/mncc_mt_loadgen.py
+++ b/mncc_mt_loadgen.py
@@ -178,10 +178,16 @@
call_conn.start_call(msisdn_called, msisdn_calling, codec)
return call_conn
-def calls(nr, ramp=1.0, codec='GSM_FR'):
+def calls(nr, ramp=1.0, codec='GSM_FR',
first_msisdn_called='402965200501'):
+ first_msisdn_called_int = int(first_msisdn_called)
+ needed_len = len(str(first_msisdn_called_int + (nr-1)))
+ # If user passed a longer zero-preffixed input, take it into account:
+ if len(first_msisdn_called) > needed_len:
+ needed_len = len(first_msisdn_called)
for i in range(nr):
- a = 90001 + i
- a = str(a)
+ a = str(first_msisdn_called_int + i)
+ # prepend with zeros as needed:
+ a = a.zfill(needed_len)
print("%d: mt_call(%r)" % (i, a))
mt_call(a, codec=codec)
time.sleep(ramp)
@@ -189,9 +195,9 @@
log.info("")
log.info("")
log.info("Start a single call by typing:")
-log.info(" mt_call('90001')")
+log.info(" mt_call('402965200501')")
log.info("With a specific codec (default is 'GSM_FR'):")
-log.info(" mt_call('90001', codec='GSM_EFR')")
+log.info(" mt_call('402965200501', codec='GSM_EFR')")
log.info("Start multiple calls with (e.g. 4 calls with EFR):")
log.info(" calls(4, codec='GSM_EFR')")
log.info("")
--
To view, visit
https://gerrit.osmocom.org/c/mncc-python/+/39143?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: I2dd6b96ea2da117d67a368bc076969f25fa61a52
Gerrit-Change-Number: 39143
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>