Fix unit tests to allow for fixed IPSECKEY

This commit is contained in:
Willem Toorop 2017-05-02 12:14:20 +02:00
parent dbc1719206
commit 2a6c4b35cb
3 changed files with 16 additions and 4 deletions

View File

@ -70,6 +70,7 @@ int main(int argc, char const * const argv[])
FILE *in; FILE *in;
uint8_t wire_buf[8200]; uint8_t wire_buf[8200];
size_t i; size_t i;
size_t uavailable;
int available; int available;
char str_buf[10000]; char str_buf[10000];
int str_len = sizeof(str_buf); int str_len = sizeof(str_buf);
@ -300,15 +301,20 @@ int main(int argc, char const * const argv[])
* Then fill a string buffer with those rr_dicts. * Then fill a string buffer with those rr_dicts.
*/ */
available = wire - wire_buf; available = wire - wire_buf;
if (available < 0) {
fprintf(stderr, "Negative sized buffer!\n");
exit(EXIT_FAILURE);
}
uavailable = available;
wire = wire_buf; wire = wire_buf;
str = str_buf; str = str_buf;
str_len = sizeof(str_buf); str_len = sizeof(str_buf);
while (available > 0 && str_len > 0) { while (uavailable > 0 && str_len > 0) {
rr_dict = NULL; rr_dict = NULL;
if ((r = getdns_wire2rr_dict_scan( if ((r = getdns_wire2rr_dict_scan(
(const uint8_t **)&wire, &available, &rr_dict))) (const uint8_t **)&wire, &uavailable, &rr_dict)))
FAIL_r("getdns_wire2rr_dict_scan"); FAIL_r("getdns_wire2rr_dict_scan");
if ((r = getdns_rr_dict2str_scan(rr_dict, &str, &str_len))) if ((r = getdns_rr_dict2str_scan(rr_dict, &str, &str_len)))

View File

@ -1478,6 +1478,7 @@ apl.net-dns.org. 3600 IN APL 1:192.168.42.0/26 1:192.168.42.64/26 !1:192.168.42.
"algorithm": 10, "algorithm": 10,
"gateway_type": 0, "gateway_type": 0,
"precedence": 2, "precedence": 2,
"public_key": <bindata of 0x010351537986ed35533b6064478eeeb2...>,
"rdata_raw": <bindata of 0x0a0002010351537986ed35533b606447...> "rdata_raw": <bindata of 0x0a0002010351537986ed35533b606447...>
}, },
"ttl": 30, "ttl": 30,
@ -1536,6 +1537,7 @@ apl.net-dns.org. 3600 IN APL 1:192.168.42.0/26 1:192.168.42.64/26 !1:192.168.42.
"algorithm": 10, "algorithm": 10,
"gateway_type": 0, "gateway_type": 0,
"precedence": 2, "precedence": 2,
"public_key": <bindata of 0x010351537986ed35533b6064478eeeb2...>,
"rdata_raw": <bindata of 0x0a0002010351537986ed35533b606447...> "rdata_raw": <bindata of 0x0a0002010351537986ed35533b606447...>
}, },
"ttl": 30, "ttl": 30,

View File

@ -395,6 +395,7 @@
"algorithm": 10, "algorithm": 10,
"gateway_type": 0, "gateway_type": 0,
"precedence": 2, "precedence": 2,
"public_key": <bindata of 0x010351537986ed35533b6064478eeeb2...>,
"rdata_raw": <bindata of 0x0a0002010351537986ed35533b606447...> "rdata_raw": <bindata of 0x0a0002010351537986ed35533b606447...>
}, },
"ttl": 30, "ttl": 30,
@ -453,6 +454,7 @@
"algorithm": 10, "algorithm": 10,
"gateway_type": 0, "gateway_type": 0,
"precedence": 2, "precedence": 2,
"public_key": <bindata of 0x010351537986ed35533b6064478eeeb2...>,
"rdata_raw": <bindata of 0x0a0002010351537986ed35533b606447...> "rdata_raw": <bindata of 0x0a0002010351537986ed35533b606447...>
}, },
"ttl": 30, "ttl": 30,
@ -1000,7 +1002,7 @@
} }
] ]
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 0 ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 0
;; flags: ; QUERY: 0, ANSWER: 75, AUTHORITY: 0, ADDITIONAL: 0 ;; flags: ; QUERY: 0, ANSWER: 77, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION: ;; QUESTION SECTION:
;; ANSWER SECTION: ;; ANSWER SECTION:
@ -1033,9 +1035,11 @@ eui64.net-dns.org. 30 IN EUI64 00-00-5e-ef-10-00-00-2a
gpos.net-dns.org. 30 IN GPOS "-32.6882" "116.8652" "10.0" gpos.net-dns.org. 30 IN GPOS "-32.6882" "116.8652" "10.0"
hinfo.net-dns.org. 30 IN HINFO "CPU" "OS" hinfo.net-dns.org. 30 IN HINFO "CPU" "OS"
hip.net-dns.org. 30 IN HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D hip.net-dns.org. 30 IN HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D
ipseckey0.net-dns.org. 30 IN IPSECKEY 10 0 2 . AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
ipseckey1.net-dns.org. 30 IN IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== ipseckey1.net-dns.org. 30 IN IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
ipseckey2.net-dns.org. 30 IN IPSECKEY 10 2 2 2001:db8:0:8002::2000:1 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== ipseckey2.net-dns.org. 30 IN IPSECKEY 10 2 2 2001:db8:0:8002::2000:1 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
ipseckey3.net-dns.org. 30 IN IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== ipseckey3.net-dns.org. 30 IN IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
ipseckey.net-dns.org. 30 IN IPSECKEY 10 0 2 . AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
ipseckey.net-dns.org. 30 IN IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== ipseckey.net-dns.org. 30 IN IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
ipseckey.net-dns.org. 30 IN IPSECKEY 10 2 2 2001:db8:0:8002::2000:1 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== ipseckey.net-dns.org. 30 IN IPSECKEY 10 2 2 2001:db8:0:8002::2000:1 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
ipseckey.net-dns.org. 30 IN IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== ipseckey.net-dns.org. 30 IN IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
@ -1083,5 +1087,5 @@ x25.net-dns.org. 30 IN X25 "1234567"
;; AUTHORITY SECTION: ;; AUTHORITY SECTION:
;; ADDITIONAL SECTION: ;; ADDITIONAL SECTION:
;; MSG SIZE rcvd: 5189 ;; MSG SIZE rcvd: 5328