]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs:
authorThorsten Kukuk <kukuk@thkukuk.de>
Thu, 27 Sep 2007 10:22:06 +0000 (10:22 +0000)
committerThorsten Kukuk <kukuk@thkukuk.de>
Thu, 27 Sep 2007 10:22:06 +0000 (10:22 +0000)
Purpose of commit: bugfix

Commit summary:
---------------

2007-09-27  Thorsten Kukuk  <kukuk@thkukuk.de>

        * xtests/run-xtests.sh: Add support to skip tests.
        * xtests/tst-pam_limits1.c: Skip test if RLIMIT_NICE is not
        defined.

ChangeLog
xtests/run-xtests.sh
xtests/tst-pam_limits1.c

index a83809c87b39a057f858736cf5d00693f6f89efb..2d82849f6c9139ba727ef24241849dc69ff45dbf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-27  Thorsten Kukuk  <kukuk@thkukuk.de>
+
+       * xtests/run-xtests.sh: Add support to skip tests.
+       * xtests/tst-pam_limits1.c: Skip test if RLIMIT_NICE is not
+       defined.
+
 2007-09-03  Steve Langasek  <vorlon@debian.org>
 
        * modules/pam_limits/pam_limits.c: remove a number of unnecessary
index 76daba221517f2b749bec9b376b62a9cf74872e2..24adf12190398e440a6323a5632d237c245273d7 100755 (executable)
@@ -13,6 +13,7 @@ XTESTS="$@"
 
 failed=0
 pass=0
+skiped=0
 all=0
 
 mkdir -p /etc/security
@@ -27,7 +28,11 @@ for testname in $XTESTS ; do
           else
            ./$testname > /dev/null
          fi
-         if test $? -ne 0 ; then
+          RETVAL=$?
+          if test $RETVAL -eq 77 ; then
+            echo "SKIP: $testname"
+            skiped=`expr $skiped + 1`
+         elif test $RETVAL -ne 0 ; then
            echo "FAIL: $testname"
            failed=`expr $failed + 1`
           else
@@ -42,11 +47,13 @@ mv /etc/security/limits.conf-pam-xtests /etc/security/limits.conf
 if test "$failed" -ne 0; then
          echo "==================="
          echo "$failed of $all tests failed"
+          echo "$skiped tests not run"
          echo "==================="
          exit 1
 else
          echo "=================="
-         echo "All $all tests passed"
+         echo "$all tests passed"
+         echo "$skiped tests not run"
          echo "=================="
 fi
 exit 0
index cf025d3dd40bfc1d53dacc6a6456795b64587656..ed3d3679c8c8c3a8c8576e907da36f096a4e085e 100644 (file)
@@ -98,6 +98,7 @@ main(int argc, char *argv[])
   if (argc > 1 && strcmp (argv[1], "-d") == 0)
     debug = 1;
 
+#ifdef RLIMIT_NICE
   retval = pam_start("tst-pam_limits1", user, &conv, &pamh);
   if (retval != PAM_SUCCESS)
     {
@@ -145,4 +146,10 @@ main(int argc, char *argv[])
       return 1;
     }
   return 0;
+#else
+  if (debug)
+    fprintf (stderr, "pam_limits1: RLIMIT_NICE does not exist)\n");
+
+  return 77;
+#endif
 }