#!/bin/sh

ARG=""
if [ x"$1" = x"-v" -o x"$1" = x"-V" ]; then
    ARG="-l debug"
fi

timeout 5s ./examples/ex1 $ARG
if [ $? -eq 0 ]; then
    echo "Test FAIL! (1)"
    exit 1
fi
sleep 1

./watchdogd $ARG -n -p --test-mode &
WDOG=$!
sleep 5

# This test should take ~40 seconds to run
echo "Starting API test ..."
timeout 45s ./examples/ex1 $ARG
result=$?

# Stop watchdogd
kill $WDOG

if [ $result -ne 0 ]; then
    echo "Test FAIL! (2)"
    exit 1
fi

echo "Test OK!"
exit 0

#!/bin/sh

ARGD=""
ARGE=""
if [ x"$1" = x"-v" -o x"$1" = x"-V" ]; then
    ARGD="-l debug"
    ARGE="-V"
fi

echo "Starting test ..."

timeout 5s ./examples/ex1 $ARGE
if [ $? -eq 0 ]; then
    echo "Test FAIL! (1)"
    exit 1
fi
sleep 1

./watchdogd $ARGD -n -p --test-mode &
WDOG=$!
sleep 5

# This test should take ~40 seconds to run
echo "Starting API test ..."
timeout 45s ./examples/ex1 $ARGE
result=$?

# Stop watchdogd
kill $WDOG

if [ $result -ne 0 ]; then
    echo "Test FAIL! (2)"
    exit 1
fi

echo "Test OK!"
exit 0

Fix debug arguments to test components
Fix debug arguments to test components

Signed-off-by: Joachim Nilsson <583c295fd7602c168ad814279bbc3894ba65f5d6@gmail.com>
