Opened 8 years ago

Closed 8 years ago

#1757 closed defect (fixed)

Lettuce failing with wrong number of additionals

Reported by: vorner Owned by: UnAssigned
Priority: medium Milestone: Sprint-20120417
Component: b10-auth Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 1 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

The lettuce tests fail for me, this is what looks like the relevant output:

Given I have bind10 running with configuration example.org.config                              # features/terrain/bind10_control.py:98
    A query for www.example.com should have rcode REFUSED                                          # features/terrain/querying.py:204
    A query for www.example.org should have rcode NOERROR                                          # features/terrain/querying.py:204
    A query for www.example.org should have rcode NOERROR                                          # features/terrain/querying.py:204
    The last query response should have qdcount 1                                                  # features/terrain/querying.py:258
    The last query response should have ancount 1                                                  # features/terrain/querying.py:258
    The last query response should have nscount 3                                                  # features/terrain/querying.py:258
    The last query response should have adcount 0                                                  # features/terrain/querying.py:258
    Traceback (most recent call last):
      File "/home/vorner/.local/lib64/python2.7/site-packages/lettuce/core.py", line 117, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/home/vorner/work/bind10/tests/lettuce/features/terrain/querying.py", line 273, in check_last_query
        "Got: " + str(lq_val) + ", expected: " + str(value)
    AssertionError: Got: 1, expected: 0
    The answer section of the last query response should be                                        # features/terrain/querying.py:276
      | """                                               |
      | www.example.org.   3600    IN    A      192.0.2.1 |
      | """                                               |
    A query for example.org type NS should have rcode NOERROR                                      # features/terrain/querying.py:204
    The answer section of the last query response should be                                        # features/terrain/querying.py:276
      | """                                      |
      | example.org. 3600 IN NS ns1.example.org. |
      | example.org. 3600 IN NS ns2.example.org. |
      | example.org. 3600 IN NS ns3.example.org. |
      | """                                      |
    The SOA serial for example.org should be 1234                                                  # features/terrain/querying.py:238
    A query for doesnotexist.example.org should have rcode NXDOMAIN                                # features/terrain/querying.py:204
    The last query response should have qdcount 1                                                  # features/terrain/querying.py:258
    The last query response should have ancount 0                                                  # features/terrain/querying.py:258
    The last query response should have nscount 1                                                  # features/terrain/querying.py:258
    The last query response should have adcount 0                                                  # features/terrain/querying.py:258
    The last query response should have flags qr aa rd                                             # features/terrain/querying.py:258
    A query for www.example.org type TXT should have rcode NOERROR                                 # features/terrain/querying.py:204
    The last query response should have ancount 0                                                  # features/terrain/querying.py:258
    A query for www.example.org class CH should have rcode REFUSED                                 # features/terrain/querying.py:204
    A query for www.example.org to 127.0.0.1 should have rcode NOERROR                             # features/terrain/querying.py:204
    A query for www.example.org to 127.0.0.1:47806 should have rcode NOERROR                       # features/terrain/querying.py:204
    A query for www.example.org type A class IN to 127.0.0.1:47806 should have rcode NOERROR       # features/terrain/querying.py:204

When asking on jabber, others don't get the same problem.

Subtickets

Change History (9)

comment:1 Changed 8 years ago by shane

I'm wondering if this might be a version problem. What version of lettuce are you using, and also what version of Python?

comment:2 Changed 8 years ago by shane

  • Milestone New Tasks deleted

comment:3 Changed 8 years ago by vorner

  • Milestone set to Next-Sprint-Proposed

I'm getting this over and over again, now with these three tests:
features/example.feature:41
features/queries.feature:6
features/queries.feature:62

It's getting annoying (therefore proposing for the next sprint).

Also, when I switched the check for exact content and the count, the check for exact content passes ‒ so there's a problem with the test miscounting the results, not with bind10 itself (probably):

    The additional section of the last query response should be                                     # features/terrain/querying.py:277
      | """                                    |
      | ns1.example.org.	3600	IN	A	192.0.2.3   |
      | ns2.example.org.	3600	IN	A	192.0.2.4   |
      | mail.example.org.	3600	IN	A	192.0.2.10 |
      | """                                    |
    The last query response should have adcount 3                                                   # features/terrain/querying.py:258
    The last query response should have adcount 3                                                   # features/terrain/querying.py:258
    Traceback (most recent call last):
      File "/home/vorner/.local/lib64/python2.7/site-packages/lettuce/core.py", line 117, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/home/vorner/work/bind10/tests/lettuce/features/terrain/querying.py", line 274, in check_last_query
        "Got: " + str(lq_val) + ", expected: " + str(value)
    AssertionError: Got: 4, expected: 3

comment:4 Changed 8 years ago by vorner

It turned out the problem is my dig has EDNS turned on by default. Therefore it does count the EDNS pseudo RR to the count and strips it off the result, which creates the off-by-one error. The solution should be to disable it wyth +noedns.

comment:5 Changed 8 years ago by jelte

  • Milestone changed from Next-Sprint-Proposed to Sprint-20120417

comment:6 Changed 8 years ago by jelte

  • Owner set to UnAssigned
  • Status changed from new to reviewing

adding an explicit +noedns unless dnssec is set seems quite trivial (i don't think we have any scenarios right now where we need edns but not dnssec, if we do we can extend it then)

comment:7 Changed 8 years ago by jinmei

looks okay to me, but I think this should be reviewed/checked by someone who has
an environment where this workaround is really needed.

my dig doesn't do EDNS by default, so I cannot confirm if this really works as intended.

comment:8 Changed 8 years ago by vorner

I run it and it passes. I didn't pick it for review yet, as I have other tasks open now, so if you want to take it, go ahead.

comment:9 Changed 8 years ago by jelte

  • Resolution set to fixed
  • Status changed from reviewing to closed

(review confirmation on jabber)

merged, closing ticket

Note: See TracTickets for help on using tickets.