msc: fix f_tc_ho_inter_bsc0(): properly patch n_sd

Assuming n_sd should be 3 is only valid for non-A5 testcases, in which
we are *not* doing ciphering and authentication.  For the A5 testcases
(TC_ho_inter_bsc_a5_*), this assumption is incorrect and osmo-msc is
definitely not happy about that:

  Duplicate DTAP: bin=0, expected n_sd == 0, got 3 (ran_msg.c:159)
  Dropping duplicate message ... (msc_a.c:1363)

Why and how the A5 testcases passed so far?  It was a pure luck, which
sailed away when we started executing ttcn3-msc-test with io_uring.

The A5 testcases were passing thanks to the as_optional_cc_rel() that
gets activate()d in background before calling f_call_hangup().  This
altstep does not have the 'repeat' statement, and as a side effect it
may cancel any normal alt-statements and even standalone receive()
statements.

In the successful scenario, it would cancel (unblock) the following
receive operation in f_call_hangup():

  MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref));
  log("f_call_hangup 2: rx MNCC REL ind");
  BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id)));
  // ^^^^^^^^^^ as_optional_cc_rel() triggers here and cancels this one

which is a pure luck because our CC RELEASE was sent with incorrect
sequence number and got dropped, so osmo-msc would never send us
CC RELEASE COMPLETE.  It would instead send us CC RELEASE due to
expire of T306, and the as_optional_cc_rel() would kick in handling
this message and responding with CC RELEASE COMPLETE.

In the failing scenario though (when running with io_uring), that
same altstep running in backround may trigger *earlier* and unblock
another standalone receive() statement:

  MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref));
  // ^^^^^^^^^ as_optional_cc_rel() triggers here and cancels this one
  log("f_call_hangup 2: rx MNCC REL ind");
  BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id)));

so that we will be stuck waiting for CC RELEASE COMPLETE until the
Tguard expires.

This patch fixes n_sd patching, so that our CC RELEASE message is
handled properly and the call gets released as expected, without
requiring as_optional_cc_rel() to kick in.  The missing 'repeat'
is to be added to as_optional_cc_rel() in a follow-up patch.

Change-Id: Iddde391eade716ca5c6c48cb631450ddb543e0d4
Related: OS#6414
1 file changed
tree: 93d226c46c739ff207eed64c0eb5f64d35794021
  1. .github/
  2. asn-test/
  3. bin/
  4. bsc/
  5. bsc-nat/
  6. bts/
  7. cbc/
  8. ccid/
  9. COMMON/
  10. deps/
  11. dia2gsup/
  12. doc/
  13. epdg/
  14. fr/
  15. fr-net/
  16. gbproxy/
  17. ggsn_tests/
  18. hlr/
  19. hnbgw/
  20. hnodeb/
  21. hss/
  22. lapdm/
  23. library/
  24. mgw/
  25. mme/
  26. msc/
  27. ns/
  28. pcap-client/
  29. pcu/
  30. pgw/
  31. remsim/
  32. ROHC_CNL113426_LATEST/
  33. sccp/
  34. SCCP_Test/
  35. selftest/
  36. sgsn/
  37. simtrace/
  38. sip/
  39. smlc/
  40. stp/
  41. sysinfo/
  42. upf/
  43. .checkpatch.conf
  44. .gitignore
  45. .gitreview
  46. Common.cfg
  47. compare-results.py
  48. gen_links.sh.inc
  49. log_merge.sh
  50. Makefile
  51. mask_expected_results.sh
  52. README.md
  53. regen-makefile.sh
  54. rmlinks.sh
  55. start-testsuite.sh
  56. ttcn3-dumpcap-start.sh
  57. ttcn3-dumpcap-stop.sh
  58. ttcn3-tcpdump-start.sh
  59. ttcn3-tcpdump-stop.sh
  60. update_expected_results_from_jenkins.sh
README.md

Osmocom TTCN-3 Test Suites

This repository contains a collection of test suites developed within the Osmocom (Open Source Mobile Communications) project. The test suites are developed in the TTCN-3 programming language, compiled/executed by the Eclipse TITAN compiler and runtime.

Those test suites mostly are performing functional testing of cellular network elements, from 2G, 3G, 4G to 5G. The individual test-suites are in sub-directories, while some shared library code is in library.

Continuous Integration

The individual tests suites are executed against different versions of the respective IUT (Implementation Under Test) by the Osmocom jenkins.

See the list of all TTCN-3 jenkins jobs for more details

Further reading

Some more information about those test suites can be found at https://osmocom.org/projects/cellular-infrastructure/wiki/Titan_TTCN3_Testsuites.