'Verify that a response to a CNAME query has certain records in the
I{answer} section.
@param addresses: See C{_additionalTest}'

def _answerCNAMETest(self, addresses):

    target = ('www.' + soa_record.mname.name)
    d = self._lookupSomeRecords('lookupCanonicalName', soa_record, dns.Record_CNAME, target, addresses)
    (answer, authority, additional) = self.successResultOf(d)
    alias = dns.RRHeader(soa_record.mname.name, dns.CNAME, ttl=soa_record.expire, payload=dns.Record_CNAME(target), auth=True)
    self.assertRecordsMatch(([dns.RRHeader(target, address.TYPE, ttl=soa_record.expire, payload=address, auth=True) for address in addresses] + [alias]), answer)
