lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34288 )
Change subject: hlr: implement str2apn() to convert an apn as string into octetstring
......................................................................
hlr: implement str2apn() to convert an apn as string into octetstring
APN are encoded by splitting each domain part by the dot and prefix
each element by a 8bit length.
E.g. internet -> \x08internet and internet.foo -> \x08internet\x03foo
Change-Id: I607969cd58110d4d5ff1b828e64cf2b5031868ac
---
M hlr/HLR_Tests.ttcn
1 file changed, 72 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/88/34288/1
diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn
index 959c680..6c4995e 100644
--- a/hlr/HLR_Tests.ttcn
+++ b/hlr/HLR_Tests.ttcn
@@ -1917,6 +1917,65 @@
}
}
+
+/* strchr similar to C's/posix strchr but returns the position of the first matching.
+ * if the char c isn't found it returns -1.
+ */
+function strchr(in charstring s, in charstring c) return integer {
+ for (var integer i := 0; i < lengthof(s); i := i+1) {
+ if (s[i] == c) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+/* str2apn returns octetstring
+ * internet -> '08'O & char2oct("internet")
+ * internet.foo -> '08'O & char2oct("internet") & '03'O & char2oct("foo")
+ * internet.-> '08'O & char2oct("internet")
+ */
+function str2apn(in charstring apn) return octetstring {
+ var octetstring result := ''O;
+ var charstring remain := apn;
+ var integer pos := strchr(remain, ".");
+
+ while (pos != -1) {
+ /* ends on a dot. e.g. "internet.", we must ignore the ending dot and this is then the last element */
+ if (pos == 0) {
+ /* it's not allowed to start with a dot. */
+ return ''O;
+ }
+
+ if (pos + 1 == lengthof(remain)) {
+ /* remove the dot */
+ remain := substr(remain, 0, pos)
+ break;
+ }
+
+ result := result & int2oct(pos, 1) & char2oct(substr(remain, 0, pos));
+ remain := substr(remain, pos + 1, lengthof(remain) - pos - 1);
+ pos := strchr(remain, ".");
+ }
+ /* last element */
+ var integer len := lengthof(remain);
+ result := result & int2oct(len, 1) & char2oct(remain);
+ return result;
+}
+
+private function test_assert(boolean term) {
+ if (term == false) {
+ setverdict(fail, "Values missmatch");
+ }
+}
+
+private function test_str2apn() {
+ test_assert(str2apn("internet") == '08'O & char2oct("internet"));
+ test_assert(str2apn("internet.") == '08'O & char2oct("internet"));
+ test_assert(str2apn("internet.foo") == '08'O & char2oct("internet") & '03'O & char2oct("foo"));
+ test_assert(str2apn(".internet.foo") == ''O);
+}
+
/* TODO:
* UL with ISD error
* UL with ISD timeout
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34288
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: I607969cd58110d4d5ff1b828e64cf2b5031868ac
Gerrit-Change-Number: 34288
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-MessageType: newchange
Attention is currently required from: pespin, lynxis lazus.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32510
to look at the new patch set (#7).
Change subject: HLR_Tests: add testcase for multiple APNs in subscriber data
......................................................................
HLR_Tests: add testcase for multiple APNs in subscriber data
With a new HLR version there are multiple APN possible in the
Subscriber Data (PDP Info).
Related: SYS#6391
Change-Id: I8d0c08272bc239370e800d6014ab9c68087b8989
---
M hlr/HLR_Tests.ttcn
M hlr/expected-results.xml
M library/GSUP_Types.ttcn
3 files changed, 159 insertions(+), 21 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/10/32510/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32510
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: I8d0c08272bc239370e800d6014ab9c68087b8989
Gerrit-Change-Number: 32510
Gerrit-PatchSet: 7
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-MessageType: newpatchset
Attention is currently required from: arehbein, daniel.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34224 )
Change subject: stream tests: Eliminate timestamps from output
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
> First of all, I think we can agree that not knowing the cause for these timestamps is unsatisfactory […]
1- I still didn't get to look at this issue and test this patch myself, something I wanted to avoid doing so far since it's the duty of whoever is submitting it to have it passing, or to ask me or someone else for specific help with specific problems or if something is not clear enough.
2- I think I may have not expressed with enough detail. Just in case, I'm doing it again: I'm in favour to disable timestamp logging *of the osmocom IUT code*, aka the app/library code tested, if it really makes no sense to test timing stuff (ideally it should, with fake time enabled). On the other hand, disabling explicit timing logging outputed by the test code itself should not be removed unless there's a good reason for that (and "timestamps started changing but I don't know why" is not a good reason). Those timestamps logs in the test code are basically showing and proving that the code is working in a given way. If the code implementation changes and those need to be updated, it should be explained *why* is that the case.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34224
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I7faed932927d4f6e328a28c7f30a647a7272e89c
Gerrit-Change-Number: 34224
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: arehbein <arehbein(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 01 Sep 2023 16:01:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: arehbein <arehbein(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: comment
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34286 )
Change subject: GTPv2_Emulation: improve accessibility of unit-data (TEID0)
......................................................................
GTPv2_Emulation: improve accessibility of unit-data (TEID0)
When GTPv2 unit-data is passed around, there is always the problem that
it is routed to the MTC_CT (TEID0). The reason for this is that GTPv2_Emulation
cannot determine a specific receiver component because unit-data does
not contain any addressing fields that would identifiy a specific vc_conn.
In GTPv2_Emulation there is already a mechanism implemented that detects
responses by their sequence number. Untfortunately this does only work
when the vc_conn has send a unit-data message before so that the
sequence number of the response can be guessed.
In case the first messages comes from the IUT, there is no way to
determine the receiving vc_conn, so this message is then routed to the
MCT_CT (TEID0). This can be a problem for testcases that run from inside
a ConnHdlr componet.
The solution that is proposed in this patch uses a mechanism that allows
to create an expectation for a specific messageType. When the GTPv2_Emulation
sees a unit-data message with the expected messageType, it will forward
it to all ConnHdlr (vc_conn) components that have registered for this
messageType previously.
Related: OS#5760
Change-Id: I02bb74d7bd547347168b5c64ee6512c71e8fd960
---
M library/GTPv2_Emulation.ttcn
1 file changed, 80 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/86/34286/1
diff --git a/library/GTPv2_Emulation.ttcn b/library/GTPv2_Emulation.ttcn
index ff6a60a..571da4e 100644
--- a/library/GTPv2_Emulation.ttcn
+++ b/library/GTPv2_Emulation.ttcn
@@ -69,7 +69,9 @@
var TidTableRec TidTable[256];
var SeqTableRec SeqTable[256];
var ImsiTableRec ImsiTable[256];
+ var UdMsgTableRec UdMsgTable[256];
var PidTableRec PidTable[256];
+
var integer g_uecups_conn_id;
};
@@ -91,6 +93,12 @@
GTP2_ConnHdlr vc_conn
};
+/* Unit data message type <-> ConnHdlr mapping */
+type record UdMsgTableRec {
+ OCT1 messageType,
+ GTP2_ConnHdlr vc_conn
+};
+
/* pid <-> ConnHdlr mapping (for UECUPS process termination indication) */
type record PidTableRec {
/* process ID of the running process */
@@ -202,6 +210,18 @@
testcase.stop("No Space in IMSI Table for ", imsi);
}
+private function f_udmsg_tbl_add(OCT1 messageType, GTP2_ConnHdlr vc_conn) runs on GTPv2_Emulation_CT {
+ var integer i;
+ for (i := 0; i < sizeof(UdMsgTable); i := i+1) {
+ if (not isbound(UdMsgTable[i].messageType)) {
+ UdMsgTable[i].messageType := messageType;
+ UdMsgTable[i].vc_conn := vc_conn;
+ return;
+ }
+ }
+ testcase.stop("No Space in UdMsg Table for messateType ", messageType);
+}
+
private function f_pid_tbl_add(integer pid, GTP2_ConnHdlr vc_conn) runs on GTPv2_Emulation_CT {
var integer i;
for (i := 0; i < sizeof(PidTable); i := i+1) {
@@ -419,11 +439,27 @@
}
}
+private function SendToUdMsgTable(Gtp2cUnitdata g2c_ud) runs on GTPv2_Emulation_CT {
+ var GTP2_ConnHdlr vc_conn;
+
+ for (var integer i := 0; i < sizeof(UdMsgTable); i := i + 1) {
+ if (isbound(UdMsgTable[i].messageType)) {
+ if (UdMsgTable[i].messageType == g2c_ud.gtpc.messageType) {
+ vc_conn := UdMsgTable[i].vc_conn;
+ CLIENT.send(g2c_ud.gtpc) to vc_conn;
+ }
+ }
+ }
+
+ return;
+}
+
function main(Gtp2EmulationCfg cfg) runs on GTPv2_Emulation_CT {
var Gtp2cUnitdata g2c_ud;
var PDU_GTPCv2 g2c;
var GTP2_ConnHdlr vc_conn;
var hexstring imsi;
+ var OCT1 messageType;
var OCT4 teid;
var PDU_UECUPS rx_uecups;
var UECUPS_CreateTun gtc;
@@ -444,6 +480,7 @@
vc_conn := f_comp_by_seq(g2c_ud.gtpc.sequenceNumber);
CLIENT.send(g2c_ud.gtpc) to vc_conn;
} else {
+ SendToUdMsgTable(g2c_ud);
TEID0.send(g2c_ud.gtpc);
}
} else if (ispresent(g2c_ud.gtpc.tEID) and g2c_ud.gtpc.tEID != int2oct(0, 4)) {
@@ -499,6 +536,10 @@
f_imsi_tbl_add(imsi, vc_conn);
CLIENT_PROC.reply(GTP2EM_register_imsi:{imsi}) to vc_conn;
}
+ [] CLIENT_PROC.getcall(GTP2EM_register_udmsg:{?}) -> param(messageType) sender vc_conn {
+ f_udmsg_tbl_add(messageType, vc_conn);
+ CLIENT_PROC.reply(GTP2EM_register_udmsg:{messageType}) to vc_conn;
+ }
[] CLIENT_PROC.getcall(GTP2EM_register_teid:{?}) -> param(teid) sender vc_conn {
f_tid_tbl_add(teid, vc_conn);
@@ -539,6 +580,7 @@
} with { extension "internal" };
signature GTP2EM_register_imsi(hexstring imsi);
+signature GTP2EM_register_udmsg(OCT1 messageType);
signature GTP2EM_register_teid(OCT4 teid);
signature GTP2EM_allocate_teid() return OCT4;
signature GTP2EM_create_tunnel(UECUPS_CreateTun gtc);
@@ -546,7 +588,7 @@
signature GTP2EM_start_program(UECUPS_StartProgram sprog) return UECUPS_StartProgramRes;
type port GTP2EM_PROC_PT procedure {
- inout GTP2EM_register_imsi, GTP2EM_register_teid, GTP2EM_allocate_teid,
+ inout GTP2EM_register_imsi, GTP2EM_register_udmsg, GTP2EM_register_teid, GTP2EM_allocate_teid,
GTP2EM_create_tunnel, GTP2EM_destroy_tunnel, GTP2EM_start_program;
} with { extension "internal" };
@@ -565,6 +607,12 @@
}
}
+function f_gtp2_register_udmsg(OCT1 messageType) runs on GTP2_ConnHdlr {
+ GTP2_PROC.call(GTP2EM_register_udmsg:{messageType}) {
+ [] GTP2_PROC.getreply(GTP2EM_register_udmsg:{messageType});
+ }
+}
+
function f_gtp2_register_teid(OCT4 teid) runs on GTP2_ConnHdlr {
GTP2_PROC.call(GTP2EM_register_teid:{teid}) {
[] GTP2_PROC.getreply(GTP2EM_register_teid:{teid});
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34286
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: I02bb74d7bd547347168b5c64ee6512c71e8fd960
Gerrit-Change-Number: 34286
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: dexter.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34266
to look at the new patch set (#3).
Change subject: MME_Tests: Add S11/GTPv2 interface
......................................................................
MME_Tests: Add S11/GTPv2 interface
The S11 interface is used by the MME to talk to the SGW-C. At the moment
we do not simulate the S11 interface in our testcases. This is in particular
a problem for TC_s1ap_attach, which needs to answer the Create Session
Request, comming from the MME in order to continue.
As a first step, lets add evrything that is required to run an S11
interface in the testsuite.
Change-Id: I545dd6cef3cef7283f2e04c2406a2703c2fdd01a
Related: OS#5760
---
M mme/MME_Tests.ttcn
M mme/gen_links.sh
M mme/regen_makefile.sh
3 files changed, 71 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/34266/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34266
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: I545dd6cef3cef7283f2e04c2406a2703c2fdd01a
Gerrit-Change-Number: 34266
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34287 )
Change subject: TC_s1ap_attach: setup S11 interface, catch Create Session Request
......................................................................
TC_s1ap_attach: setup S11 interface, catch Create Session Request
The testcase TC_s1ap_attach is not complete yet. Since the testsuite
lacked the S11 interface, it was not possible to develop the testcase
beond the S1AP/NAS-EPS Security Mode Command. However, the S11 interface
is now available to the testsuite, so let's show that it works by
catching the Create Session Request. Let's also put a TODO that the
testcase needs to be completed still.
Related: OS#5760
Change-Id: I6350a3d5cab33fa4f43e4cdcbd7bf3241821d233
---
M mme/MME_Tests.ttcn
1 file changed, 38 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/34287/1
diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn
index 104c3d2..3af72bc 100644
--- a/mme/MME_Tests.ttcn
+++ b/mme/MME_Tests.ttcn
@@ -620,6 +620,8 @@
f_init_handler(pars);
var template (value) EPS_MobileIdentityV mi := ts_NAS_MobileId_IMSI(pars.ue_pars.imsi);
var template (value) PDU_NAS_EPS nas_esm, nas_emm;
+ timer T := 5.0;
+
/*
nas_esm := ts_NAS_ActDefEpsBearCtxReq(bearer_id := '0000'B, proc_tid := int2bit(1,8),
qos := c_NAS_defaultQoS, apn := c_NAS_defaultAPN,
@@ -648,7 +650,24 @@
}
}
- f_sleep(10.0);
+ /* We now expect the MME to send a Create Session Request to the SGW-C */
+ /* TODO: be more restrictive, fix and use tr_GTP2C_CreateSessionReq */
+ f_gtp2_register_udmsg('20'O);
+ T.start;
+ alt {
+ [] GTP2.receive(tr_PDU_GTP2C) {
+ setverdict(pass);
+ }
+ [] GTP2.receive {
+ setverdict(fail, "unexpected GTPv2/S11 message from MME");
+ }
+ [] T.timeout {
+ setverdict(fail, "no message from MME");
+ }
+ }
+
+ /* TODO: Finish this procedure until Attach Complete */
+
}
testcase TC_s1ap_attach() runs on MTC_CT {
var charstring id := testcasename();
@@ -656,6 +675,7 @@
f_init_diameter(id);
f_sleep(10.0);
f_init_s1ap(id, 4);
+ f_init_gtpv2_s11(id);
f_s1ap_setup(0);
var ConnHdlrPars pars := f_init_pars(ue_idx := 0);
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34287
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: I6350a3d5cab33fa4f43e4cdcbd7bf3241821d233
Gerrit-Change-Number: 34287
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: dexter.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34279
to look at the new patch set (#2).
Change subject: MME_Tests: remove unused timer variable
......................................................................
MME_Tests: remove unused timer variable
The Timer T in TC_RIM_RAN_INF is not used, let's remove it.
Related: OS#5760
Change-Id: I3d18cda38789e5a42536fd17b6641efa725f757b
---
M mme/MME_Tests.ttcn
1 file changed, 12 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/79/34279/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34279
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: I3d18cda38789e5a42536fd17b6641efa725f757b
Gerrit-Change-Number: 34279
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: arehbein, pespin.
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34224 )
Change subject: stream tests: Eliminate timestamps from output
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
> This doesn't prove that the problem is local or related to my patch. […]
First of all, I think we can agree that not knowing the cause for these timestamps is unsatisfactory. I tried to reproduce the issue, but after fixing issues with the leak sanitizer I wasn't able to see wrong timestamps.
You can see my commits in daniel/stream_tests_lsan
Secondly, in https://gerrit.osmocom.org/c/libosmo-netif/+/33198/16#message-034bf24dc42f2… Pau seems to be in favor of disabling timestamps in tests in general. I think this is a good idea - especially with the io_uring backend which certainly causes different amount of mainloop invocations than poll.
Another solution would be to avoid calling osmo_gettimeofday_override_add() inside the osmo_select_main() loop, but only when e.g. a read/write callback is called.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34224
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I7faed932927d4f6e328a28c7f30a647a7272e89c
Gerrit-Change-Number: 34224
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: arehbein <arehbein(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 01 Sep 2023 15:25:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: arehbein <arehbein(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment