Pau Espin Pedrol | 5a012ee | 2020-02-06 19:33:22 +0100 | [diff] [blame] | 1 | module BTS_Tests_perf { |
| 2 | |
| 3 | /* Performance Tests for OsmoBTS |
| 4 | * (C) 2020 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Released under the terms of GNU General Public License, Version 2 or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 11 | * |
| 12 | * This test suite tests performance of OsmoBTS under different heavy load scenarios. |
| 13 | */ |
| 14 | |
| 15 | import from Misc_Helpers all; |
| 16 | import from General_Types all; |
| 17 | import from Osmocom_Types all; |
| 18 | import from GSM_Types all; |
| 19 | import from L1CTL_PortType all; |
| 20 | import from L1CTL_Types all; |
| 21 | import from LAPDm_Types all; |
| 22 | import from IPA_Emulation all; |
| 23 | import from GSM_RR_Types all; |
| 24 | |
| 25 | import from RSL_Types all; |
| 26 | import from RSL_Emulation all; |
| 27 | |
| 28 | import from PCUIF_Types all; |
| 29 | import from PCUIF_CodecPort all; |
| 30 | |
| 31 | import from Osmocom_VTY_Functions all; |
| 32 | |
| 33 | import from BTS_Tests all; |
| 34 | |
| 35 | /*********************************************************************** |
| 36 | * Performance tests. Expect osmo-bts to be configured with all TRX as TCH/H. |
| 37 | ***********************************************************************/ |
| 38 | |
| 39 | modulepar { |
| 40 | float mp_wait_time := 10.0; |
| 41 | } |
| 42 | |
| 43 | |
| 44 | /* This test requires BTS with 1 TRX to be configured with following timeslots: TS[0]=CCCH+SDCCH4, TS[1..7]: TCH/H |
| 45 | * One can simply take the osmo-bsc.cfg in the same dir and change TS1..7, that's all needed. |
| 46 | * It will activate TS1..7 TCH/Hchannels (2 TCH/H per TS, that's 14 channels) |
| 47 | * and wait for requested time. This test is useful to bring the BTS (+BTS-TRX) |
| 48 | * into a high channel load state to check that the system it runs on can keep |
| 49 | * on with full load. |
| 50 | */ |
| 51 | function f_TC_highchanload_tchh(charstring id) runs on ConnHdlr { |
| 52 | var ChannelNrs chan_nr := { /* TS 1..7: TCH/H */ |
| 53 | valueof(ts_RslChanNr_Lm(1,0)), valueof(ts_RslChanNr_Lm(1,1)), |
| 54 | valueof(ts_RslChanNr_Lm(2,0)), valueof(ts_RslChanNr_Lm(2,1)), |
| 55 | valueof(ts_RslChanNr_Lm(3,0)), valueof(ts_RslChanNr_Lm(3,1)), |
| 56 | valueof(ts_RslChanNr_Lm(4,0)), valueof(ts_RslChanNr_Lm(4,1)), |
| 57 | valueof(ts_RslChanNr_Lm(5,0)), valueof(ts_RslChanNr_Lm(5,1)), |
| 58 | valueof(ts_RslChanNr_Lm(6,0)), valueof(ts_RslChanNr_Lm(6,1)), |
| 59 | valueof(ts_RslChanNr_Lm(7,0)), valueof(ts_RslChanNr_Lm(7,1)) |
| 60 | }; |
| 61 | |
| 62 | log("Started"); |
| 63 | for (var integer i := 0; i < sizeof(chan_nr); i := i+1) { |
| 64 | log("Registering ", chan_nr[i]); |
| 65 | f_rslem_register(0, chan_nr[i]); |
| 66 | } |
| 67 | log("Registered"); |
| 68 | for (var integer i := 0; i < sizeof(chan_nr); i := i+1) { |
| 69 | f_rsl_transceive(ts_RSL_CHAN_ACT(chan_nr[i], |
| 70 | ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3 /* AMR*/)), |
| 71 | tr_RSL_CHAN_ACT_ACK(chan_nr[i]), |
| 72 | log2str("RSL CHAN ACT [", i, "]")); |
| 73 | } |
| 74 | log("Activated, now waiting ", mp_wait_time, " seconds"); |
| 75 | |
| 76 | f_sleep(mp_wait_time); |
| 77 | log("sleep done, deactivating"); |
| 78 | |
| 79 | for (var integer i := 0; i < sizeof(chan_nr); i := i+1) { |
| 80 | f_rsl_transceive(ts_RSL_RF_CHAN_REL(chan_nr[i]), |
| 81 | tr_RSL_RF_CHAN_REL_ACK(chan_nr[i]), |
| 82 | log2str("RF CHAN REL [", i, "]"), |
| 83 | true); |
| 84 | } |
| 85 | setverdict(pass); |
| 86 | } |
| 87 | testcase TC_highchanload_tchh() runs on test_CT { |
| 88 | var ConnHdlr vc_conn; /* 1..7 * 2 */ |
Vadim Yanitskiy | 28cabc4 | 2020-05-27 19:44:44 +0700 | [diff] [blame] | 89 | var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN, |
| 90 | t_guard := 60.0 + mp_wait_time)); |
Pau Espin Pedrol | 5a012ee | 2020-02-06 19:33:22 +0100 | [diff] [blame] | 91 | |
| 92 | f_init(); |
| 93 | |
| 94 | vc_conn := f_start_handler(refers(f_TC_highchanload_tchh), pars); |
| 95 | vc_conn.done; |
| 96 | } |
| 97 | |
| 98 | control { |
| 99 | execute( TC_highchanload_tchh() ); |
| 100 | } |
| 101 | |
| 102 | |
| 103 | } |