[rbldnsd] Disabling ipv6-specific tests

Michael Orlitzky michael at orlitzky.com
Tue Jul 30 03:04:56 MSK 2013


On 07/29/2013 04:48 PM, Jeff Dairiki wrote:
> 
> I don't think that's right.  (I haven't tested this, mind you, so I
> could be wrong...)  It should be possible to use (and test) the
> ip6trie (and ip6tset) datasets even with ipv6 disabled in {the kernel,
> python, and/or, rbldnsd} — it's just that if ipv6 is disabled, one
> must communicate with the rbldnsd over ip4.
> 
> I think only two tests — 'test_refuse_ipv6' and 'test_pass_ipv6' in
> test_acl.py — should require ipv6.
> 
> Some of the other tests may currently fail when ipv6 is missing.  If
> that is the case, the tests should be fixed so that they run
> correctly.  Send me the output of a test run (complete with python
> stack traces) and I'll see if I can fix things to be less sensitive to
> ipv6 support.

You're right, see below.


>>   3. Use '127.0.0.1' instead of 'localhost' in test_ip4trie.py, in case
>>      the host has ipv6 but rbldnsd/python do not.
> 
> I either don't agree (or don't understand) this point.   The only place
> the string "localhost" appears in test_ip4trie.py is as the value of a
> TXT RR.  (It doesn't appear as a hostname, and doesn't get resolved to
> an IP address.)
> 
> It is the "localhost" which is the default value for the `daemon_addr`
> argument of Rbldnsd.__init__() in rbldnsd.py which may need some attention.
> I am not sure that I'm totally convinced of this either, however.
> 

Right, that's where I had to change it. On my machine (with
kernel/python ipv6 support), 'localhost' was causing.. problems.

In fact, it looks like most of the other tests that I thought were
failing for lack of ipv6 can be fixed by changing the default
daemon_addr to '127.0.0.1'. If I comment out 'test_refuse_ipv6' and
'test_pass_ipv6' as you suggested, I get 28 tests passed without ipv6
support in rbldnsd:

  $ ./configure --disable-ipv6 && make && make check
  ...
  =============================================================
  Running btrie.test
  ......................
  OK
  =============================================================
  Running tests.py
  ............................
  ----------------------------------------------------------------------
  Ran 28 tests in 6.641s

  OK


If I *also* disable python ipv6 support, we get one more failing test:


  ERROR: test_exclusion (test_ip6trie.TestIp6TrieDataset)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/mjo/src/rbldnsd/test_ip6trie.py", line 31, in
    test_exclusion
      self.assertEqual(dnsd.query(rfc3152("dead::beef")), None)
    File "/home/mjo/src/rbldnsd/test_ip6trie.py", line 22, in rfc3152
      bytes = unpack("16B", inet_pton(AF_INET6, ip6addr))
  error: can't use AF_INET6, IPv6 is disabled


So, most of the trouble can be fixed (at most three tests decorated) if
we can figure out why 'localhost' causes problems. I'm not sure what's
happening, but here's the underlying weirdness. The 'localhost' works
fine when ipv6 is enabled in rbldnsd:

  $ ./configure && make
  ...
  $ ./rbldnsd -n -b localhost/5300 \
      rbl.example1.com:ip4set:/var/db/rbldnsd/example2
  rbldnsd: listening on ::1/5300
  rbldnsd: listening on 127.0.0.1/5300
  rbldnsd: file /var/db/rbldnsd/example2(23): invalid address
  rbldnsd: ip4set:/var/db/rbldnsd/example2: 20130701 224432: e32/24
  /16/8=2/0/2/0
  rbldnsd: zones reloaded, time 0.0e/0.0u sec, mem arena=288 free=130
  mmap=0 Kb
  rbldnsd: rbldnsd version 0.997a (23 Jul 2013) started (2 socket(s), 1
  zone(s))

If we disable ipv6 in rbldnsd, however,

  $ ./configure --disable-ipv6 && make
  ...
  $ ./rbldnsd -n -b localhost/5300 \
      rbl.example1.com:ip4set:/var/db/rbldnsd/example2
  rbldnsd: listening on 127.0.0.1/5300
  rbldnsd: unable to bind to 127.0.0.1/5300: Address already in use

Pretty weird, but it gets weirder. Even though it looks like '127.0.0.1'
was used above, if I replace 'localhost' with '127.0.0.1', it works:

  $ ./rbldnsd -n -b 127.0.0.1/5300 \
      rbl.example1.com:ip4set:/var/db/rbldnsd/example2
  rbldnsd: listening on 127.0.0.1/5300
  rbldnsd: file /var/db/rbldnsd/example2(23): invalid address
  rbldnsd: ip4set:/var/db/rbldnsd/example2: 20130701 224432: e32/24
  /16/8=2/0/2/0
  rbldnsd: zones reloaded, time 0.0e/0.0u sec, mem arena=293 free=132
  mmap=0 Kb
  rbldnsd: rbldnsd version 0.997a (23 Jul 2013) started (1 socket(s), 1
  zone(s))


So there's something funny going on.



More information about the rbldnsd mailing list