diff options
author | Max <msuraev@sysmocom.de> | 2017-10-11 16:37:44 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-10-23 18:13:13 +0000 |
commit | fe291a97c23cbabe0be64ac40f104e10d3e13a1d (patch) | |
tree | c6d3ee1f1e7e798777c77b7996d86c01778b554e /tests/sysmobts | |
parent | 36fa0bd0792fe544cd242b7fcee8180685f4c203 (diff) |
Move power loop to generic tests
There's nothing sysmobts specific in this test so let's move it into
separate directory and run unconditionally. The test itself is unaltered
except for intro text.
Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397
Related: OS#2223
Diffstat (limited to 'tests/sysmobts')
-rw-r--r-- | tests/sysmobts/sysmobts_test.c | 62 | ||||
-rw-r--r-- | tests/sysmobts/sysmobts_test.ok | 1 |
2 files changed, 1 insertions, 62 deletions
diff --git a/tests/sysmobts/sysmobts_test.c b/tests/sysmobts/sysmobts_test.c index 6ae76232..32d6e958 100644 --- a/tests/sysmobts/sysmobts_test.c +++ b/tests/sysmobts/sysmobts_test.c @@ -182,72 +182,12 @@ static void test_sysmobts_cipher(void) * this happens asynchronously on the other side of the l1sap queue */ } -static void test_sysmobts_loop(void) -{ - struct gsm_bts bts; - struct gsm_bts_role_bts btsb; - struct gsm_bts_trx trx; - struct gsm_bts_trx_ts ts; - struct gsm_lchan *lchan; - int ret; - - memset(&bts, 0, sizeof(bts)); - memset(&btsb, 0, sizeof(btsb)); - memset(&trx, 0, sizeof(trx)); - memset(&ts, 0, sizeof(ts)); - - lchan = &ts.lchan[0]; - lchan->ts = &ts; - ts.trx = &trx; - trx.bts = &bts; - bts.role = &btsb; - bts.band = GSM_BAND_1800; - trx.ms_power_control = 1; - btsb.ul_power_target = -75; - - printf("Testing sysmobts power control\n"); - - /* Simply clamping */ - lchan->state = LCHAN_S_NONE; - lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - - - /* - * Now 15 dB too little and we should power it up. Could be a - * power level of 7 or 8 for 15 dBm - */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); - - /* It should be clamped to level 0 and 30 dBm */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); - - /* Fix it and jump down */ - lchan->ms_power_ctrl.fixed = 1; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); - - /* And leave it again */ - lchan->ms_power_ctrl.fixed = 0; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); -} - int main(int argc, char **argv) { printf("Testing sysmobts routines\n"); test_sysmobts_auto_band(); test_sysmobts_cipher(); - test_sysmobts_loop(); + return 0; } diff --git a/tests/sysmobts/sysmobts_test.ok b/tests/sysmobts/sysmobts_test.ok index 07d79fd3..1f534172 100644 --- a/tests/sysmobts/sysmobts_test.ok +++ b/tests/sysmobts/sysmobts_test.ok @@ -17,4 +17,3 @@ Checking PCS to PCS PCS to PCS band(1) arfcn(512) want(3) got(3) PCS to PCS band(8) arfcn(128) want(0) got(0) PCS to PCS band(2) arfcn(438) want(-1) got(-1) -Testing sysmobts power control |