Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-10-19 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )


Change subject: BSC_Tests: set band in f_TC_fh_params_set
..

BSC_Tests: set band in f_TC_fh_params_set

The function f_TC_fh_params_set sets frequency hopping parameters. The
ARFCN is also part of those parameters. However, this function does not
set the respective band for the ARFCN that it configurs. This results in
an invalid setting at the BSC that might cause unexpected behavior.

Lets make sure we configure the band parameter correctly before setting
the ARFCN

Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Related: SYS#5369
---
M bsc/BSC_Tests.ttcn
1 file changed, 48 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/28/25828/1

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index d64ccc0..f5310a8 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -8361,7 +8361,7 @@

 /* Hopping parameters per a transceiver */
 private type record FHParamsTrx {
-   GsmArfcnarfcn,
+   GsmBandArfcnarfcn,
FHParamsTs  ts[8]
 };

@@ -8370,8 +8370,10 @@
 runs on test_CT return FHParamsTrx {
var FHParamsTrx fhp;

-   /* Generate a random ARFCN, including ARFCN 0 */
-   fhp.arfcn := f_rnd_int(3);
+   /* Generate a random ARFCN in the range of 0 - 3. This ARFCN will
+* fall in the GSM900 band. */
+   fhp.arfcn.arfcn := f_rnd_int(3);
+   fhp.arfcn.pcs := false;

for (var integer tn := 0; tn < 8; tn := tn + 1) {
if (not match(tn, tr_tn)) {
@@ -8410,7 +8412,7 @@
tr_maio_hsn := tr_HsnMaio(fhp.ts[tn].hsn, fhp.ts[tn].maio);
tr_cd := tr_ChanDescH1(cd.chan_nr, tr_maio_hsn);
} else {
-   tr_cd := tr_ChanDescH0(cd.chan_nr, fhp.arfcn);
+   tr_cd := tr_ChanDescH0(cd.chan_nr, fhp.arfcn.arfcn);
}

if (not match(cd, tr_cd)) {
@@ -8455,7 +8457,7 @@
}

/* Take ARFCN of the TRX itself into account */
-   full_mask[fhp.arfcn] := '1'B;
+   full_mask[fhp.arfcn.arfcn] := '1'B;

/* Compose a bit-mask for the given timeslot number */
for (var integer i := 0; i < lengthof(fhp.ts[tn].ma); i := i + 1) {
@@ -8492,15 +8494,50 @@
return { len := ma_mask_len, ma := ma_mask };
 }

+/* Configure the appropiate band for a given arfcn, exc */
+private function f_TC_set_band_by_arfcn(integer bts_nr, GsmBandArfcn arfcn) 
runs on test_CT
+{
+   var charstring band;
+
+   if (arfcn.arfcn >= 259 and arfcn.arfcn <= 293) {
+   band := "GSM450";
+   } else if (arfcn.arfcn >= 306 and arfcn.arfcn <= 340) {
+   band := "GSM480";
+   } else if (arfcn.arfcn >= 438 and arfcn.arfcn <= 511) {
+   band := "GSM750";
+   } else if (arfcn.arfcn >= 128 and arfcn.arfcn <= 251) {
+   band := "GSM850";
+   } else if (arfcn.arfcn >= 0 and arfcn.arfcn <= 124) {
+   band := "GSM900";
+   } else if (arfcn.arfcn >= 955 and arfcn.arfcn <= 1023) {
+   band := "GSM900";
+   } else if (arfcn.arfcn >= 512 and arfcn.arfcn <= 885 and arfcn.pcs == 
false) {
+   band := "DCS1800";
+   } else if (arfcn.arfcn >= 512 and arfcn.arfcn <= 810 and arfcn.pcs == 
true) {
+   band := "PCS1900";
+   } else {
+   return;
+   }
+
+   f_vty_enter_cfg_bts(BSCVTY, bts_nr);
+   f_vty_transceive(BSCVTY, "band " & band);
+   f_vty_transceive(BSCVTY, "exit");
+   f_vty_transceive(BSCVTY, "exit");
+   f_vty_transceive(BSCVTY, "exit");
+}
+
 /* Configure the hopping parameters in accordance with the given record */
 private function f_TC_fh_params_set(in FHParamsTrx fhp,
uint8_t bts_nr := 0,
uint8_t trx_nr := 0)
 runs on test_CT {
+
+   f_TC_set_band_by_arfcn(bts_nr, fhp.arfcn);
+
/* Enter the configuration node for the given BTS/TRX numbers */
f_vty_enter_cfg_trx(BSCVTY, bts_nr, trx_nr);

-   f_vty_transceive(BSCVTY, "arfcn " & int2str(fhp.arfcn));
+   f_vty_transceive(BSCVTY, "arfcn " & int2str(fhp.arfcn.arfcn));

for (var integer tn := 0; tn < lengthof(fhp.ts); tn := tn + 1) {
f_vty_transceive(BSCVTY, "timeslot " & int2str(tn));
@@ -8531,12 +8568,15 @@
 private function f_TC_fh_params_unset(in FHParamsTrx fhp,
  uint8_t bts_nr := 0,
  uint8_t trx_nr := 0,
- GsmArfcn arfcn := 871)
+ GsmBandArfcn arfcn := {pcs := false, 
arfcn := 871})
 runs on test_CT {
+
+   f_TC_set_band_by_arfcn(bts_nr, arfcn);
+
/* Enter the configuration node for the given BTS/TRX numbers */
f_vty_enter_cfg_trx(BSCVTY, bts_nr, trx_n

Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-10-19 Thread dexter
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828

to look at the new patch set (#2).

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..

BSC_Tests: set band in f_TC_fh_params_set

The function f_TC_fh_params_set sets frequency hopping parameters. The
ARFCN is also part of those parameters. However, this function does not
set the respective band for the ARFCN that it configurs. This results in
an invalid setting at the BSC that might cause unexpected behavior.

Lets make sure we configure the band parameter correctly before setting
the ARFCN

Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Related: SYS#5369
---
M bsc/BSC_Tests.ttcn
1 file changed, 48 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/28/25828/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-10-19 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..


Patch Set 2: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn
File bsc/BSC_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn@8502
PS2, Line 8502: if (arfcn.arfcn >= 259 and arfcn.arfcn <= 293) {
iirc ttcn3 has specific syntax to match ranges, @fixeria may remember better 
the details.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 19 Oct 2021 14:31:54 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-10-19 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..


Patch Set 2: Code-Review+1

(2 comments)

Looks good to me, and even better than my patch #25824 because it's a more 
fundamental approach that would allow us to verify handling of ARFCNs belonging 
to PCS-1900. Just a few rather cosmetic things...

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn
File bsc/BSC_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn@8502
PS2, Line 8502: if (arfcn.arfcn >= 259 and arfcn.arfcn <= 293) {
> iirc ttcn3 has specific syntax to match ranges, @fixeria may remember better 
> the details.
Yep, you could use 'select' here:

  select (arfcn) {
  case (tr_GsmBandArfcn(306 .. 340)) { band := "GSM450"; }
  case (tr_GsmBandArfcn(438 .. 511)) { band := "GSM480"; }
  /* ... */
  case (tr_GsmBandArfcn(512 .. 885, pcs := false)) { band := "DCS1800"; }
  case (tr_GsmBandArfcn(512 .. 810, pcs := true))  { band := "PCS1900"; }
  case else { return; }
  }


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn@8524
PS2, Line 8524: f_vty_transceive(BSCVTY, "exit");
Just send 'end' command once instead of sending 'exit' three times.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 19 Oct 2021 21:49:39 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-10-19 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn
File bsc/BSC_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn@8498
PS2, Line 8498: f_TC_set_band_by_arfcn
Also, I believe library/ would be a better place for this function.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 19 Oct 2021 22:07:17 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-10-28 Thread dexter
Hello Jenkins Builder, fixeria, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828

to look at the new patch set (#3).

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..

BSC_Tests: set band in f_TC_fh_params_set

The function f_TC_fh_params_set sets frequency hopping parameters. The
ARFCN is also part of those parameters. However, this function does not
set the respective band for the ARFCN that it configurs. This results in
an invalid setting at the BSC that might cause unexpected behavior.

Lets make sure we configure the band parameter correctly before setting
the ARFCN

Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Related: SYS#5369
---
M bsc/BSC_Tests.ttcn
1 file changed, 39 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/28/25828/3
-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-10-28 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..


Patch Set 2:

(3 comments)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn
File bsc/BSC_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn@8498
PS2, Line 8498: f_TC_set_band_by_arfcn
> Also, I believe library/ would be a better place for this function.
We have the band setting only in osmo-bsc. This is very osmo-bsc specific. It 
should be kept here.


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn@8502
PS2, Line 8502: if (arfcn.arfcn >= 259 and arfcn.arfcn <= 293) {
> Yep, you could use 'select' here: […]
Done


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/2/bsc/BSC_Tests.ttcn@8524
PS2, Line 8524: f_vty_transceive(BSCVTY, "exit");
> Just send 'end' command once instead of sending 'exit' three times.
Done



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 28 Oct 2021 16:13:43 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-10-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 28 Oct 2021 17:27:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-10-28 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..


Patch Set 3:

(3 comments)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/3/bsc/BSC_Tests.ttcn
File bsc/BSC_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/3/bsc/BSC_Tests.ttcn@8579
PS3, Line 8579: var GsmBandArfcn arfcn_ := 
valueof(ts_GsmBandArfcn(arfcn.arfcn, arfcn.pcs, false));
Could you please explain why you're doing this? I guess this has something to 
do with the 'uplink' argument. If my guess is correct, then why not to ensure 
that it's set to false by the caller, rather than setting it here?


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/3/bsc/BSC_Tests.ttcn@8581
PS3, Line 8581: select (arfcn_) {
The 'case' statements should be inline with the 'select', similar to 'switch' 
in C.
Also, why you mix up tabs and spaces? Let's use one tab here.


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/3/bsc/BSC_Tests.ttcn@8582
PS3, Line 8582: ?
Not critical, but this argument can be omitted here (and below) because '?' is 
the default value.



-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 28 Oct 2021 19:17:09 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-11-01 Thread dexter
Hello Jenkins Builder, laforge, fixeria, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828

to look at the new patch set (#4).

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..

BSC_Tests: set band in f_TC_fh_params_set

The function f_TC_fh_params_set sets frequency hopping parameters. The
ARFCN is also part of those parameters. However, this function does not
set the respective band for the ARFCN that it configurs. This results in
an invalid setting at the BSC that might cause unexpected behavior.

Lets make sure we configure the band parameter correctly before setting
the ARFCN

Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Related: SYS#5369
---
M bsc/BSC_Tests.ttcn
1 file changed, 39 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/28/25828/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-11-01 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..


Patch Set 4:

(3 comments)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/3/bsc/BSC_Tests.ttcn
File bsc/BSC_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/3/bsc/BSC_Tests.ttcn@8579
PS3, Line 8579: var GsmBandArfcn arfcn_ := 
valueof(ts_GsmBandArfcn(arfcn.arfcn, arfcn.pcs, false));
> Could you please explain why you're doing this? I guess this has something to 
> do with the 'uplink' a […]
I am doing this because it is not possible to use ts_GsmBandArfcn from inside 
the function definition:

private function f_TC_fh_params_unset(in FHParamsTrx fhp,
  uint8_t bts_nr := 0,
  uint8_t trx_nr := 0,
  GsmBandArfcn arfcn := {pcs := false, 
arfcn := 871})


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/3/bsc/BSC_Tests.ttcn@8581
PS3, Line 8581: select (arfcn_) {
> The 'case' statements should be inline with the 'select', similar to 'switch' 
> in C. […]
Done


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828/3/bsc/BSC_Tests.ttcn@8582
PS3, Line 8582: ?
> Not critical, but this argument can be omitted here (and below) because '?' 
> is the default value.
Done



-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 01 Nov 2021 09:43:57 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-11-01 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Gerrit-Change-Number: 25828
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 01 Nov 2021 09:49:05 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BSC_Tests: set band in f_TC_fh_params_set

2021-11-01 Thread dexter
dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25828 )

Change subject: BSC_Tests: set band in f_TC_fh_params_set
..

BSC_Tests: set band in f_TC_fh_params_set

The function f_TC_fh_params_set sets frequency hopping parameters. The
ARFCN is also part of those parameters. However, this function does not
set the respective band for the ARFCN that it configurs. This results in
an invalid setting at the BSC that might cause unexpected behavior.

Lets make sure we configure the band parameter correctly before setting
the ARFCN

Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Related: SYS#5369
---
M bsc/BSC_Tests.ttcn
1 file changed, 39 insertions(+), 8 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index ee4dac2..ad8f666 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -8439,7 +8439,7 @@

 /* Hopping parameters per a transceiver */
 private type record FHParamsTrx {
-   GsmArfcnarfcn,
+   GsmBandArfcnarfcn,
FHParamsTs  ts[8]
 };

@@ -8448,8 +8448,10 @@
 runs on test_CT return FHParamsTrx {
var FHParamsTrx fhp;

-   /* Generate a random ARFCN, including ARFCN 0 */
-   fhp.arfcn := f_rnd_int(3);
+   /* Generate a random ARFCN in the range of 0 - 3. This ARFCN will
+* fall in the GSM900 band. */
+   fhp.arfcn.arfcn := f_rnd_int(3);
+   fhp.arfcn.pcs := false;

for (var integer tn := 0; tn < 8; tn := tn + 1) {
if (not match(tn, tr_tn)) {
@@ -8488,7 +8490,7 @@
tr_maio_hsn := tr_HsnMaio(fhp.ts[tn].hsn, fhp.ts[tn].maio);
tr_cd := tr_ChanDescH1(cd.chan_nr, tr_maio_hsn);
} else {
-   tr_cd := tr_ChanDescH0(cd.chan_nr, fhp.arfcn);
+   tr_cd := tr_ChanDescH0(cd.chan_nr, fhp.arfcn.arfcn);
}

if (not match(cd, tr_cd)) {
@@ -8533,7 +8535,7 @@
}

/* Take ARFCN of the TRX itself into account */
-   full_mask[fhp.arfcn] := '1'B;
+   full_mask[fhp.arfcn.arfcn] := '1'B;

/* Compose a bit-mask for the given timeslot number */
for (var integer i := 0; i < lengthof(fhp.ts[tn].ma); i := i + 1) {
@@ -8570,15 +8572,41 @@
return { len := ma_mask_len, ma := ma_mask };
 }

+/* Configure the appropriate band for a given arfcn, exc */
+private function f_TC_set_band_by_arfcn(integer bts_nr, GsmBandArfcn arfcn) 
runs on test_CT
+{
+   var charstring band;
+   var GsmBandArfcn arfcn_ := valueof(ts_GsmBandArfcn(arfcn.arfcn, 
arfcn.pcs, false));
+
+   select (arfcn_) {
+   case (tr_GsmBandArfcn((259..293), false, ?)) { band := "GSM450"; }
+   case (tr_GsmBandArfcn((306..340), false, ?)) { band := "GSM480"; }
+   case (tr_GsmBandArfcn((438..511), false, ?)) { band := "GSM750"; }
+   case (tr_GsmBandArfcn((128..251), false, ?)) { band := "GSM850"; }
+   case (tr_GsmBandArfcn((0..124), false, ?)) { band := "GSM900"; }
+   case (tr_GsmBandArfcn((955..1023), false, ?)) { band := "GSM900"; }
+   case (tr_GsmBandArfcn((512..885), false, ?)) { band := "DCS1800"; }
+   case (tr_GsmBandArfcn((512..810), true, ?)) { band := "PCS1900"; }
+   case else { return; }
+   }
+
+   f_vty_enter_cfg_bts(BSCVTY, bts_nr);
+   f_vty_transceive(BSCVTY, "band " & band);
+   f_vty_transceive(BSCVTY, "end");
+}
+
 /* Configure the hopping parameters in accordance with the given record */
 private function f_TC_fh_params_set(in FHParamsTrx fhp,
uint8_t bts_nr := 0,
uint8_t trx_nr := 0)
 runs on test_CT {
+
+   f_TC_set_band_by_arfcn(bts_nr, fhp.arfcn);
+
/* Enter the configuration node for the given BTS/TRX numbers */
f_vty_enter_cfg_trx(BSCVTY, bts_nr, trx_nr);

-   f_vty_transceive(BSCVTY, "arfcn " & int2str(fhp.arfcn));
+   f_vty_transceive(BSCVTY, "arfcn " & int2str(fhp.arfcn.arfcn));

for (var integer tn := 0; tn < lengthof(fhp.ts); tn := tn + 1) {
f_vty_transceive(BSCVTY, "timeslot " & int2str(tn));
@@ -8609,12 +8637,15 @@
 private function f_TC_fh_params_unset(in FHParamsTrx fhp,
  uint8_t bts_nr := 0,
  uint8_t trx_nr := 0,
- GsmArfcn arfcn := 871)
+ GsmBandArfcn arfcn := {pcs := false, 
arfcn := 871})
 runs on test_CT {
+
+   f_TC_set_band_by_arfcn(bts_nr, arfcn);
+
/* Enter the configuration node for the given BTS/TRX numbers */
f_vty_enter_cfg_trx(BSCVTY, bts_nr, trx_nr);

-   f_vty_transceive(BSCVTY, "arfcn " & int2str(arfcn));
+   f_vty_transceive(BSCVTY, "arfcn " & int2str(arfcn.arfcn));

for (var integer tn := 0; tn < lengthof(fhp.ts); tn := tn + 1) {