1# Testing with net-tools and Docker 2 3* Create Docker image 4 5 cd docker/ 6 docker build -t net-tools . 7 8* Setup network interfaces, IP addresses and routes 9 10 ./net-setup.sh --config docker.conf 11 12* Run Docker image 13 14 Set the docker internal network name to the value $DOCKER_USER_INTERFACE 15 in docker.config above, default is 'net-tools0'. The bridge network that 16 docker creates will be printed on standard out, it's bridge interface 17 name will be br-XXXXXXXXXXXX. Check that the IPv4 and IPv6 addresses 18 given on the docker command line match the subnets in 'docker.conf'. 19 20 Interactively: 21 22 docker run --hostname=zephyr --name=net-tools \ 23 --ip=192.0.2.2 --ip6=2001:db8::2 \ 24 --rm -it --network=net-tools0 net-tools sh 25 26 exit with Ctrl-p ctrl-q to execute tests from the command line 27 28 Non-interactively 29 30 docker run --hostname=zephyr --name=net-tools \ 31 --ip=192.0.2.2 --ip6=2001:db8::2 \ 32 --rm -dt --network=net-tools0 net-tools sh 33 34* Run Qemu / native-posix image 35 36 rm -rf build && mkdir build 37 38 cmake -GNinja -DBOARD=native_posix -B build 39 or 40 cmake -GNinja -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-e1000.conf \ 41 -B build 42 43 ninja -C build run 44 45* Execute tests like echo-client 46 47 docker container exec net-tools /net-tools/echo-client 2001:db8::1 48 docker container exec net-tools /net-tools/echo-client -t 2001:db8::1 49 docker container exec net-tools /net-tools/echo-client 192.0.2.1 50 docker container exec net-tools /net-tools/echo-client -t 192.0.2.1 51 52* Remove the 'net-tools0' docker network: 53 54 docker network rm net-tools0 55