Lines Matching +full:directory +full:- +full:to +full:- +full:scan
3 # SPDX-License-Identifier: Apache-2.0
5 image=net-tools
6 name=net-tools
7 network=net-tools0
14 docker_test_script_name=docker-test.sh
24 if [ -z "$ZEPHYR_BASE" ]; then
27 elif [ ! -d "$ZEPHYR_BASE" ]; then
28 echo '$ZEPHYR_BASE is set, but it is not a directory' >&2
32 if [ -z "$NET_TOOLS_BASE" ]; then
39 l="$d/net-tools"
40 if [ -d "$l" ]; then
47 if [ $ret_zephyr -eq 0 ]; then
51 if [ -z "$NET_TOOLS_BASE" ]; then
52 echo '$NET_TOOLS_BASE is unset, no net-tools found' >&2
54 elif [ ! -d "$NET_TOOLS_BASE" ]; then
55 echo '$NET_TOOLS_BASE set, but it is not a directory' >&2
59 if [ $ret_net_tools -eq 0 ]; then
63 if [ $ret_zephyr -ne 0 -o $ret_net_tools -ne 0 ]; then
74 find "$ZEPHYR_BASE" -type f -name $docker_test_script_name | \
75 awk -F "$ZEPHYR_BASE/" '{ print $2 }' | \
82 local addresses="--ip=192.0.2.2 --ip6=2001:db8::2"
90 bridge_interface=$("$NET_TOOLS_BASE/net-setup.sh" \
91 --config "$NET_TOOLS_BASE/docker.conf" \
92 start 2>/dev/null | tail -1)
102 if [ -n "$*" ]; then
110 if docker run --hostname=$name --name=$name $addresses \
111 --rm -dit --network=$network $image > /dev/null; then
112 echo -n "Started Docker container '$name'"
113 if [ -n "$*" ]; then
114 echo -n " with extra arguments '$*'"
130 if [ $? -eq 0 ]; then
137 bridge_interface=$(docker network ls | grep "$network" | cut -d " " -f 1)
138 if [ -n "$bridge_interface" ]; then
140 if [ $? -eq 0 ]; then
142 "'br-$bridge_interface'..."
148 # No need to keep the zephyr eth interface around
149 "$NET_TOOLS_BASE/net-setup.sh" --config "$NET_TOOLS_BASE/docker.conf" \
155 if [ -n "$*" ]; then
159 rm -rf build && mkdir build && \
160 cmake -GNinja -DBOARD=native_posix -B build "$@" . && \
161 ninja -C build
165 #ninja -C build run &
174 local pid="$(ps -o pid= --ppid "$1")"
181 if [ -n "$pid" ]; then
182 echo -n "$pid "
188 if [ "$zephyr_pid" -ne 0 ]; then
220 docker container exec net-tools $test || return $?
234 if [ "$docker_pid" -ne 0 -a "$configuration" != "keep" ]; then
264 if [ -n "$zephyr_overlay" ]; then
265 overlay="-DOVERLAY_CONFIG=$zephyr_overlay"
271 if [ $result -eq 0 ]; then
286 $BASENAME [-Z <zephyr base directory>] [-N <net-tools base directory>] [<list of test directories>]
289 network implemented by the 'net-tools' subproject.
291 -Z|--zephyr-dir <dir>
292 set Zephyr base directory
293 -N|--net-tools-dir <dir>
294 set net-tools directory
295 --start
297 --stop
299 --keep
301 --overlay <config files>
303 --scan
306 run the tests in these directories instead of current directory
325 while test -n "$1"
328 -Z|--zephyr-dir)
333 -N|--net-tools-dir)
338 -h|--help)
342 --start)
343 if [ -n "$configuration" ]; then
344 echo "--start or --stop specified multiple times" >&2
349 --stop)
350 if [ -n "$configuration" ]; then
351 echo "--start or --stop specified multiple times" >&2
356 --keep)
360 --overlay)
362 if [ -n "$zephyr_overlay" ]; then
369 --scan)
372 -*)
387 if [ $scan_dirs -eq 1 ]; then
392 if [ -z "$configuration" -o "$configuration" = "start_only" -o \
401 if [ -z "$dirs" ]; then
406 if [ ! -d "$d" ]; then
407 echo "No such directory $d, skipping it"
411 if [ ! -f "$d/$docker_test_script_name" ]; then
412 echo "No such file $d/$docker_test_script_name, skipping directory"
424 if [ $test_result -ne 0 ]; then
429 if [ $found -eq 0 ]; then
435 if [ -z "$configuration" -o "$configuration" = stop_only ]; then