blob: f765f806d48d56a775da26ea377ee45e0db7085c [file] [log] [blame]
Pau Espin Pedroldcc67fc2018-11-21 13:55:47 +01001#!/usr/bin/env python3
2
3# Following test verifies CS paging works when MS is GPRS attached.
4# See OS#2204 for more information.
5
6from osmo_gsm_tester.testenv import *
7
Pau Espin Pedrolffe1b082018-12-05 17:46:21 +01008import testlib
Pau Espin Pedrol40c7bc72020-05-05 13:41:42 +02009tenv.test_import_modules_register_for_cleanup(testlib)
Pau Espin Pedrolffe1b082018-12-05 17:46:21 +010010from testlib import setup_run_iperf3_test_parallel
Pau Espin Pedroldcc67fc2018-11-21 13:55:47 +010011
Pau Espin Pedrolffe1b082018-12-05 17:46:21 +010012def ready_cb_place_voicecall(ms_li):
13 print('waiting a few secs to make sure iperf3 test is running')
14 sleep(2)
15 # At this point in time, TBF should be enabled on both MS since they are sending/receiving data.
16 print('iperf3 running, let\'s place a call')
17 ms_mo = ms_li[0]
18 ms_mt = ms_li[1]
19 assert len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0
20 mo_cid = ms_mo.call_dial(ms_mt)
21 mt_cid = ms_mt.call_wait_incoming(ms_mo)
22 print('dial success')
Pau Espin Pedroldcc67fc2018-11-21 13:55:47 +010023
Pau Espin Pedrolffe1b082018-12-05 17:46:21 +010024 assert not ms_mo.call_is_active(mo_cid) and not ms_mt.call_is_active(mt_cid)
25 ms_mt.call_answer(mt_cid)
26 wait(ms_mo.call_is_active, mo_cid)
27 wait(ms_mt.call_is_active, mt_cid)
28 print('answer success, call established and ongoing')
Pau Espin Pedroldcc67fc2018-11-21 13:55:47 +010029
Pau Espin Pedrolffe1b082018-12-05 17:46:21 +010030 sleep(5) # maintain the call active for 5 seconds
Pau Espin Pedroldcc67fc2018-11-21 13:55:47 +010031
Pau Espin Pedrolffe1b082018-12-05 17:46:21 +010032 assert ms_mo.call_is_active(mo_cid) and ms_mt.call_is_active(mt_cid)
33 ms_mt.call_hangup(mt_cid)
34 wait(lambda: len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0)
35 print('hangup success')
Pau Espin Pedroldcc67fc2018-11-21 13:55:47 +010036
Pau Espin Pedroldcc67fc2018-11-21 13:55:47 +010037
Pau Espin Pedrolffe1b082018-12-05 17:46:21 +010038setup_run_iperf3_test_parallel(2, ready_cb=ready_cb_place_voicecall)