Commit Graph

20 Commits

Author SHA1 Message Date
Seppo Takalo a8d56c4f1f net: scripts: Use native_sim instead of native_posix
Sample tests should also be using native_sim board.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-11-27 19:55:30 +01:00
Seppo Takalo 1ecd4fda1a net: script: Fix the net-tools path
Fix the correct path to net-tools directory.
Also default to Bash instead of /bin/sh as we use
Bash syntax.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-06 16:14:39 +03:00
Christopher Friedt ef142c117e scripts: net: add enumerate_http_status.py
Add a script to extract HTTP status values and format them
in a way that is both human readable and machine parseable.

Each line of output is of the form:

```
HTTP_{key}_{upper_val} = {key}, /**< val */
```

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2022-10-12 09:02:21 -04:00
Jukka Rissanen d1901d6a2f net: scripts: Make test runner script fully generic
Move actual test cases from the run-sample-tests.sh script to
the network samples directory that are supported by Docker based
testing. Each network sample directory that supports Docker testing,
will contain docker-test.sh script that is sourced by the runner
script. The docker-test.sh script will run the test as needed and
then return return value to the runner script.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-20 16:07:59 +02:00
Jukka Rissanen 66332cc648 net: scripts: Add dumb_http_server_mt sample to Docker testing
Add a way to run dumb_http_server_mt sample application against
HTTP get script (using curl) running in Docker.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:25:36 +02:00
Jukka Rissanen 861c2c78f0 net: scripts: Add gPTP support to sample testing
Allow gPTP sample to be run via run-sample-tests.sh script.
This makes it possible to do simple smoke testing and verify that
gPTP stack is not broken.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:15:37 +02:00
Jukka Rissanen d29ae958e9 net: scripts: Add http-client sample to Docker testing
Add a way to run http-client against http(s)-server.py that
is running in Docker.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-13 07:25:27 -05:00
Jukka Rissanen 2f4b66967d net: scripts: Close zephyr network interface when test closes
The zeth interface was left hanging around when the test
finished but we can remove it here as it is not needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-09 14:42:34 +02:00
Jukka Rissanen b68f7dfac2 net: scripts: Fix indentation and help usage
Fixing the indentation of run-sample-tests.sh script so that it
is easier to read.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-09 14:42:34 +02:00
Ruslan Mstoi 4695eb4e1d scripts: net: Fix incorrect error messages
If environment variables ZEPHYR_BASE or NET_TOOLS_BASE are unset, an
incorrect message is printed saying that "it is set, but it is not a
directory":

$ZEPHYR_BASE is unset
$ZEPHYR_BASE is set, but it is not a directory
$NET_TOOLS_BASE is unset, no net-tools found
$NET_TOOLS_BASE set, but it is not a directory

This patch fixes that issue.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-05-21 14:45:07 +02:00
Patrik Flykt 190705960d scripts: net: Add SOCKS 5 to MQTT TLS sample test
Start SOCKS5 proxy in the net-tools Docker image and run MQTT TLS
tests with SOCKS enabled. Since the MQTT TLS server is already
running as of the previous test, start only the danted daemon.

Rely on mosquitto MQTT port being handled by the Docker image
configuration file instead of specifying it on the command line.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-04-28 10:29:17 +03:00
Patrik Flykt c99392f2d6 scripts: net: Add TLS test for mqtt_publisher
In addition to the existing plain TCP MQTT test, add the same test
with TLS applied. Robert Lubos provided the updated test_cert.h, which
contains the same certificate as in the echo samples.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-25 08:39:39 +02:00
Patrik Flykt c9ad901fb7 scripts: net: Clarify and add documentation to README
The README file was in need of clarification how to set up the
net-tools Docker image and how the IP addresses were assigned.
mqtt_publisher is also mentioned.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-17 13:14:41 +02:00
Patrik Flykt 2b42e1274e scripts: net: Support testing of mqtt_publisher
With net-tools and the mqtt_publisher sample updated, add support
for running the sample with the network sample test script.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-17 13:14:41 +02:00
Patrik Flykt 26685b727b scripts: net: Properly return Zephyr exit code to script
Save the exit code from 'wait' so that it is not lost when PID
is set to zero.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-17 13:14:41 +02:00
Patrik Flykt cbef6760c1 scripts: net: Enhance error reporting
Enhance error reporting by returning immediately when the calling
function reports an error.

Signed-off-by: Andrei Laperie <andrei.laperie@intel.com>
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-10 16:43:10 +02:00
Patrik Flykt 3401192e7f scripts: net: Add option to keep container after test
Add '--keep' option to leave Docker container and network running
after the test.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-10 16:43:10 +02:00
Patrik Flykt ad1b38bebe scripts: net: Return final return value from Docker test
Return the final return value from Docker script when running echo
client in the container, first for UDP and then TCP, for both IPv4
and IPv6.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-10 16:43:10 +02:00
Patrik Flykt 8f451b7338 scripts: net: Add overlay file to sample script
Add an '--overlay' command line option in order to use an overlay
file when compiling Zephyr.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-10 16:43:10 +02:00
Patrik Flykt 65ffc71466 scripts: net: Add script for running sample tests
Add a script that sets up Docker networking and starts the net-tools
Docker container. If successful, run Zephyr with native_posix and
execute the appropriate net-tools container executable. The proper
net-tools executable and arguments is selected depending on the
basename of the sample directory. This script needs to be updated
if the net-tools Docker image is updated in some incompatible way.

The net-tools directory is assumed to exist at the same level as
the Zephyr base directory, but its location can be set using the
'-N' command line argument. Likewise, '-Z' sets the Zephyr top level
directory.

When stopping Zephyr, go through all child processes since running a
native posix or other variant of Zephyr may cause a hierarchy of
processes to be created.

Fixes: #19540

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-02-03 09:04:12 -05:00