Skip to content

lwip - Add more network tests #3265

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

Merged
merged 14 commits into from
Jan 9, 2017
Merged

lwip - Add more network tests #3265

merged 14 commits into from
Jan 9, 2017

Conversation

geky
Copy link
Contributor

@geky geky commented Nov 15, 2016

Adds more tests over network operations. Since these tests are currently dependent on the availability of a network interface, these live in FEATURE_LWIP.

Also cleaned up the existing network tests and removed the problematic nist test.

Available network tests:

  • connectivity - Tests connecting/disconnecting the network
  • tcp-hello-world - Simple http test using developer.mbed.org, also tests DNS resolution
  • tcp-echo - Tests simple TCP echo with host_test server
  • udp-echo - Tests simple UDP echo with host_test server, dropped packets are retried
  • tcp-packet-pressure - Heavy TCP test with an exponentially growing random sequence, provides runtime measurements
  • udp-packet-pressure - Heavy UDP test with an exponentially growing random sequence, dropped packets are retried with exponential backoff, provides runtime measurements
  • udp-dtls-handshake - Test of problematic UDP traffic present in DTLS handshake (5x ~300 byte packets simultaneously)
  • tcp-echo-parallel - Multithreaded TCP echo test with host_test server
  • udp-echo-parallel - Multithreaded UDP echo test with host_test server, dropped packets are retried
  • tcp-packet-pressure-parallel - Multithreaded TCP test with exponentially growing random sequence, provides runtime measurements
  • udp-packet-pressure-parallel - Multithreaded UDP test with exponentially growing random sequence, dropped packets are retried with exponential backoff, provides runtime measurements

Note: Not all tests may be passing due to issues with underlying drivers. This pr is for initial review, but needs additional work before merging.

cc @bridadan, @bulislaw, @c1728p9

@geky
Copy link
Contributor Author

geky commented Nov 15, 2016

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1080

Build failed!

int main() {
GREENTEA_SETUP(60, "tcp_echo");

EthernetInterface eth;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't make it Ethernet specific, WiFi would use this kind of testing as well -> or any other IP network that we may have to be fair.
I think what we should do after we unify Ethernet and WiFi to use EMAC, scrape the DEVICE_EMAC flag and introduce DEVICE_WIFI and DEVICE_ETHERNET and run the test for each present interface, which shouldn't be difficult as only the connect function would be different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this test being ethernet specific is only a makeshift solution until we have a consistent way to grab network interfaces.

We could duplicate these tests for now between the tests for WiFi and Ethernet, or do you think these tests should adopt the #ifdef checks for each interface?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's all very theoretical right now, we don't test any WiFi. Depending when we are thinking of hooking Odin in the farm it may make sense to just hold of with implementing them for wifi till we have unified networking in place.

@jupe
Copy link
Contributor

jupe commented Nov 15, 2016

what about cellular, 6lowpan, thread, .. are you going to support those as well?

@bulislaw
Copy link
Member

Not knowing anything about them (or the APIs), as long as their implement NetworkInterface they should be supported. That should be pretty much 'for free' if we get them supported in the 'built in network interface' class that would provide built in network interfaces.

@geky
Copy link
Contributor Author

geky commented Nov 15, 2016

We don't currently have the testing infrastructure in place to choose interfaces with different names in a scalable manner.

We are planning on sorting out how to access the network without knowing the underlying network interface, but this is currently a work in progress and won't be ready for 5.3 (This API update will be slow since we want to avoid API churn and keep any updates transparent before being landed).

The goal of this pr is to get testing for at least one network interface type strongly covered and make sure the ethernet drivers are stable across all devices. Once we have a way of accessing the network generically, these tests will be moved up to cover all interfaces.


Unfortunately, with the current setup, the best way to have these tests on all devices is to duplicate them for each "FEATURE". I think that duplication may be better as a separate pr to keep this pr's scope limited (there is likely to be many bug fixes attached to this pr).


(unrelated morph test to avoid message spam)
/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1084

Build failed!

@geky
Copy link
Contributor Author

geky commented Nov 15, 2016

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1085

Build failed!

@geky
Copy link
Contributor Author

geky commented Nov 15, 2016

/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1088

All builds and test passed!

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 16, 2016

@geky Is this still in progress? Let us know once completed.

@geky
Copy link
Contributor Author

geky commented Nov 16, 2016

@0xc0170, This is still in progress. Successfully passing all the tests was unexpected and a result of a restricted buffer being used across all devices. Working on a more flexible solution to scale the buffers per device.

I am still expecting board failures, so there's still quite a bit of work to do.

@geky geky force-pushed the lwip-tests branch 2 times, most recently from a5e63ca to 4db7183 Compare November 16, 2016 22:30
@geky
Copy link
Contributor Author

geky commented Nov 17, 2016

Don't mind me, just giving the test bot stuff to do
/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1111

Build failed!

@geky
Copy link
Contributor Author

geky commented Nov 17, 2016

/morph test-nightly

@mbed-bot
Copy link

Result: ABORTED

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1117

Build Prep failed!

@geky
Copy link
Contributor Author

geky commented Nov 17, 2016

Local test results for K64F with GCC_ARM (This is the only board currently connected to network testing):

+--------------+---------------+------------------------------------------------------------------------+---------+--------------------+-------------+
| target       | platform_name | test suite                                                             | result  | elapsed_time (sec) | copy_method |
+--------------+---------------+------------------------------------------------------------------------+---------+--------------------+-------------+
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-connectivity                 | OK      | 25.99              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-gethostbyname                | OK      | 20.81              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-tcp_echo                     | OK      | 20.53              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-tcp_echo_parallel            | OK      | 20.93              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-tcp_hello_world              | OK      | 18.57              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-tcp_packet_pressure          | TIMEOUT | 76.44              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-tcp_packet_pressure_parallel | TIMEOUT | 136.61             | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-udp_dtls_handshake           | OK      | 19.45              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-udp_echo                     | OK      | 18.27              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-udp_echo_parallel            | OK      | 21.59              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-udp_packet_pressure          | OK      | 23.57              | shell       |
| K64F-GCC_ARM | K64F          | features-feature_lwip-tests-mbedmicro-net-udp_packet_pressure_parallel | OK      | 62.48              | shell       |
+--------------+---------------+------------------------------------------------------------------------+---------+--------------------+-------------+

@SeppoTakalo
Copy link
Contributor

@mikaleppanen Are you aware of these?

We are working towards providing more IPv6 capable testcases also. Please synch efforts. Seems that these are using green-tea, and we are using clitest.

@geky
Copy link
Contributor Author

geky commented Dec 19, 2016

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

@bridadan
Copy link
Contributor

bridadan commented Dec 19, 2016

Sorry for the lack explanation on that failure, found a bug in the CI script.

It was a build error for LPC1768 devices (LPC1768, ARCH_PRO, and UBLOX_C027), the test features-feature_lwip-tests-mbedmicro-net-udp_echo_parallel doesn't fit on the device:

13:30:48 Build failures:
13:30:48   * ARCH_PRO::IAR::FEATURES-FEATURE_LWIP-TESTS-MBEDMICRO-NET-UDP_ECHO_PARALLEL
13:30:48         Building project udp_echo_parallel (ARCH_PRO, IAR)
13:30:48         Scan: IAR
13:30:48         Scan: FEATURE_LWIP
13:30:48         Scan: udp_echo_parallel
13:30:48         Compile [100.0%]: main.cpp
13:30:48         [Warning] mbed_config.h@24,0: [Pe047]: incompatible redefinition of macro "UNITY_INCLUDE_CONFIG_H"
13:30:48         Link: udp_echo_parallel
13:30:48         Error[Lp011]: section placement failed
13:30:48                     unable to allocate space for sections/blocks with a total estimated
13:30:48                               minimum size of 0x7f8c bytes (max align 0x8) in
13:30:48                               <[0x100000c8-0x10007fdf]> (total uncommitted space
13:30:48                               0x7f18).

geky added 2 commits December 19, 2016 16:11
These tests could adopt the dynamically sized buffers used for the
packet-pressure tests, however throughput is not an important feature
of these tests.
Despite being able to buffer an arbitrary stream of data,
TCP send is still limited by the available buffer space in the
network stack. Errors from TCP send are perfectly reasonable
and should be handled by reducing the buffer that is attempted.
@geky
Copy link
Contributor Author

geky commented Dec 19, 2016

@bridadan, thanks! These tests have already gotten worrisomely small, but I've decreased the buffer size again to see if it will fit.

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1296

Test failed!

@geky
Copy link
Contributor Author

geky commented Dec 20, 2016

	Test Result (21 failures / +21)

    UBLOX_EVK_ODIN_W2-ARM.features-feature_lwip-tests-mbedmicro-net-tcp_echo_parallel.features-feature_lwip-tests-mbedmicro-net-tcp_echo_parallel
    UBLOX_EVK_ODIN_W2-ARM.features-feature_lwip-tests-mbedmicro-net-connectivity.Testing bringing the network up and down
    UBLOX_EVK_ODIN_W2-ARM.features-feature_lwip-tests-mbedmicro-net-udp_dtls_handshake.features-feature_lwip-tests-mbedmicro-net-udp_dtls_handshake
    UBLOX_EVK_ODIN_W2-ARM.features-feature_lwip-tests-mbedmicro-net-udp_echo_parallel.features-feature_lwip-tests-mbedmicro-net-udp_echo_parallel
    UBLOX_EVK_ODIN_W2-ARM.features-feature_lwip-tests-mbedmicro-net-tcp_packet_pressure.features-feature_lwip-tests-mbedmicro-net-tcp_packet_pressure
    UBLOX_EVK_ODIN_W2-ARM.features-feature_lwip-tests-mbedmicro-net-udp_packet_pressure.features-feature_lwip-tests-mbedmicro-net-udp_packet_pressure
    NCS36510-IAR.tests-events-queue.Testing call_every
    K64F-ARM.features-feature_lwip-tests-mbedmicro-net-tcp_packet_pressure.features-feature_lwip-tests-mbedmicro-net-tcp_packet_pressure
    K64F-ARM.features-feature_lwip-tests-mbedmicro-net-udp_packet_pressure.features-feature_lwip-tests-mbedmicro-net-udp_packet_pressure
    UBLOX_EVK_ODIN_W2-IAR.features-feature_lwip-tests-mbedmicro-net-connectivity.Testing bringing the network up and down

geky added 2 commits January 5, 2017 10:58
*_packet_pressure_parallel tests are useful for checking for synchronization
errors, but push the practical limitations of the network stack. Failing
these tests is not unreasonable.

*_packet_pressure tests are a little bit less unreasonable, but also
push the practical limitations of the network stack. Hopefully these
will become stable in the near future.
Currently DEVICE_EMAC is incompatible with the EthernetInterface
@geky
Copy link
Contributor Author

geky commented Jan 5, 2017

/morph test-nightly

@mbed-bot
Copy link

mbed-bot commented Jan 5, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1358

All builds and test passed!

@geky
Copy link
Contributor Author

geky commented Jan 5, 2017

Better late than never, LGTM!

@bridadan
Copy link
Contributor

bridadan commented Jan 5, 2017

Oops, sorry for the label craziness!

@sg- sg- merged commit 6af7b29 into ARMmbed:master Jan 9, 2017
@MarceloSalazar
Copy link

Testing this on different K64F and multiple OSes (Windows, Mac), I see the case 'features-feature_lwip-tests-mbedmicro-net-udp_dtls_handshake' always fails (others are ok).

The result of the above CI tests seems to be fine, but are we aware of any instabilities around UDP/DTLS handshake?

If this requires further discussion, I'll happy to create an issue.

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

Successfully merging this pull request may close these issues.

10 participants