INN commit: branches/2.5 (6 files)

INN Commit rra at isc.org
Wed Jan 16 21:57:16 UTC 2013


    Date: Wednesday, January 16, 2013 @ 13:57:16
  Author: iulius
Revision: 9458

test suite:  remove a useless wrapped test for setenv

Remove a test that makes the test suite fail on a few systems.
The code it is testing is obvious whereas getting the amount of
memory and the data size limits right is extremely difficult
in all cases.  Besides, this test does not serve much purpose
and is not present in rra-c-util 4.7.

Modified:
  branches/2.5/MANIFEST
  branches/2.5/support/mkmanifest
  branches/2.5/tests/Makefile
  branches/2.5/tests/lib/	(properties)
  branches/2.5/tests/lib/setenv-t.c
Deleted:
  branches/2.5/tests/lib/setenv.t

----------------------+
 MANIFEST             |    1 -
 support/mkmanifest   |    2 +-
 tests/Makefile       |    6 +++---
 tests/lib/setenv-t.c |   22 +---------------------
 tests/lib/setenv.t   |   17 -----------------
 5 files changed, 5 insertions(+), 43 deletions(-)

Modified: MANIFEST
===================================================================
--- MANIFEST	2013-01-16 21:54:43 UTC (rev 9457)
+++ MANIFEST	2013-01-16 21:57:16 UTC (rev 9458)
@@ -882,7 +882,6 @@
 tests/lib/pwrite-t.c                  Tests for lib/pwrite.c
 tests/lib/qio-t.c                     Tests for lib/qio.c
 tests/lib/setenv-t.c                  Tests for lib/setenv.c
-tests/lib/setenv.t                    Wrapper for setenv tests
 tests/lib/snprintf-t.c                Tests for lib/snprintf.c
 tests/lib/strlcat-t.c                 Tests for lib/strlcat.c
 tests/lib/strlcpy-t.c                 Tests for lib/strlcpy.c

Modified: support/mkmanifest
===================================================================
--- support/mkmanifest	2013-01-16 21:54:43 UTC (rev 9457)
+++ support/mkmanifest	2013-01-16 21:57:16 UTC (rev 9458)
@@ -285,7 +285,7 @@
 tests/lib/pread.t
 tests/lib/pwrite.t
 tests/lib/qio.t
-tests/lib/setenv.tr
+tests/lib/setenv.t
 tests/lib/snprintf.t
 tests/lib/strlcat.t
 tests/lib/strlcpy.t

Modified: tests/Makefile
===================================================================
--- tests/Makefile	2013-01-16 21:54:43 UTC (rev 9457)
+++ tests/Makefile	2013-01-16 21:57:16 UTC (rev 9458)
@@ -17,14 +17,14 @@
 	lib/hashtab.t lib/hex.t lib/hstrerror.t lib/inet_aton.t \
 	lib/inet_ntoa.t lib/inet_ntop.t lib/innconf.t lib/list.t lib/md5.t \
 	lib/memcmp.t lib/messages.t lib/mkstemp.t lib/network.t lib/pread.t \
-	lib/pwrite.t lib/qio.t lib/snprintf.t lib/strlcat.t \
+	lib/pwrite.t lib/qio.t lib/setenv.t lib/snprintf.t lib/strlcat.t \
 	lib/strlcpy.t lib/tst.t lib/uwildmat.t lib/vector.t lib/wire.t \
 	lib/xwrite.t nnrpd/auth-ext.t overview/api.t overview/buffindexed.t \
 	overview/tradindexed.t overview/xref.t util/innbind.t
 
 ##  Extra stuff that needs to be built before tests can be run.
 
-EXTRA	= runtests clients/server-list lib/setenv.tr lib/xmalloc
+EXTRA	= runtests clients/server-list lib/xmalloc
 
 all check test tests: $(TESTS) $(EXTRA)
 	./runtests TESTS
@@ -198,7 +198,7 @@
 lib/setenv.o: ../lib/setenv.c
 	$(CC) $(CFLAGS) -DTESTING -c -o $@ ../lib/setenv.c
 
-lib/setenv.tr: lib/setenv.o lib/setenv-t.o libtest.o $(LIBINN)
+lib/setenv.t: lib/setenv.o lib/setenv-t.o libtest.o $(LIBINN)
 	$(LINK) lib/setenv.o lib/setenv-t.o libtest.o $(LIBINN)
 
 lib/snprintf.o: ../lib/snprintf.c


Property changes on: branches/2.5/tests/lib
___________________________________________________________________
Modified: svn:ignore
   - .libs
.pure
asprintf.t
buffer.t
concat.t
conffile.t
confparse.t
date.t
dispatch.t
getaddrinfo.t
getnameinfo.t
hash.t
hashtab.t
hex.t
hstrerror.t
inet_aton.t
inet_ntoa.t
inet_ntop.t
innconf.t
list.t
md5.t
memcmp.t
messages.t
mkstemp.t
network.t
pread.t
pwrite.t
qio.t
setenv.tr
snprintf.t
strlcat.t
strlcpy.t
tst.t
uwildmat.t
vector.t
wire.t
xmalloc
xwrite.t

   + .libs
.pure
asprintf.t
buffer.t
concat.t
conffile.t
confparse.t
date.t
dispatch.t
getaddrinfo.t
getnameinfo.t
hash.t
hashtab.t
hex.t
hstrerror.t
inet_aton.t
inet_ntoa.t
inet_ntop.t
innconf.t
list.t
md5.t
memcmp.t
messages.t
mkstemp.t
network.t
pread.t
pwrite.t
qio.t
setenv.t
snprintf.t
strlcat.t
strlcpy.t
tst.t
uwildmat.t
vector.t
wire.t
xmalloc
xwrite.t


Modified: tests/lib/setenv-t.c
===================================================================
--- tests/lib/setenv-t.c	2013-01-16 21:54:43 UTC (rev 9457)
+++ tests/lib/setenv-t.c	2013-01-16 21:57:16 UTC (rev 9458)
@@ -18,13 +18,10 @@
 int
 main(void)
 {
-    char *value;
-    int status;
-
     if (getenv(test_var))
         die("%s already in the environment!", test_var);
 
-    test_init(12);
+    test_init(8);
 
     ok(1, test_setenv(test_var, test_value1, 0) == 0);
     ok_string(2, test_value1, getenv(test_var));
@@ -35,22 +32,5 @@
     ok(7, test_setenv(test_var, "", 1) == 0);
     ok_string(8, "", getenv(test_var));
 
-    /* We're run by a shell script wrapper that sets resource limits such
-       that we can allocate one string of this size but not two.  Note that
-       Linux doesn't support data limits, so skip if we get an unexpected
-       success here. */
-    value = xmalloc(100 * 1024);
-    memset(value, 'A', 100 * 1024 - 1);
-    value[100 * 1024 - 1] = 0;
-    ok(9, test_setenv(test_var, value, 0) == 0);
-    ok_string(10, "", getenv(test_var));
-    status = test_setenv(test_var, value, 1);
-    if (status == 0) {
-        skip_block(11, 2, "no data limit support");
-    } else {
-        ok(11, (status == -1) && (errno == ENOMEM));
-        ok_string(12, "", getenv(test_var));
-    }
-
     return 0;
 }

Deleted: tests/lib/setenv.t
===================================================================
--- tests/lib/setenv.t	2013-01-16 21:54:43 UTC (rev 9457)
+++ tests/lib/setenv.t	2013-01-16 21:57:16 UTC (rev 9458)
@@ -1,17 +0,0 @@
-#! /bin/sh
-# $Id$
-#
-# Wrapper around the setenv test suite to set a resource limit low enough
-# that two strings over 100KB can't both be allocated, allowing the memory
-# allocation failure code in setenv to be exercised.  Done with this
-# wrapper because ulimit is more easily portable than the corresponding C
-# code.
-
-# Find where the test suite is.
-setenv=setenv.tr
-for file in ./setenv.tr lib/setenv.tr tests/lib/setenv.tr ; do
-    [ -x $file ] && setenv=$file
-done
-
-ulimit -d 150
-exec $setenv



More information about the inn-committers mailing list