#!/usr/share/ucs-test/runner bash
# shellcheck shell=bash
## desc: Check univention-ssh timeout
## bugs: [17697]
## tags: [univention]
## packages: [univention-ssh]
## exposure: safe

# shellcheck source=../../lib/base.sh
. "$TESTLIBPATH/base.sh" || exit 137

result="$(univention-ssh -timeout 10 "$tests_root_pwdfile" "root@${hostname}.${domainname}" echo BEFORE \; sleep 20 \; echo AFTER 2>&1)"
if ! grep -q BEFORE <<<"$result"
then
	exit 110 # ERROR
elif grep Traceback <<<"$result"
then
	exit 110 # ERROR
elif grep -q AFTER <<<"$result"
then
	exit 110 # ERROR
else
	exit 100 # OK
fi
# vim:set ft=sh:
