]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Adapt the regression test to allow absense of deviceName etc.
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 20 Oct 2020 12:11:31 +0000 (14:11 +0200)
committerOtto Moerbeek <otto@drijf.net>
Tue, 10 Nov 2020 08:17:13 +0000 (09:17 +0100)
Checked with Wojas that this should be allowed. No use including fields that
have as value the empty string.

regression-tests.recursor-dnssec/test_Protobuf.py

index b4ecc610c5130637ae70915e1717a1d8e6051347..e72d7a0c50a583a28c3d7938a5d26416150ca83a 100644 (file)
@@ -237,9 +237,10 @@ class TestRecursorProtobuf(RecursorTest):
         self.assertEquals(msg.response.rcode, 65536)
 
     def checkProtobufIdentity(self, msg, requestorId, deviceId, deviceName):
-        self.assertTrue(msg.HasField('requestorId'))
-        self.assertTrue(msg.HasField('deviceId'))
-        self.assertTrue(msg.HasField('deviceName'))
+        print(msg)
+        self.assertTrue((requestorId == '') == (not msg.HasField('requestorId')))
+        self.assertTrue((deviceId == '') == (not msg.HasField('deviceId')))
+        self.assertTrue((deviceName == '') == (not msg.HasField('deviceName')))
         self.assertEquals(msg.requestorId, requestorId)
         self.assertEquals(msg.deviceId, deviceId)
         self.assertEquals(msg.deviceName, deviceName)