add debug suite

Change-Id: I818d130d01ed26e38b5f33341de3727e9f17ca52
This commit is contained in:
Neels Hofmeyr 2017-05-06 15:06:04 +02:00
parent cccbe5987d
commit 67cea22236
2 changed files with 46 additions and 0 deletions

36
suites/debug/interactive.py Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env python3
from osmo_gsm_tester.test import *
print('use resources...')
nitb = suite.nitb()
bts = suite.bts()
modems = suite.modems(int(prompt('How many modems?')))
print('start nitb and bts...')
nitb.bts_add(bts)
nitb.start()
bts.start()
for m in modems:
nitb.subscriber_add(m)
m.connect(nitb)
while True:
cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered')
cmd = cmd.strip().lower()
if not cmd:
continue
if 'quit'.startswith(cmd):
break
elif 'wait-registered'.startswith(cmd):
wait(nitb.subscriber_attached, *modems)
elif 'get-registered'.startswith(cmd):
print(nitb.imsi_list_attached())
print('RESULT: %s' %
('All modems are registered.' if nitb.subscriber_attached(*modems)
else 'Some modem(s) not registered yet.'))
elif 'sms'.startswith(cmd):
for mo in modems:
for mt in modems:
mo.sms_send(mt.msisdn, 'to ' + mt.name())

10
suites/debug/suite.conf Normal file
View File

@ -0,0 +1,10 @@
resources:
nitb_iface:
- times: 1
bts:
- times: 1
modem:
- times: 4
defaults:
timeout: 60s