1
1
Network Socket test plan
2
2
========================
3
3
4
- This is a test plan for Mbed OS Socket API. This describes all test
5
- cases and their intended behaviour . When API document is not clear, this
6
- should be used as a reference for implementing correct behaviour .
4
+ This is a test plan for the Mbed OS Socket API. This describes all test
5
+ cases and their intended behaviors . When an API document is not clear, use
6
+ this as a reference for implementing correct behavior .
7
7
8
- ** NOTE:** As testing is a moving target, this test plan might define more test cases than what are
9
- implemented in Mbed OS . Refer to [ test case priorities] ( #test-case-priorities ) for list of test cases that target must pass to be compliant with Mbed OS socket API.
8
+ ** NOTE:** Because testing is a moving target, this test plan might define more test cases than Mbed OS
9
+ implements . Refer to [ test case priorities] ( #test-case-priorities ) for a list of test cases that the target must pass to be compliant with the Mbed OS socket API.
10
10
11
11
12
12
Target API
13
13
----------
14
14
15
- Target for this plan is to test
15
+ The target for this plan is to test:
16
16
17
- - [ Socket] ( https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/Socket.h )
18
- - [ UDPSocket] ( https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/UDPSocket.h )
19
- - [ TCPSocket] ( https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/TCPSocket.h )
20
- - [ TCPServer] ( https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/TCPServer.h )
17
+ - [ Socket] ( https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/Socket.h ) .
18
+ - [ UDPSocket] ( https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/UDPSocket.h ) .
19
+ - [ TCPSocket] ( https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/TCPSocket.h ) .
20
+ - [ TCPServer] ( https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/TCPServer.h ) .
21
21
22
22
Reference documentation: https://os.mbed.com/docs/latest/reference/network-socket.html
23
23
24
- Tools to be used
24
+ Tools to use
25
25
----------------
26
26
27
- - Mbed OS
28
- - Standard Mbed OS development tools as described in https://os.mbed.com/docs/latest/tools/index.html
29
- - Test server
27
+ - Mbed OS.
28
+ - Standard Mbed OS development tools as described in https://os.mbed.com/docs/latest/tools/index.html .
29
+ - Test server.
30
30
31
- These test cases itself do not require any special tooling, other than
31
+ These test cases themselves do not require any special tooling, other than
32
32
the test server described in "Test environment" chapter.
33
33
34
34
Test environment
35
35
----------------
36
36
37
37
As a general guideline, network connectivity with public Internet access
38
- is required. This satisfies Socket tests but specific connectivity
38
+ is required. This satisfies Socket tests, but specific connectivity
39
39
methods might require some extra configuration or devices within the
40
40
network.
41
41
42
- Test environment consist of DUTs, network connection and test
43
- server. Arm provides public test server, but it can be installed locally
44
- as well, if isolated test environment is required.
42
+ The test environment consist of DUTs, network connection and the test
43
+ server. Arm provides a public test server, but it can be installed locally
44
+ as well, if an isolated test environment is required.
45
45
46
- ### Public Test server
46
+ ### Public test server
47
47
48
48
Address: ` echo.mbedcloudtesting.com `
49
49
50
- Both IPv4 and IPv6 addresses are available from public DNS service which
51
- currently are following:
50
+ Both IPv4 and IPv6 addresses are available from a public DNS service:
52
51
53
52
``` .sh
54
53
$ host echo.mbedcloudtesting.com
@@ -58,10 +57,10 @@ echo.mbedcloudtesting.com has IPv6 address 2a05:d018:21f:3800:8584:60f8:bc9f:e61
58
57
59
58
** Open services in the test server**
60
59
61
- - Echo Protocol , [ RFC 862] ( https://tools.ietf.org/html/rfc862 ) is
60
+ - Echo protocol , [ RFC 862] ( https://tools.ietf.org/html/rfc862 ) is
62
61
enabled in both TCP and UDP. Port 7.
63
- - Discard Protocol , [ RFC 863] ( https://tools.ietf.org/html/rfc863 ) is
64
- enabled in both TCP and UDP. Port 9
62
+ - Discard protocol , [ RFC 863] ( https://tools.ietf.org/html/rfc863 ) is
63
+ enabled in both TCP and UDP. Port 9.
65
64
- Character generator protocol, [ RFC 864] ( https://tools.ietf.org/html/rfc864 ) is
66
65
enabled in both TCP and UDP. Port 19. Output pattern should follow
67
66
the proposed example pattern in RFC.
@@ -70,22 +69,21 @@ echo.mbedcloudtesting.com has IPv6 address 2a05:d018:21f:3800:8584:60f8:bc9f:e61
70
69
- Time protocol, [ RFC 868] ( https://tools.ietf.org/html/rfc868 ) in
71
70
both TCP and UDP. Port 37.
72
71
73
- Firewall should be configured to allow this traffic to test server.
72
+ Configure the firewall to allow this traffic to access the test server.
74
73
75
74
** Example configuration for Debian/Ubuntu Linux**
76
75
77
- These services are available on many operating systems and its out of
78
- scope of this document to describe how to install them. This is an
79
- example how to install these into Debian/Ubuntu based Linux distribution
80
- using standard Inet Daemon.
76
+ These services are available on many operating systems, and installing them is out of
77
+ scope of this document. Below is an
78
+ example of how to install these services into a Debian/Ubuntu based Linux distribution
79
+ using standard Inet Daemon:
81
80
82
81
``` .sh
83
82
$ sudo apt install inetutils-inetd
84
83
$ nano /etc/inetd.conf
85
84
```
86
85
87
-
88
- Enable following services from /etc/inetd.conf
86
+ Enable following services from /etc/inetd.conf:
89
87
90
88
```
91
89
#:INTERNAL: Internal services
@@ -99,10 +97,9 @@ daytime stream tcp6 nowait root internal
99
97
time stream tcp6 nowait root internal
100
98
```
101
99
102
-
103
100
** Testing the connectivity**
104
101
105
- Connection to test server can be used with NMAP tool like this
102
+ You can connect to the test server with an NMAP tool like this:
106
103
107
104
``` .sh
108
105
$ nmap -sT -p7,9,13,37 echo.mbedcloudtesting.com
@@ -140,27 +137,23 @@ Nmap done: 1 IP address (1 host up) scanned in 0.20 seconds
140
137
141
138
![ Ethernet] ( eth_environment.png )
142
139
143
- Ethernet test environment consist of devices, ethernet switch, optional
144
- firewall that allows connecting to Echo server.
145
-
146
-
140
+ The Ethernet test environment consists of devices, an ethernet switch and an optional
141
+ firewall that allows connecting to the Echo server.
147
142
148
- ### Wifi test environment
143
+ ### Wi-Fi test environment
149
144
150
- ![ Wifi ] ( wifi_environment.png )
145
+ ![ Wi-Fi ] ( wifi_environment.png )
151
146
152
- Wifi test environment is equiwalent of the ethernet one , except that it
153
- have two separate access point, or one with dual SSID. Connectivity to
147
+ The Wi-Fi test environment is equivalent to the Ethernet test environment , except that the
148
+ Wi-Fi test environment has two separate access points or one with dual SSID. Connectivity to
154
149
echo server is required, but it can be hosted locally, as specified in
155
- Ethernet environment.
156
-
157
-
150
+ the Ethernet environment.
158
151
159
152
Test case priorities
160
153
--------------------
161
154
162
- Please refer to following table for priorities of test cases. Priorities
163
- are labelled as MUST and SHOULD. MUST means this is a requirement and
155
+ Please refer to the following table for priorities of test cases. Priorities
156
+ are labeled as MUST and SHOULD. MUST means this is a requirement and
164
157
therefore mandatory to pass the test. SHOULD means it is recommended to
165
158
pass the test if the driver implements the feature in question.
166
159
@@ -222,10 +215,10 @@ pass the test if the driver implements the feature in question.
222
215
Building test binaries
223
216
--------------------------
224
217
225
- For testing the board and driver, testing should be done against Mbed OS
226
- master to get latest up to date test cases and drivers.
218
+ For testing the board and driver, test against the Mbed OS
219
+ master branch to get the most recent, up-to- date test cases and drivers.
227
220
228
- To create build environment:
221
+ To create a build environment:
229
222
230
223
``` .sh
231
224
mbed new network_test
@@ -235,8 +228,8 @@ git checkout master
235
228
cd ..
236
229
```
237
230
238
- Also, when building socket testcases, special macro is required to
239
- enable all test , so create ` mbed_app.json ` file with following
231
+ Also, building socket test cases requires a special macro to
232
+ enable all tests , so create an ` mbed_app.json ` file with the following
240
233
content at minimum:
241
234
242
235
```
@@ -245,7 +238,7 @@ content at minimum:
245
238
}
246
239
```
247
240
248
- WiFi tests require some more configuration, so for WiFi purposes,
241
+ Wi-Fi tests require some more configuration, so for Wi-Fi purposes,
249
242
the ` mbed_app.json ` might look like this:
250
243
251
244
```
@@ -311,7 +304,8 @@ the `mbed_app.json` might look like this:
311
304
}
312
305
```
313
306
314
- Now build test binaries
307
+ Now build test binaries:
308
+
315
309
``` .sh
316
310
mbed test --compile -t < toolchain> -m < target> -n mbed-os-tests-network-* ,mbed-os-tests-netsocket*
317
311
```
0 commit comments