Example #1
0
def test_dns_name_not_resolved():
    """Test dns name not resolved"""

    results = scan(DNS_SERVER, "joegatt.com", 443)

    # Check the output to ensure the DNS name could not resolve
    assert results["Results"] == ["joegatt.com exists but no A record."]
Example #2
0
def test_external_dns_name_not_exist():
    """Test NXDOMAIN"""

    results = scan(DNS_SERVER, "jeogatt.com", 443)

    # Check the output to ensure the DNS name could not resolve
    assert results["Results"] == ["The DNS name jeogatt.com does not exist."]
Example #3
0
def test_scan_with_violations():
    """Test scan on a host with violations"""

    results = scan(DNS_SERVER, "espn.com", 443)

    # Check the output to ensure there are no violations
    assert results["Results"] != ["No SSL/TLS Violations found."]
Example #4
0
def test_scan_no_violations():
    """Test scan on a host with no violations"""

    results = scan(DNS_SERVER, "api.metlife.com", 443)

    # Check the output to ensure there are no violations
    assert results["Results"] == ["No SSL/TLS Violations found."]
Example #5
0
def test_by_ip_no_violations():
    """Test policy scan on an external ip with no violations"""

    results = scan(DNS_SERVER, "216.163.251.205", 443)

    # Check the output to ensure there are no violations
    assert results["Results"] != ["No SSL/TLS Violations found."]
Example #6
0
def test_port_timeout():
    """Test timeout connecting to a port"""

    results = scan(DNS_SERVER, "yahoo.com", 8443)

    # Check the output to ensure the scan could not complete
    assert results["Results"] == ["Error: Could not connect to yahoo.com:8443"]
Example #7
0
def test_bad_dnsserver():
    """Test bad dns server"""

    results = scan("8.8.7.6", "espn.com", 443)

    # Check the output to ensure the DNS name could not resolve
    assert results["Results"] == ["The DNS operation timed out."]
Example #8
0
def test_sslyze_timeout():
    """Test sslyze timeout"""

    bad_dns_domain = "bbbbbbbbbbbbbbbbbbbbbbbbb.com"
    results = scan(DNS_SERVER, bad_dns_domain, 443)

    # Check the output to ensure the DNS name could not resolve
    assert results["Results"] == [
        f"The DNS name {bad_dns_domain} does not exist."
    ]