lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r2052 - in debian/nss-pam-ldapd/branches/experimental/debian: . tests

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r2052 - in debian/nss-pam-ldapd/branches/experimental/debian: . tests



Author: arthur
Date: Thu Oct 31 21:29:56 2013
New Revision: 2052
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=2052&view=revision

Log:
add DEP-8 autopkgtest end-to-end tests of installed packages running an LDAP 
server and performing NSS and PAM operations

Added:
   debian/nss-pam-ldapd/branches/experimental/debian/tests/
   debian/nss-pam-ldapd/branches/experimental/debian/tests/control
   debian/nss-pam-ldapd/branches/experimental/debian/tests/testsuite   
(contents, props changed)
Modified:
   debian/nss-pam-ldapd/branches/experimental/debian/changelog
   debian/nss-pam-ldapd/branches/experimental/debian/control

Modified: debian/nss-pam-ldapd/branches/experimental/debian/changelog
==============================================================================
--- debian/nss-pam-ldapd/branches/experimental/debian/changelog Thu Oct 31 
21:10:43 2013        (r2051)
+++ debian/nss-pam-ldapd/branches/experimental/debian/changelog Thu Oct 31 
21:29:56 2013        (r2052)
@@ -25,8 +25,10 @@
     - portability improvements in the test scripts and test environment
   * avoid prompting to restart services on initial install
   * upgrade to standards-version 3.9.5 (no changes needed)
+  * add DEP-8 autopkgtest end-to-end tests of installed packages running an
+    LDAP server and performing NSS and PAM operations
 
- -- Arthur de Jong <adejong@debian.org>  Thu, 31 Oct 2013 20:00:00 +0100
+ -- Arthur de Jong <adejong@debian.org>  Thu, 31 Oct 2013 21:00:00 +0100
 
 nss-pam-ldapd (0.9.1-2) experimental; urgency=low
 

Modified: debian/nss-pam-ldapd/branches/experimental/debian/control
==============================================================================
--- debian/nss-pam-ldapd/branches/experimental/debian/control   Thu Oct 31 
21:10:43 2013        (r2051)
+++ debian/nss-pam-ldapd/branches/experimental/debian/control   Thu Oct 31 
21:29:56 2013        (r2052)
@@ -10,6 +10,7 @@
 Homepage: http://arthurdejong.org/nss-pam-ldapd/
 Vcs-Svn: http://arthurdejong.org/svn/nss-pam-ldapd/debian/nss-pam-ldapd/trunk/
 Vcs-Browser: 
http://arthurdejong.org/viewvc/nss-pam-ldapd/debian/nss-pam-ldapd/trunk/
+XS-Testsuite: autopkgtest
 
 Package: nslcd
 Architecture: any

Added: debian/nss-pam-ldapd/branches/experimental/debian/tests/control
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ debian/nss-pam-ldapd/branches/experimental/debian/tests/control     Thu Oct 
31 21:29:56 2013        (r2052)
@@ -0,0 +1,7 @@
+Tests: testsuite
+Depends: nslcd, libnss-ldapd, libpam-ldapd, slapd, ldap-utils, expect
+Restrictions: needs-root
+
+Tests: testsuite
+Depends: pynslcd, libnss-ldapd, libpam-ldapd, slapd, ldap-utils, expect
+Restrictions: needs-root

Added: debian/nss-pam-ldapd/branches/experimental/debian/tests/testsuite
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ debian/nss-pam-ldapd/branches/experimental/debian/tests/testsuite   Thu Oct 
31 21:29:56 2013        (r2052)
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+# testsuite - run tests in our test environment
+#
+# Copyright (C) 2013 Arthur de Jong
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA
+
+set -e
+
+# get the script name
+script="`basename "$0"`"
+
+# redirect stderr to stdout to have readable logs
+exec 2>&1
+
+# stop any running daemons that might interfere
+echo "$script: stopping services..."
+service slapd stop || true
+service nslcd stop || true
+service pynslcd stop || true
+service nscd stop || true
+service unscd stop || true
+
+# Clean up on exit
+cleanup() {
+  echo "$script: cleaning up..."
+  service nslcd stop || true
+  service pynslcd stop || true
+  [ -n "$tmpslapd" ] && tests/setup_slapd.sh "$tmpslapd" clean
+  if [ -n "$bkdir" ]
+  then
+    cp -p "$bkdir"/nsswitch.conf /etc/nsswitch.conf
+    cp -p "$bkdir"/nslcd.conf  /etc/nslcd.conf
+    rm -rf "$bkdir"
+  fi
+}
+trap cleanup EXIT
+
+# make backup of some files
+echo "$script: making backup of old configuration..."
+bkdir=`mktemp -d -t backups.XXXXXX`
+cp -p /etc/nsswitch.conf "$bkdir"/
+cp -p /etc/nslcd.conf "$bkdir"/
+
+# configure nsswitch.conf
+echo "$script: configuring /etc/nsswitch.conf..."
+tests/testenv.sh nss_enable \
+  passwd group shadow hosts networks protocols services ethers rpc netgroup 
aliases
+
+# configure PAM?
+
+# configure and start slapd
+echo "$script: setting up test slapd..."
+tmpslapd=`mktemp -d -t slapd.XXXXXX`
+tests/setup_slapd.sh "$tmpslapd" setup
+tests/setup_slapd.sh "$tmpslapd" start
+
+# configure and start nslcd (or pynslcd)
+echo "$script: configure and start (py)nslcd..."
+cat tests/nslcd-test.conf > /etc/nslcd.conf
+if [ -x /usr/sbin/nslcd ] ; then service nslcd start; fi
+if [ -x /usr/sbin/pynslcd ] ; then service pynslcd start; fi
+
+# allow for a second to have nslcd up and running
+sleep 1
+
+# see if test environment is in order
+echo "$script: check test environment..."
+tests/testenv.sh check
+tests/testenv.sh check_nss \
+  passwd group shadow hosts networks protocols services ethers rpc netgroup 
aliases
+
+# run the NSS tests
+echo "$script: running NSS tests..."
+tests/test_nsscmds.sh
+
+# run the PAM tests
+echo "$script: running PAM tests..."
+tests/test_pamcmds.sh
+
+echo "$script: all tests passed!"
+exit 0
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/