innconf test

Heiko Schlichting inn-workers at fu-berlin.de
Sun Jan 31 18:08:31 UTC 2010


There are two problems with innconf test:

1. It will fail it hostname does not contain a domain and DNS lookup also
   does not contain a dot (e.g. host defined in /etc/hosts just with name):

	hostname does not resolve or domain not set in inn.conf
    and
	string variable fromhost differs: NULL != ech
	("ech" is the hostname)

   Of course, inn needs a FQDN to operate but this could be defined in
   inn.conf ("domain"). Therefore the innconf test should not fail with
   inn.conf of samples directory. Maybe it would be better to provide
   one or more special inn.conf variants for running tests and not use the
   one generated in samples directory.

   (The attached patch does NOT fix this problem at all.)

2. Regular expression in egrep should only match at the beginning of lines

   Otherwise "./configure --prefix=/opt/portable" will fail on test 8
   because additional lines matches "port".

   Without the patch test 8 also depend on comment lines which is somewhat
   ugly too.

The attached patch does fix only problem 2.

Heiko

Heiko Schlichting          Freie Universität Berlin
heiko at CIS.FU-Berlin.DE     Zentraleinrichtung für Datenverarbeitung (ZEDAT)
Telefon +49 30 838-54327   Fabeckstraße 32
Telefax +49 30 838454327   14195 Berlin
-------------- next part --------------
commit dcd0efe7f49c8f2d508e47fae9b4577ab438b9b1
Author: Heiko Schlichting <heiko at fu-berlin.de>
Date:   Sat Jan 30 21:52:00 2010 +0100

    Regular expression should only match at the beginning of the line
    
    Otherwise "./configure --prefix=/opt/portable" will fail on test 8
    because additional lines matches "port".
    
    Test 8 has to be adjusted to not count and depend on comment lines.

diff --git a/tests/lib/innconf-t.c b/tests/lib/innconf-t.c
index e1acffe..493fef0 100644
--- a/tests/lib/innconf-t.c
+++ b/tests/lib/innconf-t.c
@@ -10,7 +10,7 @@
 
 /* We will have strings, integers, bools and lists. */
 static const char grep[] =
-"egrep 'mta|organization|ovmethod|hismethod|path|port|overview|pgpverify'\
+"egrep '^(mta|organization|ovmethod|hismethod|path|port|overview|pgpverify)'\
  ../../samples/inn.conf > config/tmp";
 
 int
@@ -56,7 +56,7 @@ main(void)
     fclose(config);
     ok(7, !innconf_check("config/tmp"));
     unlink("config/tmp");
-    ok_string(8, "config/tmp:37: unknown parameter foo\n", errors);
+    ok_string(8, "config/tmp:24: unknown parameter foo\n", errors);
     errors_uncapture();
     free(errors);
     errors = NULL;


More information about the inn-workers mailing list