Skip to content

Commit

Permalink
feat(e2e): add test routine for checking RRsets in the DNS
Browse files Browse the repository at this point in the history
  • Loading branch information
peterthomassen committed Apr 11, 2018
1 parent 88d4c76 commit 9dba795
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/e2e/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,21 @@ chakram.addMethod("ttl", function (respObj, expected) {
});

exports.chakram = chakram;

/**
* A test that checks DNS record contents
*/
function itShowsUpInPdnsAs(subname, domain, type, records, ttl) {
var queryName = (subname ? subname + '.' : '') + domain;
return it('shows up correctly in pdns for ' + subname + '|' + domain + '|' + type, function () {
chakram.expect(chakram.resolveStr(queryName, type)).to.have.lengthOf(records.length);
chakram.expect(chakram.resolveStr(queryName, type)).to.have.members(records);
chakram.expect(chakram.resolveStr(queryName, type)).to.have.members(records.reverse());
if (typeof ttl !== "undefined") {
chakram.expect(chakram.resolve(queryName, type)).to.have.dns.ttl(ttl);
}
return chakram.wait();
});
}

exports.itShowsUpInPdnsAs = itShowsUpInPdnsAs;

0 comments on commit 9dba795

Please sign in to comment.