|
1 | 1 | # Introduction
|
2 | 2 |
|
3 |
| -This document describes how to run EMAC tests. The EMAC test cases are made using the Ethernet Configuration Testing Protocol (CTP). To run the tests, one device in the Ethernet segment needs to be configured to be a CTP echo server. The devices running the test cases, use the echo server to forward the CTP Ethernet frames back. |
| 3 | +This document describes how to run EMAC tests. The EMAC test cases are made using the Ethernet Configuration Testing Protocol (CTP). To run the tests, you need to configure one device in the Ethernet segment to be a CTP echo server. The devices running the test cases use the echo server to forward the CTP Ethernet frames back. |
4 | 4 |
|
5 | 5 | ## Configuring the CTP echo server
|
6 | 6 |
|
7 |
| -To configure a device to be a CTP echo server, you need to enable the `echo-server` setting in the `json` file of the test environment application. When a device is configured to be a CTP echo server, it starts to forward CTP messages automatically when it is switched on and continues to do so until it is switched off. |
| 7 | +To configure a device to be a CTP echo server, you need to enable the `echo-server` setting in the `json` file of the test environment application. When you configure a device to be a CTP echo server, it starts to forward CTP messages automatically when it is on and continues to do so until you switch it off. |
| 8 | + |
| 9 | +## Other configuration options |
| 10 | + |
| 11 | +Default configuration files included with tests are configured for ethernet. For Wi-Fi, set `test-ethernet` to 0 and `test-wifi` to 1. You also need to configure Wi-Fi SSID and security options to the configuration file. |
| 12 | + |
| 13 | +## Example commands |
| 14 | + |
| 15 | +### CTP echo server |
| 16 | + |
| 17 | +You can use the following command to a build CTP echo server: |
| 18 | + |
| 19 | +`mbed test --compile -m TARGET -t GCC_ARM -v -n tests-network-emac --app-config TESTS/network/emac/template_mbed_app_echo_server.txt` |
| 20 | + |
| 21 | +Replace TARGET with the target device. After building, flash the binary to the CTP echo server device. |
| 22 | + |
| 23 | +You can verify that the CTP echo server has started properly by making a terminal connection to the device, resetting it and verifying that `echo server started successfully` prints on the terminal. You can run host tests when the CTP echo server is running on the Ethernet segment. |
| 24 | + |
| 25 | +For Wi-Fi tests, the CTP echo server can also run on the ethernet side as long as the network configuration is such that Ethernet frames are routed between Wi-Fi and Ethernet. |
| 26 | + |
| 27 | +The CTP echo server sends a 100-byte long broadcast CTP Ethernet frame every 60 seconds to inform the network of its presence. |
| 28 | + |
| 29 | +### Running tests |
| 30 | + |
| 31 | +You can use the following command to run tests: |
| 32 | + |
| 33 | +`mbed test --compile --run -m TARGET -t GCC_ARM -v -n tests-network-emac --app-config TESTS/network/emac/template_mbed_app.txt` |
| 34 | + |
| 35 | +Replace TARGET with the target device. |
| 36 | + |
| 37 | +## Traces |
| 38 | + |
| 39 | +Test cases have different trace levels based on how much tracing can be done without affecting the performance of the test case. Configure tracing using `SET\_TRACE\_LEVEL` macro. |
| 40 | + |
| 41 | +For example, the `EMAC broadcast` test enables send, input CTP frame, success and failure traces: |
| 42 | + |
| 43 | +`SET_TRACE_LEVEL(TRACE_SEND | TRACE_ETH_FRAMES | TRACE_SUCCESS | TRACE_FAILURE);` |
| 44 | + |
| 45 | +This example trace is about a message sent to broadcast address `ff:ff:ff:ff:ff:ff` that an echo server answers: |
| 46 | + |
| 47 | +``` |
| 48 | +
|
| 49 | +message sent ff:ff:ff:ff:ff:ff |
| 50 | +
|
| 51 | +response: receipt number 24 LENGTH OK DATA OK BROADCAST |
| 52 | +
|
| 53 | +``` |
| 54 | + |
| 55 | +This example trace is about a message sent to broadcast address `ff:ff:ff:ff:ff:ff` that an echo server does not answer: |
| 56 | + |
| 57 | +``` |
| 58 | +
|
| 59 | +message sent ff:ff:ff:ff:ff:ff |
| 60 | +
|
| 61 | +NO RESPONSE: receipt number 25 |
| 62 | +
|
| 63 | +``` |
| 64 | + |
| 65 | +This example is about input message trace. Message hex dump contains the first 32 bytes of the received Ethernet frame: |
| 66 | + |
| 67 | +``` |
| 68 | +
|
| 69 | +INP> LEN 100 |
| 70 | +
|
| 71 | +INP> 000000 ff ff ff ff ff ff ba 42 ed 79 11 8a 90 00 |
| 72 | +
|
| 73 | +INP> 00000e 00 00 02 00 ba 42 ed 79 11 8a 01 00 01 00 |
| 74 | +
|
| 75 | +``` |
| 76 | + |
| 77 | +To verify whether the echo server is receiving CTP Ethernet frames, enable `echo-server-trace` option in the echo server configuration file. You can use this for debugging purposes. Do not run performance tests such as `EMAC unicast burst` with tracing enabled because tracing affects the echo server performance. |
8 | 78 |
|
9 | 79 | ## Test cases
|
10 | 80 |
|
|
0 commit comments