[debian-edu-commits] debian-edu/ 09/14: Adjust various testsuite tool to work with TLS and Cfengine changes.

Wolfgang Schweer schweer-guest at moszumanska.debian.org
Sat Jan 6 23:46:41 UTC 2018


This is an automated email from the git hooks/post-receive script.

schweer-guest pushed a commit to branch master
in repository debian-edu-config.

commit e611d4195840a2b1f846b9be7296e2138795340c
Author: Wolfgang Schweer <wschweer at arcor.de>
Date:   Sat Jan 6 23:46:22 2018 +0100

    Adjust various testsuite tool to work with TLS and Cfengine changes.
---
 testsuite/dhcpd      |  2 +-
 testsuite/ltsp       | 20 ++++++--------------
 testsuite/postoffice | 15 ++++++++-------
 testsuite/sudo       |  2 +-
 testsuite/webcache   |  9 +++++----
 testsuite/webserver  | 23 ++++++-----------------
 6 files changed, 27 insertions(+), 44 deletions(-)

diff --git a/testsuite/dhcpd b/testsuite/dhcpd
index 474e772..bff9039 100755
--- a/testsuite/dhcpd
+++ b/testsuite/dhcpd
@@ -17,7 +17,7 @@ cfg=/etc/default/isc-dhcp-server
 
 if [ -f $cfg ] ; then
     . $cfg
-    echo "info: $0: configured interfaces is '$INTERFACES'"
+    echo "info: $0: configured interface(s): '$INTERFACESv4'"
 else
     echo "error: $0: $cfg is missing."
     exit 1
diff --git a/testsuite/ltsp b/testsuite/ltsp
index c26bbb4..1e35be8 100755
--- a/testsuite/ltsp
+++ b/testsuite/ltsp
@@ -100,19 +100,11 @@ if echo "$PROFILE" | grep -q LTSP-Server ; then
 	echo "error: $0: not able to connect to ldinfod"
     fi
 
-    # Test if the LTSP chroots can be NFS mounted
-    myname=$(uname -n)
-    foundnfs=false
-    for m in $(showmount -e $myname | grep /opt/ltsp | awk '{print $1}') ; do
-	if mount $myname:$m /mnt; then
-	    echo "success: $0: mounting $myname:$m succeeded"
-	    umount /mnt
-	    foundnfs=true
-	else
-	    echo "error: $0: unable to mount $myname:$m"
-	fi
-    done
-    if [ false = "$foundnfs" ] ; then
-	echo "error: $0: unable to find any NFS mount points on $myname"
+    # Test if NBD is configured for LTSP chroot.
+    if [ -e /opt/ltsp/images/$LTSPARCH.img ] \
+        && [ -f /etc/nbd-server/conf.d/ltsp_$LTSPARCH.conf ] ; then
+        echo "success: $0: NBD image and configuration for LTSP exists"
+    else
+        echo "error: $0: NBD configuration for LTSP is broken"
     fi
 fi
diff --git a/testsuite/postoffice b/testsuite/postoffice
index 98af295..564f69a 100755
--- a/testsuite/postoffice
+++ b/testsuite/postoffice
@@ -24,16 +24,17 @@ for port in smtp imaps; do
     netstat_check $port tcp "postoffice" || retval=1
 done
 
-## send a test-email to root: 
-cat << EOF | /usr/lib/sendmail root
+# send a test-email to postmaster
+# (only allowed recipient for sender w/o Kerberos ticket)
+cat << EOF | /usr/lib/sendmail postmaster
 Subject: Test-email sent by the debian-edu test-suite
 
 Dear system administrator,
 
 welcome to the mail-system. Basic email delivery seems to work!
-If you did not receive this email, report the failure to us. 
+If you did not receive this email, report the failure to us.
 
-This email has been sent by the Debian Edu test-suite. 
+This email has been sent by the Debian Edu test-suite.
 
 Regards,
 
@@ -43,12 +44,12 @@ EOF
 
 tmpfile=$(tempfile)
 smtpserver=postoffice.intern
-if swaks --to root at postoffice.intern --server $smtpserver > $tmpfile; then
-    echo "success: $0: SMTP to $smtpserver worked, email to root sent."
+if swaks --to postmaster at postoffice.intern --server $smtpserver > $tmpfile; then
+    echo "success: $0: SMTP to $smtpserver worked, email to postmaster sent."
 else
     echo "error: $0: SMTP to $smtpserver did not work."
     sed "s%^%info: $0: swaks: %" < $tmpfile
 fi
-rm $tmpfile
+#rm $tmpfile
 
 exit $retval
diff --git a/testsuite/sudo b/testsuite/sudo
index 3da1ec2..bd88a8f 100755
--- a/testsuite/sudo
+++ b/testsuite/sudo
@@ -29,7 +29,7 @@ if grep -q '^sudoers:.* ldap' /etc/nsswitch.conf ; then
 else
     echo "error: $0: ldap is not enabled for sudoers in nsswitch.conf"
 fi
-if grep -q '^sudoers:.* files' /etc/nsswitch.conf ; then
+if grep -q '^sudoers:.*files' /etc/nsswitch.conf ; then
     echo "success: $0: files is enabled for sudoers in nsswitch.conf"
 else
     echo "error: $0: files is not enabled for sudoers in nsswitch.conf"
diff --git a/testsuite/webcache b/testsuite/webcache
index a30e7e0..7a09fad 100755
--- a/testsuite/webcache
+++ b/testsuite/webcache
@@ -62,7 +62,8 @@ fi
 
 # Verify that the automatic proxy configuration file is available
 url=http://wpad/wpad.dat
-if /usr/bin/HEAD $HEADOPTS $url > /dev/null 2>&1 ; then
+
+if HEAD $HEADOPTS $url 2>&1 | grep -q 'certificate verify' ; then
     echo "success: $0: WPAD file is available from '$url'."
 
     # Subshell to avoid leaking http_proxy and ftp_proxy variables to
@@ -70,7 +71,7 @@ if /usr/bin/HEAD $HEADOPTS $url > /dev/null 2>&1 ; then
     (
 	eval `/usr/share/debian-edu-config/tools/wpad-extract`
 	if [ "$http_proxy" ] ; then
-	    echo "success: $0: WPAD file '$url' include HTTP proxy info."
+	    echo "success: $0: WPAD file '$url' includes HTTP proxy info."
 	else
 	    echo "error: $0: WPAD file '$url' is missing HTTP proxy info. (#644373?)"
 	fi
@@ -84,9 +85,9 @@ http_proxy=http://$server:3128/
 ftp_proxy=$http_proxy
 export http_proxy ftp_proxy
 
-url=http://www.intern/
+url=https://www.intern/
 
-if /usr/bin/HEAD $HEADOPTS $url > /dev/null 2>&1 ; then
+if HEAD $HEADOPTS $url 2>&1 | grep -q 'certificate verify' ; then
     echo "success: $0: Valid response from '$url' using proxy '$http_proxy'."
 else
     echo "error: $0: Unable to connect to '$url' using proxy '$http_proxy'."
diff --git a/testsuite/webserver b/testsuite/webserver
index 78e7311..07fa75e 100755
--- a/testsuite/webserver
+++ b/testsuite/webserver
@@ -15,17 +15,6 @@ else
     exit 0
 fi
 
-skeloverride=/etc/skel/.mozilla/firefox/debian-edu.default/cert_override.txt
-if [ ! -f "$skeloverride" ] ; then
-    echo "error: $0: Missing $skeloverride."
-else
-    if [ -h "$skeloverride" ] ; then
-        echo "error: $0: Found $skeloverride as symlink."
-    else
-        echo "success: $0: Found $skeloverride."
-    fi
-fi
-
 # Only Main-Server profile provide webserver
 if echo "$PROFILE" | grep -q 'Main-Server' ; then
     :
@@ -34,7 +23,7 @@ else
 fi
 
 # Only Main-Server have the debian-edu profile in the firefox setup.
-check_file_perm /etc/skel/.mozilla/firefox/profiles.ini 644
+check_file_perm /etc/skel/.mozilla/firefox/profiles.ini 600
 
 server=www
 
@@ -59,16 +48,16 @@ if [ ! -x /usr/bin/HEAD ] ; then
 	echo "error: $0: Unable to find /usr/bin/HEAD."
 	exit 1
 else
-    url=http://$server/
-    if HEAD $HEADOPTS $url 2>&1 | grep -q 'Server: Apache' ; then
+    url=https://$server/
+    if HEAD $HEADOPTS $url 2>&1 | grep -q 'certificate verify' ; then
 	echo "success: $0: Apache is listening on '$url'."
     else
 	echo "error: $0: Apache is not listening on '$url'."
     fi
 
-    for url in "http://$server/munin/" "http://$server/sitesummary/" \
-	"http://$server/debian-edu-doc/" ; do
-	if HEAD $HEADOPTS $url 2>&1 | grep -q '200 OK' ; then
+    for url in "https://$server/munin/" "https://$server/sitesummary/" \
+	"https://$server/debian-edu-doc/" ; do
+	if HEAD $HEADOPTS $url 2>&1 | grep -q 'certificate verify' ; then
 	    echo "success: $0: URL '$url' is working."
 	else
 	    echo "error: $0: URL '$url' is not working."

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-config.git



More information about the debian-edu-commits mailing list