Harald Welte | 00566f5 | 2017-11-21 16:43:49 +0100 | [diff] [blame^] | 1 | module IPA_Test { |
| 2 | |
| 3 | import from IPA_CodecPort all; |
| 4 | import from IPA_CodecPort_CtrlFunct all; |
| 5 | import from IPL4asp_Types all; |
| 6 | |
| 7 | type component ipa_CT { |
| 8 | port IPA_CODEC_PT IPA; |
| 9 | var boolean g_initialized := false; |
| 10 | |
| 11 | var ConnectionId g_ipa_conn_id := -1; |
| 12 | } |
| 13 | |
| 14 | modulepar { |
| 15 | PortNumber mp_local_port := 0; |
| 16 | charstring mp_local_ip := "127.0.0.1"; |
| 17 | PortNumber mp_remote_port := 3002; |
| 18 | charstring mp_remote_ip := "127.0.0.1"; |
| 19 | } |
| 20 | |
| 21 | private function f_init() runs on ipa_CT { |
| 22 | var Result res; |
| 23 | |
| 24 | if (g_initialized == true) { |
| 25 | return; |
| 26 | } |
| 27 | g_initialized := true; |
| 28 | map(self:IPA, system:IPA_CODEC_PT); |
| 29 | |
| 30 | res := IPA_CodecPort_CtrlFunct.f_IPL4_connect(IPA, mp_remote_ip, mp_remote_port, |
| 31 | mp_local_ip, mp_local_port, 0, { tcp:={} }); |
| 32 | g_ipa_conn_id := res.connId; |
| 33 | } |
| 34 | |
| 35 | testcase TC_recv_dump() runs on ipa_CT { |
| 36 | f_init(); |
| 37 | |
| 38 | while (true) { |
| 39 | IPA.receive; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | control { |
| 44 | execute( TC_recv_dump() ); |
| 45 | } |
| 46 | } |