Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set up the env #6

Open
Yao-T opened this issue May 20, 2020 · 4 comments
Open

How to set up the env #6

Yao-T opened this issue May 20, 2020 · 4 comments

Comments

@Yao-T
Copy link

Yao-T commented May 20, 2020

I have successfully install the titan and successfully build the net-test-suites. However when I run the case, all of them failed. So how to setup the env to run the case. I set the config as below:

[LOGGING]
FileMask := LOG_ALL | DEBUG | TTCN_DEBUG
ConsoleMask := LOG_ALL | DEBUG | TTCN_DEBUG
LogSourceInfo := Yes

[MODULE_PARAMETERS]
#libtest.m_ip_dst := "10.0.0.1"
#libtest.m_ip_src := "10.0.0.2"
libtest.m_ip_dst := "192.168.1.233"
libtest.m_ip_src := "192.168.1.6"


[EXECUTE]
tcp_suite.control

Here are the log.

src git:(master) ✗ ttcn3_start test_suite tcp_suite.cfg tcp_suite.tc_tcp_001
ttcn3_start: Starting the test suite
spawn /home/test1/titan.core/Install/bin/mctr_cli tcp_suite.cfg

*************************************************************************
* TTCN-3 Test Executor - Main Controller 2                              *
* Version: CRL 113 200/6 R6B                                            *
* Copyright (c) 2000-2019 Ericsson Telecom AB                           *
* All rights reserved. This program and the accompanying materials      *
* are made available under the terms of the Eclipse Public License v2.0 *
* which accompanies this distribution, and is available at              *
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html            *
*************************************************************************

Using configuration file: tcp_suite.cfg
MC@FA000575: Unix server socket created successfully.
MC@FA000575: Listening on TCP port 37503.
MC2> FA000575 is the default
spawn ./test_suite FA000575 37503
TTCN-3 Host Controller (parallel mode), version CRL 113 200/6 R6B
MC@FA000575: New HC connected from localhost [127.0.0.1]. FA000575: Linux 4.15.0-99-generic on x86_64.
cmtc
MC@FA000575: Downloading configuration file to all HCs.
HC@FA000575: TTCN-3 Host Controller started on FA000575. Version: CRL 113 200/6 R6B.
HC@FA000575: TTCN Logger v2.2 options: TimeStampFormat:=Time; LogEntityName:=No; LogEventTypes:=No; SourceInfoFormat:=Single; *.FileMask:=LOG_ALL | DEBUG; *.ConsoleMask:=LOG_ALL | DEBUG; LogFileSize:=0; LogFileNumber:=1; DiskFullAction:=Error
HC@FA000575: The address of MC was set to FA000575[127.0.1.1]:0.
HC@FA000575: The local IP address of the control connection to MC is 127.0.0.1.
HC@FA000575: Connected to MC.
HC@FA000575: This host supports UNIX domain sockets for local communication.
HC@FA000575: Processing configuration data received from MC.
HC@FA000575: Module libtest has the following parameters: { m_eth_dst := "00:00:00:00:00:01", m_eth_src := "00:00:00:00:00:02", m_ip_dst := "192.168.1.233", m_ip_src := "192.168.1.6", m_ip6_dst := "fe80::1", m_ip6_src := "fe80::2", ping_enabled := true, ping_repeat := false, pass_arp := false, stat_enabled := false, m_ethertype := ETHERTYPE_IP (2048), T_default := 0.100000, TT_default := 2.000000, T_peer_default := -1.000000, number_of_runs := 1, max_tests_failed := 1 }
HC@FA000575: Module tcp2_utils has the following parameters: { peer_assert_enabled := true }
HC@FA000575: Module tcp_oversize_window has the following parameters: { source_port := 4242, dest_port := 4242, exceed_size := 20 }
HC@FA000575: Module tcp_suite has the following parameters: { T_default := 3.000000 }
HC@FA000575: Initializing module PreGenRecordOf.
HC@FA000575: Initialization of module PreGenRecordOf finished.
HC@FA000575: Initializing module TitanLoggerApi.
HC@FA000575: Initialization of module TitanLoggerApi finished.
HC@FA000575: Initializing module esp32_netsuite.
HC@FA000575: Initializing module tcp_suite.
HC@FA000575: Initializing module libtest.
HC@FA000575: Initializing module port_data_types.
HC@FA000575: Initialization of module port_data_types finished.
HC@FA000575: Initializing module libutils.
HC@FA000575: Initializing module libnetinet.
HC@FA000575: Initializing module libtypes.
HC@FA000575: Initialization of module libtypes finished.
HC@FA000575: Initialization of module libnetinet finished.
HC@FA000575: Initialization of module libutils finished.
HC@FA000575: Initialization of module libtest finished.
HC@FA000575: Initialization of module tcp_suite finished.
HC@FA000575: Initialization of module esp32_netsuite finished.
HC@FA000575: Initializing module tcp2_check.
HC@FA000575: Initializing module tcp2_utils.
HC@FA000575: Initialization of module tcp2_utils finished.
HC@FA000575: Initialization of module tcp2_check finished.
HC@FA000575: Initializing module tcp_oversize_window.
HC@FA000575: Initialization of module tcp_oversize_window finished.
MC@FA000575: Configuration file was processed on all HCs.
HC@FA000575: Configuration data was processed successfully.
MC@FA000575: Creating MTC on host localhost.
HC@FA000575: MTC was created. Process id: 4868.
MC@FA000575: MTC is created.
MC2> smtc tcp_suite.tc_tcp_001
MC2> MTC@FA000575: Executing test case tc_tcp_001 in module tcp_suite.
MTC@FA000575: Test case tc_tcp_001 started.
MTC@FA000575: Initializing variables, timers and ports of component type tcp_suite.tcp_ct inside testcase tc_tcp_001.
MTC@FA000575: Port P_ETH_EXT was started.
MTC@FA000575: Port P_IP was started.
MTC@FA000575: Port P_ARP was started.
MTC@FA000575: Port P_ICMP was started.
MTC@FA000575: Port P_IP6 was started.
MTC@FA000575: Port P_ICMP6 was started.
MTC@FA000575: Port P_TCP was started.
MTC@FA000575: Port P_TCP2 was started.
MTC@FA000575: Port P_UDP was started.
MTC@FA000575: Port P_CF was started.
MTC@FA000575: Port P_ETH was started.
MTC@FA000575: Component type tcp_suite.tcp_ct was initialized.
MTC@FA000575: Creating new PTC with component type libtest.eth_CT.
HC@FA000575: PTC was created. Component reference: 3, component type: libtest.eth_CT, testcase name: tc_tcp_001, process id: 4869.
3@FA000575: Initializing variables, timers and ports of component type libtest.eth_CT inside testcase tc_tcp_001.
MTC@FA000575: PTC was created. Component reference: 3, alive: no, type: libtest.eth_CT.
MTC@FA000575: Connecting ports mtc:P_IP and 3:P_IP.
3@FA000575: Port P_ETH_EXT was started.
3@FA000575: Port P_IP was started.
3@FA000575: Port P_ARP was started.
3@FA000575: Port P_ICMP was started.
3@FA000575: Port P_IP6 was started.
3@FA000575: Port P_ICMP6 was started.
3@FA000575: Port P_TCP was started.
MTC@FA000575: Port P_IP is waiting for connection from 3:P_IP on UNIX pathname /tmp/ttcn3-portconn-ad50bc54.
3@FA000575: Port P_TCP2 was started.
3@FA000575: Port P_UDP was started.
3@FA000575: Port P_CF was started.
3@FA000575: Port P_ETH was started.
3@FA000575: Component type libtest.eth_CT was initialized.
3@FA000575: Port P_IP has established the connection with mtc:P_IP using transport type UNIX.
MTC@FA000575: Port P_IP has accepted the connection from 3:P_IP.
MTC@FA000575: Connect operation on mtc:P_IP and 3:P_IP finished.
MTC@FA000575: Connecting ports mtc:P_ARP and 3:P_ARP.
MTC@FA000575: Port P_ARP is waiting for connection from 3:P_ARP on UNIX pathname /tmp/ttcn3-portconn-ff58b406.
3@FA000575: Port P_ARP has established the connection with mtc:P_ARP using transport type UNIX.
MTC@FA000575: Port P_ARP has accepted the connection from 3:P_ARP.
MTC@FA000575: Connect operation on mtc:P_ARP and 3:P_ARP finished.
MTC@FA000575: Connecting ports mtc:P_ICMP and 3:P_ICMP.
MTC@FA000575: Port P_ICMP is waiting for connection from 3:P_ICMP on UNIX pathname /tmp/ttcn3-portconn-f300ec0a.
MTC@FA000575: Port P_ICMP has accepted the connection from 3:P_ICMP.
3@FA000575: Port P_ICMP has established the connection with mtc:P_ICMP using transport type UNIX.
MTC@FA000575: Connect operation on mtc:P_ICMP and 3:P_ICMP finished.
MTC@FA000575: Connecting ports mtc:P_IP6 and 3:P_IP6.
MTC@FA000575: Port P_IP6 is waiting for connection from 3:P_IP6 on UNIX pathname /tmp/ttcn3-portconn-9b50bc62.
3@FA000575: Port P_IP6 has established the connection with mtc:P_IP6 using transport type UNIX.
MTC@FA000575: Port P_IP6 has accepted the connection from 3:P_IP6.
MTC@FA000575: Connect operation on mtc:P_IP6 and 3:P_IP6 finished.
MTC@FA000575: Connecting ports mtc:P_ICMP6 and 3:P_ICMP6.
MTC@FA000575: Port P_ICMP6 is waiting for connection from 3:P_ICMP6 on UNIX pathname /tmp/ttcn3-portconn-f336da0a.
3@FA000575: Port P_ICMP6 has established the connection with mtc:P_ICMP6 using transport type UNIX.
MTC@FA000575: Port P_ICMP6 has accepted the connection from 3:P_ICMP6.
MTC@FA000575: Connect operation on mtc:P_ICMP6 and 3:P_ICMP6 finished.
MTC@FA000575: Connecting ports mtc:P_UDP and 3:P_UDP.
MTC@FA000575: Port P_UDP is waiting for connection from 3:P_UDP on UNIX pathname /tmp/ttcn3-portconn-e94ca010.
3@FA000575: Port P_UDP has established the connection with mtc:P_UDP using transport type UNIX.
MTC@FA000575: Port P_UDP has accepted the connection from 3:P_UDP.
MTC@FA000575: Connect operation on mtc:P_UDP and 3:P_UDP finished.
MTC@FA000575: Connecting ports mtc:P_TCP and 3:P_TCP.
MTC@FA000575: Port P_TCP is waiting for connection from 3:P_TCP on UNIX pathname /tmp/ttcn3-portconn-ee4da117.
3@FA000575: Port P_TCP has established the connection with mtc:P_TCP using transport type UNIX.
MTC@FA000575: Port P_TCP has accepted the connection from 3:P_TCP.
MTC@FA000575: Connect operation on mtc:P_TCP and 3:P_TCP finished.
MTC@FA000575: Connecting ports mtc:P_TCP2 and 3:P_TCP2.
MTC@FA000575: Port P_TCP2 is waiting for connection from 3:P_TCP2 on UNIX pathname /tmp/ttcn3-portconn-ee7f9317.
MTC@FA000575: Port P_TCP2 has accepted the connection from 3:P_TCP2.
3@FA000575: Port P_TCP2 has established the connection with mtc:P_TCP2 using transport type UNIX.
MTC@FA000575: Connect operation on mtc:P_TCP2 and 3:P_TCP2 finished.
MTC@FA000575: Connecting ports mtc:P_CF and 3:P_CF.
MTC@FA000575: Port P_CF is waiting for connection from 3:P_CF on UNIX pathname /tmp/ttcn3-portconn-bb5ab642.
3@FA000575: Port P_CF has established the connection with mtc:P_CF using transport type UNIX.
MTC@FA000575: Port P_CF has accepted the connection from 3:P_CF.
MTC@FA000575: Connect operation on mtc:P_CF and 3:P_CF finished.
MTC@FA000575: Connecting ports mtc:P_ETH and 3:P_ETH.
MTC@FA000575: Port P_ETH is waiting for connection from 3:P_ETH on UNIX pathname /tmp/ttcn3-portconn-e15cb018.
3@FA000575: Port P_ETH has established the connection with mtc:P_ETH using transport type UNIX.
MTC@FA000575: Port P_ETH has accepted the connection from 3:P_ETH.
MTC@FA000575: Connect operation on mtc:P_ETH and 3:P_ETH finished.
MTC@FA000575: Starting function eth_ct_start() on component 3.
3@FA000575: Starting function eth_ct_start().
MTC@FA000575: Function was started.
3@FA000575: Mapping port 3:P_ETH_EXT to system:P_ETH_EXT.
MTC@FA000575: Sent on P_ICMP to 3 @libnetinet.icmp_t : { icmp_type := ICMP_ECHO (8), icmp_code := 0, icmp_cksum := 0, data := { echo := { icmp_id := 1, icmp_seq := 1, data := omit } } }
MTC@FA000575: Start timer T_ping: 0.1 s
3@FA000575: Port P_ETH_EXT was mapped to system:P_ETH_EXT.
3@FA000575: Message enqueued on P_ICMP from mtc @libnetinet.icmp_t : { icmp_type := ICMP_ECHO (8), icmp_code := 0, icmp_cksum := 0, data := { echo := { icmp_id := 1, icmp_seq := 1, data := omit } } } id 1
3@FA000575: Map operation of 3:P_ETH_EXT to system:P_ETH_EXT finished.
3@FA000575: Receive operation on port P_ICMP succeeded, message from mtc: @libnetinet.icmp_t : { icmp_type := ICMP_ECHO (8), icmp_code := 0, icmp_cksum := 0, data := { echo := { icmp_id := 1, icmp_seq := 1, data := omit } } } id 1
3@FA000575: Message with id 1 was extracted from the queue of P_ICMP.
3@FA000575: icmp_enc(): Encoding @libnetinet.icmp_t: { icmp_type := ICMP_ECHO (8), icmp_code := 0, icmp_cksum := 0, data := { echo := { icmp_id := 1, icmp_seq := 1, data := omit } } }
3@FA000575: icmp_enc(): Stream after encoding: '0800000000010001'O
3@FA000575: ip_enc(): Encoding @libnetinet.ip_t: { ip_v := '0100'B, ip_hl := '0101'B, ip_tos := 0, ip_len := 0, ip_id := 0, ip_off := 0, ip_ttl := 255, ip_p := IPPROTO_ICMP (1), ip_sum := 0, ip_src := 'C0A80106'O, ip_dst := 'C0A801E9'O, data := '0800000000010001'O }
3@FA000575: ip_enc(): Stream after encoding: '4500001C00000000FF010000C0A80106C0A801E90800000000010001'O
3@FA000575: eth_enc(): Encoding @libnetinet.eth_t: { h_dest := '000000000001'O, h_source := '000000000002'O, h_proto := ETHERTYPE_IP (2048), vlan := omit, data := '4500001C00000000FF010000C0A80106C0A801E90800000000010001'O }
3@FA000575: eth_enc(): Stream after encoding: '00000000000100000000000208004500001C00000000FF010000C0A80106C0A801E90800000000010001'O
3@FA000575: Sent on P_ETH_EXT to system octetstring : '00000000000100000000000208004500001C00000000FF010000C0A80106C0A801E90800000000010001'O
MTC@FA000575: Timeout T_ping: 0.1 s
MTC@FA000575: Error: ping timeout
MTC@FA000575: setverdict(fail): none -> fail
MTC@FA000575: Stopping test component execution.
MTC@FA000575: Test case tc_tcp_001 was stopped.
MTC@FA000575: Terminating component type tcp_suite.tcp_ct.
MTC@FA000575: Port P_ETH_EXT was stopped.
MTC@FA000575: Removing unterminated connection between port P_IP and 3:P_IP.
MTC@FA000575: Port P_IP was stopped.
MTC@FA000575: Removing unterminated connection between port P_ARP and 3:P_ARP.
3@FA000575: Connection of port P_IP to mtc:P_IP was closed unexpectedly by the peer.
MTC@FA000575: Port P_ARP was stopped.
3@FA000575: Port P_IP was disconnected from mtc:P_IP.
MTC@FA000575: Removing unterminated connection between port P_ICMP and 3:P_ICMP.
3@FA000575: Connection of port P_ARP to mtc:P_ARP was closed unexpectedly by the peer.
MTC@FA000575: Port P_ICMP was stopped.
3@FA000575: Port P_ARP was disconnected from mtc:P_ARP.
MTC@FA000575: Removing unterminated connection between port P_IP6 and 3:P_IP6.
MTC@FA000575: Port P_IP6 was stopped.
3@FA000575: Connection of port P_ICMP to mtc:P_ICMP was closed unexpectedly by the peer.
MTC@FA000575: Removing unterminated connection between port P_ICMP6 and 3:P_ICMP6.
3@FA000575: Port P_ICMP was disconnected from mtc:P_ICMP.
MTC@FA000575: Port P_ICMP6 was stopped.
3@FA000575: Connection of port P_IP6 to mtc:P_IP6 was closed unexpectedly by the peer.
MTC@FA000575: Removing unterminated connection between port P_TCP and 3:P_TCP.
3@FA000575: Port P_IP6 was disconnected from mtc:P_IP6.
MTC@FA000575: Port P_TCP was stopped.
MTC@FA000575: Removing unterminated connection between port P_TCP2 and 3:P_TCP2.
3@FA000575: Connection of port P_ICMP6 to mtc:P_ICMP6 was closed unexpectedly by the peer.
MTC@FA000575: Port P_TCP2 was stopped.
3@FA000575: Port P_ICMP6 was disconnected from mtc:P_ICMP6.
MTC@FA000575: Removing unterminated connection between port P_UDP and 3:P_UDP.
3@FA000575: Connection of port P_TCP to mtc:P_TCP was closed unexpectedly by the peer.
MTC@FA000575: Port P_UDP was stopped.
3@FA000575: Port P_TCP was disconnected from mtc:P_TCP.
MTC@FA000575: Removing unterminated connection between port P_CF and 3:P_CF.
3@FA000575: Connection of port P_TCP2 to mtc:P_TCP2 was closed unexpectedly by the peer.
MTC@FA000575: Port P_CF was stopped.
MTC@FA000575: Removing unterminated connection between port P_ETH and 3:P_ETH.
3@FA000575: Port P_TCP2 was disconnected from mtc:P_TCP2.
MTC@FA000575: Port P_ETH was stopped.
MTC@FA000575: Component type tcp_suite.tcp_ct was shut down inside testcase tc_tcp_001.
3@FA000575: Connection of port P_UDP to mtc:P_UDP was closed unexpectedly by the peer.
3@FA000575: Port P_UDP was disconnected from mtc:P_UDP.
MTC@FA000575: Waiting for PTCs to finish.
3@FA000575: Connection of port P_CF to mtc:P_CF was closed unexpectedly by the peer.
3@FA000575: Port P_CF was disconnected from mtc:P_CF.
3@FA000575: Connection of port P_ETH to mtc:P_ETH was closed unexpectedly by the peer.
3@FA000575: Port P_ETH was disconnected from mtc:P_ETH.
3@FA000575: Kill was requested from MC.
3@FA000575: Terminating test component execution.
3@FA000575: Function eth_ct_start was stopped. PTC terminates.
3@FA000575: Terminating component type libtest.eth_CT.
3@FA000575: Removing unterminated mapping between port P_ETH_EXT and system:P_ETH_EXT.
3@FA000575: Port P_ETH_EXT was unmapped from system:P_ETH_EXT.
3@FA000575: Port P_ETH_EXT was stopped.
3@FA000575: Port P_IP was stopped.
3@FA000575: Port P_ARP was stopped.
3@FA000575: Port P_ICMP was stopped.
3@FA000575: Port P_IP6 was stopped.
3@FA000575: Port P_ICMP6 was stopped.
3@FA000575: Port P_TCP was stopped.
3@FA000575: Port P_TCP2 was stopped.
3@FA000575: Port P_UDP was stopped.
3@FA000575: Port P_CF was stopped.
3@FA000575: Port P_ETH was stopped.
3@FA000575: Component type libtest.eth_CT was shut down inside testcase tc_tcp_001.
3@FA000575: Final verdict of PTC: none
MTC@FA000575: Setting final verdict of the test case.
MTC@FA000575: Local verdict of MTC: fail
MTC@FA000575: Local verdict of PTC with component reference 3: none (fail -> fail)
MTC@FA000575: Test case tc_tcp_001 finished. Verdict: fail
MC@FA000575: Test execution finished.
emtc
MC@FA000575: Terminating MTC.
MTC@FA000575: Verdict statistics: 0 none (0.00 %), 0 pass (0.00 %), 0 inconc (0.00 %), 1 fail (100.00 %), 0 error (0.00 %).
MTC@FA000575: Test execution summary: 1 test case was executed. Overall verdict: fail
MTC@FA000575: Exit was requested from MC. Terminating MTC.
MC@FA000575: MTC terminated.
MC2> exit
MC@FA000575: Shutting down session.
HC@FA000575: PTC with component reference 3 finished. Process statistics: { process id: 4869, terminated normally, exit status: 0, user time: 0.072143 s, system time: 0.032063 s, maximum resident set size: 8860, integral resident set size: 0, page faults not requiring physical I/O: 222, page faults requiring physical I/O: 0, swaps: 0, block input operations: 0, block output operations: 16, messages sent: 0, messages received: 0, signals received: 0, voluntary context switches: 13, involuntary context switches: 4 }
HC@FA000575: Exit was requested from MC. Terminating HC.
MC@FA000575: Shutdown complete.
Could not save history.: Permission denied
@ozhuraki
Copy link
Contributor

The test suite sends complete Ethernet frames encapsulated into UDP/IPv4 to the localhost:7771.

It is supposed to work with another utility https://github.com/intel/net-test-tools that decapsulates Ethernet frames and delivers them to the system under test with in one of the following ways:

  • Local AF_UNIX socket with SLIP encapsulation
  • TCP socket with SLIP encapsulation
  • PTY with SLIP encapsulation
  • Linux TAP interface

Currently it’s used for testing https://github.com/zephyrproject-rtos/zephyr TCP2 protocol implementation with the tcp2_check test suite.

So, in other words, at its present state it’s suited for testing embedded implementations.

For other uses cases like testing against Linux host TCP, additional development work might be needed (TAP interface support in net-test-tools is very basic and needs additional work).

Please describe your setup and system under test, let’s see if it can be useful in your case.

@Yao-T
Copy link
Author

Yao-T commented May 21, 2020

Hi ozhuraki , thanks for your reply.

I am testing in the Linux(Ubuntu) platform. I have to have a deeper debug for my test env. I found all of case will fail because of Error: ping timeout. what the do_ping() function do?

What I am going to do is to write my new case with this project. I plan to send TCP data to DUT with PC and the sent data window size exceeds the size that the DUT told to the PC. Any advice?

@ozhuraki
Copy link
Contributor

Hi AmandaYaoYao,

Sorry for the delay with my answer.

I found all of case will fail because of Error: ping timeout. what the do_ping() function do?

Before each test is executed, DUT is sent an ICMP echo and is expected to reply. This can be disabled with:

[MODULE_PARAMETERS]
[…]
libtest.ping_enabled := false

What I am going to do is to write my new case with this project. I plan to send TCP data to DUT with PC and the sent data window size exceeds the size that the DUT told to the PC. Any advice?

Take a look into tcp_data_win() in tcp2_check.ttcnpp.

As a check of a signal-through with your DUT, it might be a good idea to get the ping going through first.

What's your DUT and how do you connect to it?

@Yao-T
Copy link
Author

Yao-T commented Jun 10, 2020

My DUT is a board connect with PC by uart. They will do TCP connection. But when I set my DUT as TCP server and run the case tcp_connect2, the connection cannot be setup. My DUT is in port 4242. So what's the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants