pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40472?usp=email )
Change subject: stp: IPA: Introduce test TC_beat ......................................................................
stp: IPA: Introduce test TC_beat
Similar to the one already available in STP_Tests_M3UA, but testing PING/PONG in IPA.
Change-Id: I3d762fb4780aaa9931c3841cce69da6ee95529f3 --- M stp/STP_Tests_IPA.ttcn M stp/expected-results.xml 2 files changed, 39 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/72/40472/1
diff --git a/stp/STP_Tests_IPA.ttcn b/stp/STP_Tests_IPA.ttcn index 8a34054..3843e99 100644 --- a/stp/STP_Tests_IPA.ttcn +++ b/stp/STP_Tests_IPA.ttcn @@ -486,6 +486,41 @@ f_tc_tmt_loadshare_sls(true); }
+private function f_IPA_ping(integer idx) runs on IPA_CT +{ + var IpaCcmMsgtype ipa_ping_msg := IPAC_MSGT_PING; + var IpaCcmMsgtype ipa_pong_msg := IPAC_MSGT_PONG; + var octetstring ipa_ping_data := int2oct(enum2int(ipa_ping_msg), 1); + var octetstring ipa_pong_data := int2oct(enum2int(ipa_pong_msg), 1); + timer T := 3.0; + T.start; + + IPA_CTRL[idx].send(valueof(t_ASP_IPA_UD(IPAC_PROTO_CCM, ipa_ping_data))); + + alt { + [] IPA_CTRL[idx].receive(t_ASP_IPA_UD(IPAC_PROTO_CCM, ipa_pong_data)) { + setverdict(pass); + } + [] IPA_CTRL[idx].receive(t_ASP_IPA_UD(IPAC_PROTO_CCM, ipa_ping_data)) { + /* Answer any PING from peer meanwhile: */ + IPA_CTRL[0].send(valueof(t_ASP_IPA_UD(IPAC_PROTO_CCM, ipa_pong_data))); + repeat; + } + } +} + +testcase TC_beat() runs on IPA_CT { + var Misc_Helpers.ro_charstring asps := { "ipa-asp-override-sender" }; + var IpaConfigs ipa_configs := ipa_build_configs(asps); + + f_init_common(); + f_init_ipa(ipa_configs := ipa_configs); + f_connect_ipa(0); + + f_ipa_cfg_chg_ccm_enabled(IPA_CFG[0], false); + f_IPA_ping(0); +} + control { execute( TC_unknown_client_nodynamic() ); execute( TC_unknown_as_client_nodynamic() ); @@ -497,6 +532,8 @@ execute( TC_tmt_loadshare_roundrobin() ); execute( TC_tmt_loadshare_sls() ); execute( TC_unknown_client_dynamic_tmt_loadshare() ); + + execute( TC_beat() ); }
diff --git a/stp/expected-results.xml b/stp/expected-results.xml index 88e8d17..44e0ea2 100644 --- a/stp/expected-results.xml +++ b/stp/expected-results.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<testsuite name='STP_Tests' tests='52' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> +<testsuite name='STP_Tests' tests='53' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> <testcase classname='STP_Tests_M3UA' name='TC_connect_asp_up' time='MASKED'/> <testcase classname='STP_Tests_M3UA' name='TC_beat' time='MASKED'/> <testcase classname='STP_Tests_M3UA' name='TC_beat_payload' time='MASKED'/> @@ -54,6 +54,7 @@ <testcase classname='STP_Tests_IPA' name='TC_tmt_loadshare_roundrobin' time='MASKED'/> <testcase classname='STP_Tests_IPA' name='TC_tmt_loadshare_sls' time='MASKED'/> <testcase classname='STP_Tests_IPA' name='TC_unknown_client_dynamic_tmt_loadshare' time='MASKED'/> + <testcase classname='STP_Tests_IPA' name='TC_beat' time='MASKED'/> <testcase classname='STP_Tests_IPA_M3UA' name='TC_m3ua_to_ipa' time='MASKED'/> <testcase classname='STP_Tests_IPA_M3UA' name='TC_ipa_to_m3ua' time='MASKED'/> <testcase classname='STP_Tests_IPA_M3UA' name='TC_ipa_to_m3ua_ni' time='MASKED'/>