This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
neels gerrit-no-reply at lists.osmocom.orgneels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/21195 ) Change subject: handover_test: allow arbitrary timeslot config and multiple TRX ...................................................................... handover_test: allow arbitrary timeslot config and multiple TRX Adjust 'create-bts' command so that it allows multiple TRX and arbitrary timeslot configurations. It is now possible to write tests for dynamic timeslots and multiple TRX. Change-Id: Ic645cea671aa4798804666b8886f11bab5351e11 --- M tests/handover/handover_test.c 1 file changed, 42 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index b469f03..2aa48b7 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -176,7 +176,14 @@ enum gsm_phys_chan_config pchan_from_str(const char *str) { - enum gsm_phys_chan_config pchan = gsm_pchan_parse(str); + enum gsm_phys_chan_config pchan; + if (!strcmp(str, "dyn")) + return GSM_PCHAN_TCH_F_TCH_H_PDCH; + if (!strcmp(str, "c+s4")) + return GSM_PCHAN_CCCH_SDCCH4; + if (!strcmp(str, "-")) + return GSM_PCHAN_NONE; + pchan = gsm_pchan_parse(str); if (pchan < 0) { fprintf(stderr, "Invalid timeslot pchan type: %s\n", str); exit(1); @@ -185,7 +192,7 @@ } const char * const bts_default_ts[] = { - "CCCH+SDCCH4", "TCH/F", "TCH/F", "TCH/F", "TCH/F", "TCH/H", "TCH/H", "NONE", + "c+s4", "TCH/F", "TCH/F", "TCH/F", "TCH/F", "TCH/H", "TCH/H", "-", }; static struct gsm_bts *create_bts(int num_trx, const char * const *ts_args) @@ -197,6 +204,13 @@ int trx_i; struct gsm_bts_trx *trx; + fprintf(stderr, "- Creating BTS %d, %d TRX\n", bsc_gsmnet->num_bts, num_trx); + for (trx_i = 0; trx_i < num_trx; trx_i++) { + for (i = 0; i < 8; i++) + fprintf(stderr, "\t%s", ts_args[8*trx_i + i]); + fprintf(stderr, "\n"); + } + bts = bsc_bts_alloc_register(bsc_gsmnet, GSM_BTS_TYPE_UNKNOWN, 0x3f); if (!bts) { printf("No resource for bts1\n"); @@ -235,10 +249,20 @@ trx->ts[i].mo.nm_state.administrative = NM_STATE_UNLOCKED; } - for (i = 0; i < ARRAY_SIZE(bts->c0->ts); i++) { + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { /* make sure ts->lchans[] get initialized */ - osmo_fsm_inst_dispatch(bts->c0->ts[i].fi, TS_EV_RSL_READY, 0); - osmo_fsm_inst_dispatch(bts->c0->ts[i].fi, TS_EV_OML_READY, 0); + osmo_fsm_inst_dispatch(trx->ts[i].fi, TS_EV_RSL_READY, 0); + osmo_fsm_inst_dispatch(trx->ts[i].fi, TS_EV_OML_READY, 0); + + /* Unused dyn TS start out as used for PDCH */ + switch (trx->ts[i].pchan_on_init) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + case GSM_PCHAN_TCH_F_PDCH: + trx->ts[i].pchan_is = GSM_PCHAN_PDCH; + break; + default: + break; + } } } @@ -1530,12 +1554,23 @@ while (*test_case) { if (!strcmp(*test_case, "create-n-bts")) { int n = atoi(test_case[1]); - fprintf(stderr, "- Creating %d BTS (one TRX each, " - "TS(1-4) are TCH/F, TS(5-6) are TCH/H)\n", n); for (i = 0; i < n; i++) create_bts(1, bts_default_ts); test_case += 2; } else + if (!strcmp(*test_case, "create-bts")) { + /* new BTS with one TRX: + * "create-bts", "1", "CCCH+SDCCH4", "TCH/F", "TCH/F", "TCH/F", "TCH/F", "TCH/H", "TCH/H", "PDCH", + * + * new BTS with two TRX: + * "create-bts", "2", "CCCH+SDCCH4", "TCH/F", "TCH/F", "TCH/F", "TCH/F", "TCH/H", "TCH/H", "PDCH", + * "SDCCH8", "TCH/F", "TCH/F", "TCH/F", "TCH/F", "TCH/H", "TCH/H", "PDCH", + */ + int num_trx = atoi(test_case[1]); + const char * const * ts_cfg = (void*)&test_case[2]; + create_bts(num_trx, ts_cfg); + test_case += 2 + 8 * num_trx; + } else if (!strcmp(*test_case, "as-enable")) { fprintf(stderr, "- Set assignment enable state at " "BTS %s to %s\n", test_case[1], test_case[2]); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21195 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ic645cea671aa4798804666b8886f11bab5351e11 Gerrit-Change-Number: 21195 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201117/66164d11/attachment.htm>