aboutsummaryrefslogtreecommitdiffstats
path: root/bts/BTS_Tests_perf.ttcn
blob: 5b3b672a7ae5499689f128efd2b0f5be26e8c684 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
module BTS_Tests_perf {

/* Performance Tests for OsmoBTS
 * (C) 2020 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
 * All rights reserved.
 *
 * Released under the terms of GNU General Public License, Version 2 or
 * (at your option) any later version.
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * This test suite tests performance of OsmoBTS under different heavy load scenarios.
 */

import from Misc_Helpers all;
import from General_Types all;
import from Osmocom_Types all;
import from GSM_Types all;
import from L1CTL_PortType all;
import from L1CTL_Types all;
import from LAPDm_Types all;
import from IPA_Emulation all;
import from GSM_RR_Types all;

import from RSL_Types all;
import from RSL_Emulation all;

import from PCUIF_Types all;
import from PCUIF_CodecPort all;

import from Osmocom_VTY_Functions all;

import from BTS_Tests all;

/***********************************************************************
 * Performance tests. Expect osmo-bts to be configured with all TRX as TCH/H.
 ***********************************************************************/

modulepar {
	float mp_wait_time := 10.0;
}


/* This test requires BTS with 1 TRX to be configured with following timeslots: TS[0]=CCCH+SDCCH4, TS[1..7]: TCH/H
 * One can simply take the osmo-bsc.cfg in the same dir and change TS1..7, that's all needed.
 * It will activate TS1..7 TCH/Hchannels (2 TCH/H per TS, that's 14 channels)
 * and wait for requested time. This test is useful to bring the BTS (+BTS-TRX)
 * into a high channel load state to check that the system it runs on can keep
 * on with full load.
 */
function f_TC_highchanload_tchh(charstring id) runs on ConnHdlr {
	var ChannelNrs chan_nr := { /* TS 1..7: TCH/H */
		valueof(ts_RslChanNr_Lm(1,0)), valueof(ts_RslChanNr_Lm(1,1)),
		valueof(ts_RslChanNr_Lm(2,0)), valueof(ts_RslChanNr_Lm(2,1)),
		valueof(ts_RslChanNr_Lm(3,0)), valueof(ts_RslChanNr_Lm(3,1)),
		valueof(ts_RslChanNr_Lm(4,0)), valueof(ts_RslChanNr_Lm(4,1)),
		valueof(ts_RslChanNr_Lm(5,0)), valueof(ts_RslChanNr_Lm(5,1)),
		valueof(ts_RslChanNr_Lm(6,0)), valueof(ts_RslChanNr_Lm(6,1)),
		valueof(ts_RslChanNr_Lm(7,0)), valueof(ts_RslChanNr_Lm(7,1))
		};

	log("Started");
	for (var integer i := 0; i < sizeof(chan_nr); i := i+1) {
		log("Registering ", chan_nr[i]);
		f_rslem_register(0, chan_nr[i]);
	}
	log("Registered");
	for (var integer i := 0; i < sizeof(chan_nr); i := i+1) {
		f_rsl_transceive(ts_RSL_CHAN_ACT(chan_nr[i],
				 ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3 /* AMR*/)),
				 tr_RSL_CHAN_ACT_ACK(chan_nr[i]),
				 log2str("RSL CHAN ACT [", i, "]"));
	}
	log("Activated, now waiting ", mp_wait_time, " seconds");

	f_sleep(mp_wait_time);
	log("sleep done, deactivating");

	for (var integer i := 0; i < sizeof(chan_nr); i := i+1) {
		f_rsl_transceive(ts_RSL_RF_CHAN_REL(chan_nr[i]),
				 tr_RSL_RF_CHAN_REL_ACK(chan_nr[i]),
				 log2str("RF CHAN REL [", i, "]"),
				 true);
	}
	setverdict(pass);
}
testcase TC_highchanload_tchh() runs on test_CT {
	var ConnHdlr vc_conn; /* 1..7 * 2 */
	var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN,
						t_guard := 60.0 + mp_wait_time));

	f_init();

	vc_conn := f_start_handler(refers(f_TC_highchanload_tchh), pars);
	vc_conn.done;
}

control {
	execute( TC_highchanload_tchh() );
}


}