optional steps in ttcn3 interleave

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/OpenBSC@lists.osmocom.org/.

Neels Hofmeyr nhofmeyr at sysmocom.de
Thu Oct 17 21:51:20 UTC 2019


Hi,

I've got the problem that optional steps seem to not be possible in
'interleave' statements.

What I want: accept either BSSMAP Assignment Request or Iu Rab Assignment:

	interleave {
	[g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_AssignmentReq) { ... };
	[not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_RabAssReq(rab_sml)) { ... };
	[] other {...};
	[] complex {...};
	[] steps {...};
	}

But that's illegal syntax; works for altsteps, but not for interleave. Even in
the language spec, there is no token between the interleave braces. How
unfortunate.

Options I am considering:

1) moving the optionals into a separate altstep

	var default assignment;
	if (g_pars.ran_is_geran) {
		assignment := activate(as_BSSMAP_assignment());
	} else {
		assignment := activate(as_RANAP_assignment());
	}
	interleave {
	[] other {...};
	[] complex {...};
	[] steps {...};
	}
	deactivate(assignment);

or
2) blatant code dup
	
	if (g_pars.ran_is_geran) {
		interleave {
		[] BSSAP.receive(tr_BSSMAP_AssignmentReq) { ... };
		[] other {...};
		[] complex {...};
		[] steps {...};
		}
	} else {
		interleave {
		[] BSSAP.receive(tr_RANAP_RabAssReq) { ... };
		[] other {...};
		[] complex {...};
		[] steps {...};
		}
	}

3) boolean dance and break

	var boolean done1 := false;
	var boolean done2 := false;
	var boolean done3 := false;
	var boolean done4 := false;

	interleave {
	[] BSSAP.receive(tr_BSSMAP_AssignmentReq) {
		if (not g_pars.ran_is_geran) {
			setverdict(fail);
		}
		done1 := true;
		if (done1 and done2 and done3 and done4) { break; }
		};
	[] BSSAP.receive(tr_RANAP_RabAssReq(rab_sml)) {
		if (g_pars.ran_is_geran) {
			setverdict(fail);
		}
		done1 := true;
		if (done1 and done2 and done3 and done4) { break; }
		};
	[] other  { done2 := true; if (done1 and done2 and done3 and done4) { break; } };
	[] complex  { done3 := true; if (done1 and done2 and done3 and done4) { break; } };
	[] steps  { done4 := true; if (done1 and done2 and done3 and done4) { break; } };
	}

1) is bad because the interleave may exit without having seen an actual assignment at all.
Also interacting with local variables isn't allowed in this kind of altstep.
Also if there are more optional parts, the side-altsteps become hard to understand.
Also the altstep needs to "repeat;" so that it doesn't break the outer interlave,
which makes us accept more than one of the optional message.

2) is bad because it is code dup.

3) is bad because of code clutter that is likely to cause weird failure when
the interleave is modified. I am already using this method somewhere... but.

Are there other options??

Why is this coming up? I am preparing for a change in osmo-msc during call
setup, and I am making the ttcn3 call testing more flexible and cleaning things
up. As a result, some more tests are moved to using f_mo_call_establish()
instead of copy-pasting it. That makes some Iu tests go from passed to FAIL,
because the f_mo_call_establish() is unable to do the above distinguishing
between BSSMAP and IU.

We can also choose to ignore those Iu tests that start to fail.
But I am curious whether there is a way for optional interleave steps in ttcn3.

Thanks,

~N
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20191017/532a3295/attachment.bin>


More information about the OpenBSC mailing list