Home | History | Annotate | Line # | Download | only in spf
      1 # Copyright (C) Internet Systems Consortium, Inc. ("ISC")
      2 #
      3 # SPDX-License-Identifier: MPL-2.0
      4 #
      5 # This Source Code Form is subject to the terms of the Mozilla Public
      6 # License, v. 2.0.  If a copy of the MPL was not distributed with this
      7 # file, you can obtain one at https://mozilla.org/MPL/2.0/.
      8 #
      9 # See the COPYRIGHT file distributed with this work for additional
     10 # information regarding copyright ownership.
     11 
     12 import pytest
     13 
     14 
     15 @pytest.mark.requires_zones_loaded("ns1")
     16 def test_spf_log(ns1):
     17     for msg in (
     18         "zone spf/IN: 'y.spf' found type SPF record but no SPF TXT record found",
     19         "zone warn/IN: 'y.warn' found type SPF record but no SPF TXT record found",
     20         "zone spf/IN: loaded serial 0",
     21         "zone warn/IN: loaded serial 0",
     22         "zone nowarn/IN: loaded serial 0",
     23     ):
     24         assert msg in ns1.log
     25 
     26     for msg in (
     27         "zone nowarn/IN: 'y.nowarn' found type SPF record but no SPF TXT record found",
     28         "zone spf/IN: 'spf' found type SPF record but no SPF TXT record found",
     29         "zone warn/IN: 'warn' found type SPF record but no SPF TXT record found",
     30         "zone nowarn/IN: 'nowarn' found type SPF record but no SPF TXT record found",
     31     ):
     32         assert msg not in ns1.log
     33