Skip to content
  • Matthijs Mekking's avatar
    Fix race in autosign test · 2e4273b5
    Matthijs Mekking authored
    The autosign test has a test case where a DNSSEC maintaiend zone
    has a set of DNSSEC keys without any timing metadata set.  It
    tests if named picks up the key for publication and signing if a
    delayed dnssec-settime/loadkeys event has occured.
    
    The test failed intermittently despite the fact it sleeps for 5
    seconds but the triggered key reconfigure action should happen after
    3 seconds.
    
    However, the test output showed that the test query came in before
    the key reconfigure action was complete (see excerpts below).
    
    The loadkeys command is received:
    
    15:38:36 received control channel command 'loadkeys delay.example.'
    
    The reconfiguring zone keys action is triggered after 3 seconds:
    
    15:38:39 zone delay.example/IN: reconfiguring zone keys
    15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7484 (ZSK) is now published
    15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7455 (KSK) is now published
    15:38:39 writing to journal
    
    Two seconds later the test query comes in:
    
    15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: query
    15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: endrequest
    
    And 6 more seconds later the reconfigure keys action is complete:
    
    15:38:47 zone delay.example/IN: next key event: 05-Dec-2019 15:48:39
    
    This commit fixes the test by checking the "next key event" log has
    been seen before executing the test query, making sure that the
    reconfigure keys action has been complete.
    
    This commit however does not fix, nor explain why it took such a long
    time (8 seconds) to reconfigure the keys.
    2e4273b5