[netfilter-cvslog] r4326 - in trunk: nfsim nfsim-testsuite

rusty at netfilter.org rusty at netfilter.org
Sat Oct 8 17:12:44 CEST 2005


Author: rusty at netfilter.org
Date: 2005-10-08 17:12:39 +0200 (Sat, 08 Oct 2005)
New Revision: 4326

Modified:
   trunk/nfsim-testsuite/test-kernel-source
   trunk/nfsim/Makefile.in
   trunk/nfsim/configure
Log:
Fix caching for different nfsim kernel verions.
Move source-listing to configure script (Makefile only exists after configure)


Modified: trunk/nfsim/Makefile.in
===================================================================
--- trunk/nfsim/Makefile.in	2005-10-07 22:46:50 UTC (rev 4325)
+++ trunk/nfsim/Makefile.in	2005-10-08 15:12:39 UTC (rev 4326)
@@ -45,10 +45,6 @@
 	$(CC) $(GCOVFLAGS) $(CFLAGS) $(LDFLAGS) -rdynamic -o $@ \
 		-ldl -lreadline -lcurses $(HELP_OBJS) $(OBJS) $(USAGE)
 
-source-list:
-	@find core kernelenv tools -type l -o -name 'generated_*' -o -wholename core/config.h -o -name '*.[ch]' -print
-	@echo netfilter/dummy.c
-
 kernelenv/include/linux/config.h: .config
 	sed -ne 's/^\([A-Z0-9_]*\)=\(.*\)$$/#define \1 \2/p' < $< > $@
 

Modified: trunk/nfsim/configure
===================================================================
--- trunk/nfsim/configure	2005-10-07 22:46:50 UTC (rev 4325)
+++ trunk/nfsim/configure	2005-10-08 15:12:39 UTC (rev 4326)
@@ -29,6 +29,11 @@
 	--bindir=*) BINDIR=$(echo "$arg" | cut -d= -f2-)/;;
 	--libdir=*) LIBDIR=$(echo "$arg" | cut -d= -f2-)/;;
 	--basedir=*) BASEDIR=$(echo "$arg" | cut -d= -f2-)/;;
+	--list-sources)
+	    find core kernelenv tools -type l -o -name 'generated_*' -o -wholename core/config.h -o -wholename kernelenv/include/linux/config.h -o -name '*.[ch]' -print
+	    echo netfilter/dummy.c
+	    exit 0
+	    ;;
 	*)
 	    barf "Usage: ./configure [--gcov] [--prefix=<dir>] --kerneldir=<DIR>"
 	    ;;

Modified: trunk/nfsim-testsuite/test-kernel-source
===================================================================
--- trunk/nfsim-testsuite/test-kernel-source	2005-10-07 22:46:50 UTC (rev 4325)
+++ trunk/nfsim-testsuite/test-kernel-source	2005-10-08 15:12:39 UTC (rev 4326)
@@ -12,13 +12,17 @@
     make distclean >/dev/null 2>&1
     ./configure $GCOV_OPTION --kerneldir=$1 || return 1
     make --quiet || return 1
+    rm -f $2
+    mkdir $2
     cp simulator $2
+    cp core/fakesockopt.so.1.0 $2
+    cp `find . -name *.so` $2
 }
 
 # Simple check of cached nfsim: if any source file in nfsim newer, rebuild.
 recent()
 {
-    if [ -n "`find ../nfsim -path netfilter -prune -o -name config.h -o -type f -name '*.[ch]' -newer $1 -print`" ]; then
+    if [ -n "$(cd ../nfsim; find $(./configure --list-sources) -newer $1 -print)" ]; then
 	rm $1
 	return 1
     fi
@@ -65,17 +69,11 @@
     *) KERNELDIR=`pwd`/$KERNELDIR;;
 esac
 
-# Make sure iptables can find the fake sockopt library.
-LD_LIBRARY_PATH=../nfsim:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH
-NFSIM_MODPATH=../nfsim/netfilter/ipv4
-export NFSIM_MODPATH
+# Clean cached nfsims which are more than one month old, or files (now directoris)
+find . -name '.nfsim*' \( -mtime +30 -o ! -type d \) -exec rm -r {} \;
 
-# Clean cached nfsims which are more than one month old.
-find . -name '.nfsim*' -mtime +30 -exec rm {} \;
-
 NFSIM=$(pwd)/.nfsim-$(kernel_signature $KERNELDIR)
-if [ -f $NFSIM ] && recent $NFSIM; then
+if [ -d $NFSIM ] && recent $NFSIM; then
     echo Using cached nfsim...
     (cd ../nfsim && make --quiet gcov-clean)
 else
@@ -83,14 +81,20 @@
     (build_nfsim $KERNELDIR $NFSIM) >/dev/null || barf Failed to build nfsim for $1
 fi
 
+# Make sure iptables can find the fake sockopt library.
+LD_LIBRARY_PATH=$NFSIM:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH
+NFSIM_MODPATH=$NFSIM
+export NFSIM_MODPATH
+
 # Work around 2.6.9/2.6.10 proc bug.
-if [ "`$NFSIM -q < /dev/null 2>&1`" = "FATAL: Cannot find entry 'ip_conntrack_stat' under net to remove" ]; then
+if [ "`$NFSIM/simulator -q < /dev/null 2>&1`" = "FATAL: Cannot find entry 'ip_conntrack_stat' under net to remove" ]; then
     echo This nfsim built using kernel with proc issues: ignoring.
     EXTRA_ARGS="--ignore-proc-issues $EXTRA_ARGS"
 fi
 
 # 2.6 kernels before 2.6.10 sucked with nonlinear packets, lots of bugs.
-KVERSION=`echo version kernel | $NFSIM -q --no-modules | sed 's/-.*//'`
+KVERSION=`echo version kernel | $NFSIM/simulator -q --no-modules | sed 's/-.*//'`
 case $KVERSION in
     2.6.?) EXTRA_ARGS="--linear-packets $EXTRA_ARGS";;
 esac
@@ -103,7 +107,7 @@
 fi
 
 echo Running tests...
-./test.sh $EXTRA_ARGS --nfsim=$NFSIM $TEST || barf Tests failed for $1
+./test.sh $EXTRA_ARGS --nfsim=$NFSIM/simulator $TEST || barf Tests failed for $1
 
 if [ -n "$GCOV_OPTION" ]; then
     echo "Generating gcov results..."




More information about the netfilter-cvslog mailing list