OSU-Net/cyder — pull request #668 by drkitty (2014-04-02 18:34:34+00:00)
Title: Assorted DNS tests

### Tests written (or verified to exist):

#659 (PTR):

- [ ] Validate IP (reverse domain) is in range/network allowed in current container.
- [ ] Don't validate that the target exists or that the Container has permissions for use of the target domain. Make sure target is not an IPv4/6 address.
- [ ] Don't allow if IP is already in use on a static interface – even if DNS is disabled!
- [ ] Don't allow if another pointer with the same IP exists (round-robin setups are not allowed)
- [ ] Don't allow if IP in dynamic range.
- ~~Optional: Allow partial completion of IP address by selecting a reverse domain from a list~~

#660 (AddressRecord):

- [ ] Validate name uses domain allowed in current container.
- [ ] If name already exists in a different container don't allow it to be created again.
- ~~If name exists in the current container, notify user existing A exists, allow them to ignore if they're attempting to create a round-robin. Give user option to see existing matching object(s). Include objects with DNS disabled!~~
- [ ] Don't allow if the name already exists as a CNAME.
- [ ] Backend version: Allow ARs with the same name iff they have the same container.
- [ ] Allow ARs to share a name with a static interface iff they have the same container.
- [ ] Validate target syntax – must be an IPv4/6 address.
- [ ] Don't validate target IP is in any specific range/network we control.

#661 (CNAME):

- [ ] Validate domain is allowed in this container
- [ ] If name already exists in another container don't allow it to be created again in different container.
- ~~If name already exists in the current container, notify user existing CName exists, allow them to ignore if they're attempting to create a round-robin. Give user option to see existing matching object(s). Include objects with DNS disabled!~~
- [ ] Backend version: Allow CNAMEs with the same name iff they share the same container.
- [ ] (???) Don’t allow if name already exists as an A, MX or SOA – CName cannot be at the same level as these record types. Give user option to see existing matching object(s). Include objects with DNS disabled!
- [ ] Do not verify that the domain/fqdn of the target is in Cyder or that it exists. Only validate that it is a valid hostname and is not an IPv4/6 address.
- [ ] Just to be clear, a CNAME is not allowed to share a source name with a static interface.
- ~~Optional: Implement support for short names (the target is assumed to be a fqdn in a few places so this might cause problems)~~

#662 (generic DNS stuff (MX, SRV, SSHFP, TXT)):

- [ ] Validate name uses domain allowed in current container.
- [ ] Name should be unique for MX, SRV, and SSHFP records.
- [ ] Duplicate TXT records are okay.
- [ ] Don't allow MX record if the name already exists as a CNAME. (SRV, SSHFP, and TXT are okay)

#664 (SOA, NS, and Domain):

- [ ] \(???) SOAs can only be created/edited by cyder admins or above
- [ ] \(???) Domains can only be created/edited by cyder admins or above
- [ ] \(???) NS records can only be created/edited by cyder admins or above