#!/bin/sh -e
#
# Test if the kdm server is working.

. /usr/share/debian-edu-config/testsuite-lib.sh

if test -r /etc/debian-edu/config ; then
    . /etc/debian-edu/config
fi

# Standalone Main-Server does not install kdm
if [ "$PROFILE" = Main-Server ] ; then
    exit 0
fi

# Only test if kdm is installed
if  deb_installed kdm ; then
    :
else
    echo "info: $0: kdm is not installed"
    exit 0
fi


# kdm shall not be started, disabling the following tests
# (2006-01-25, werner)

# kdm is not started yet when this is executed during installation.
# Thus only information.
#if pidof kdm > /dev/null ; then
#    echo "success: $0: kdm is running."
#else
#    echo "info: $0: kdm is not running."
#    exit 1
#fi
#
#port=xdmcp
#proto=udp
#
#if netstat -a 2>&1 | grep ":$port " | grep -q "^$proto" ; then
#    echo "success: $0: kdm server is listening on $port/$proto."
#else
#    echo "info: $0: kdm server is not listening on $port/$proto."
#    exit 1
#fi
#
#exit 0
