bts: Update towards most recent "laforge/trx" branch
The existing BTS testing code was based on a ~1 week old version of trxcon+fake_trx from osmocom-bb.git fixeria/trx branch, which has meanwhile evolved: * port number change for TRX protocol * FAKE_TIMING -> FAKE_TOA * we can now expect responses to our UDP control commands Let's adapt the testsuite to those changes Change-Id: I6d0122202e5d23308421e76b75e608d206aab56e
This commit is contained in:
parent
883340c719
commit
ef3e1c9a89
|
@ -45,7 +45,7 @@ modulepar {
|
|||
charstring mp_rsl_ip := "127.0.0.2";
|
||||
integer mp_rsl_port := 3003;
|
||||
integer mp_trx0_arfcn := 871;
|
||||
integer mp_bb_trxc_port := 5704;
|
||||
integer mp_bb_trxc_port := 6701;
|
||||
charstring mp_pcu_socket := PCU_SOCK_DEFAULT;
|
||||
}
|
||||
|
||||
|
@ -266,7 +266,7 @@ function f_init(charstring id := "BTS-Test") runs on test_CT {
|
|||
|
||||
/* start with a default moderate timing offset equalling TA=2 */
|
||||
f_main_trxc_connect();
|
||||
BB_TRXC.send(ts_TRXC_Send(g_bb_trxc_conn_id, ts_TRXC_FAKE_TIMING(2*256)));
|
||||
f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, valueof(ts_TRXC_FAKE_TIMING(2*256)));
|
||||
}
|
||||
|
||||
/* Attach L1CTL to master test_CT (classic tests, non-handler mode) */
|
||||
|
@ -323,11 +323,11 @@ private function f_trxc_connect() runs on ConnHdlr {
|
|||
}
|
||||
|
||||
private function f_trxc_fake_rssi(uint8_t rssi) runs on ConnHdlr {
|
||||
BB_TRXC.send(ts_TRXC_Send(g_bb_trxc_conn_id, ts_TRXC_FAKE_RSSI(rssi)));
|
||||
f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, valueof(ts_TRXC_FAKE_RSSI(rssi)));
|
||||
}
|
||||
|
||||
private function f_trx_fake_toffs256(int16_t toffs256) runs on ConnHdlr {
|
||||
BB_TRXC.send(ts_TRXC_Send(g_bb_trxc_conn_id, ts_TRXC_FAKE_TIMING(toffs256)));
|
||||
f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, valueof(ts_TRXC_FAKE_TIMING(toffs256)));
|
||||
}
|
||||
|
||||
/* first function started in ConnHdlr component */
|
||||
|
@ -632,7 +632,7 @@ private function f_main_trxc_connect() runs on test_CT {
|
|||
|
||||
private function f_rach_toffs(int16_t toffs256, boolean expect_pass) runs on test_CT {
|
||||
/* tell fake_trx to use a given timing offset for all bursts */
|
||||
BB_TRXC.send(ts_TRXC_Send(g_bb_trxc_conn_id, ts_TRXC_FAKE_TIMING(toffs256)));
|
||||
f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, valueof(ts_TRXC_FAKE_TIMING(toffs256)));
|
||||
f_sleep(0.5);
|
||||
|
||||
/* Transmit RACH request + wait for confirmation */
|
||||
|
|
|
@ -13,8 +13,8 @@ type record TRXC_RecvFrom {
|
|||
TrxcMessage msg
|
||||
}
|
||||
|
||||
template TRXC_RecvFrom tr_TRXC_RecvFrom(template TrxcMessage msg) := {
|
||||
connId := ?,
|
||||
template TRXC_RecvFrom tr_TRXC_RecvFrom(template ConnectionId cid, template TrxcMessage msg) := {
|
||||
connId := cid,
|
||||
remName := ?,
|
||||
remPort := ?,
|
||||
locName := ?,
|
||||
|
@ -59,4 +59,31 @@ template (value) TRXC_Send ts_TRXC_Send(ConnectionId cid, template (value) TrxcM
|
|||
msg := msg
|
||||
}
|
||||
|
||||
function f_TRXC_transceive(TRXC_CODEC_PT pt, ConnectionId conn_id, TrxcMessage tx,
|
||||
template TrxcMessage tr := ?) return TrxcMessage {
|
||||
var TRXC_RecvFrom rf;
|
||||
timer T := 3.0;
|
||||
/* build better default template */
|
||||
if (istemplatekind(tr, "?")) {
|
||||
tr := {
|
||||
rsp := {
|
||||
verb := tx.cmd.verb,
|
||||
status := ?,
|
||||
params := *
|
||||
}
|
||||
};
|
||||
}
|
||||
pt.send(ts_TRXC_Send(conn_id, tx));
|
||||
T.start;
|
||||
alt {
|
||||
[] pt.receive(tr_TRXC_RecvFrom(conn_id, tr)) -> value rf {
|
||||
return rf.msg;
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "Timeout waiting for ", tr, " on ", pt);
|
||||
}
|
||||
}
|
||||
return rf.msg;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,15 +9,17 @@ type charstring TrxcType ("CMD", "RSP", "IND") with {
|
|||
type charstring TrxcVerb ("POWERON", "POWEROFF", "CLOCK",
|
||||
"RXTUNE", "TXTUNE", "SETSLOT", "SETTSC", "SETBSIC", "SETPOWER",
|
||||
"SETMAXDLY", "SETMAXDLYNB", "SETSLOT", "HANDOVER", "NOHANDOVER",
|
||||
"MEASURE", "FAKE_RSSI", "FAKE_TIMING" ) with {
|
||||
"MEASURE", "FAKE_RSSI", "FAKE_TOA" ) with {
|
||||
variant "TEXT_CODING(,convert=upper_case,
|
||||
'((POWERON)|(POWEROFF)|(CLOCK)|(RXTUNE)|(TXTUNE)|(SETSLOT)|(SETTSC)|(SETBSIC)|(SETPOWER)|(SETMAXDLY)|(SETMAXDLYNB)|(HANDOVER)|(NOHANDOVER)|(MEASURE)|(FAKE_RSSI)|(FAKE_TIMING))'
|
||||
'((POWERON)|(POWEROFF)|(CLOCK)|(RXTUNE)|(TXTUNE)|(SETSLOT)|(SETTSC)|(SETBSIC)|(SETPOWER)|(SETMAXDLY)|(SETMAXDLYNB)|(HANDOVER)|(NOHANDOVER)|(MEASURE)|(FAKE_RSSI)|(FAKE_TOA))'
|
||||
,case_insensitive)"
|
||||
}
|
||||
|
||||
type integer TrxcStatus;
|
||||
type charstring TrxcParam;
|
||||
type record of TrxcParam TrxcParams;
|
||||
type record of TrxcParam TrxcParams with {
|
||||
variant "SEPARATOR(' ', ' ')"
|
||||
}
|
||||
|
||||
type record TrxcCommand {
|
||||
TrxcVerb verb,
|
||||
|
@ -63,10 +65,10 @@ template (value) TrxcMessage ts_TRXC_FAKE_RSSI(uint8_t rssi) := {
|
|||
}
|
||||
}
|
||||
|
||||
template (value) TrxcMessage ts_TRXC_FAKE_TIMING(int16_t timing) := {
|
||||
template (value) TrxcMessage ts_TRXC_FAKE_TIMING(int16_t timing, int16_t thresh := 0) := {
|
||||
cmd := {
|
||||
verb := "FAKE_TIMING",
|
||||
params := { int2str(timing) }
|
||||
verb := "FAKE_TOA",
|
||||
params := { int2str(timing), int2str(thresh) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue