mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 21:47:59 +00:00
Don't tests stats channels that haven't been configured
pytest was failing because it was testing features that had not been configured. test to see if those features have been configured before running the tests.
This commit is contained in:
parent
ee068e2c39
commit
10c01cba61
@ -12,6 +12,8 @@
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
|
||||
@ -72,6 +74,8 @@ def load_zone_json(zone):
|
||||
|
||||
@pytest.mark.json
|
||||
@pytest.mark.requests
|
||||
@pytest.mark.skipif(os.getenv("HAVEJSONSTATS", "unset") != "1",
|
||||
reason="JSON not configured")
|
||||
def test_zone_timers_primary_json(statsport):
|
||||
generic.test_zone_timers_primary(fetch_zones_json, load_timers_json,
|
||||
statsip="10.53.0.1", statsport=statsport,
|
||||
@ -80,6 +84,8 @@ def test_zone_timers_primary_json(statsport):
|
||||
|
||||
@pytest.mark.json
|
||||
@pytest.mark.requests
|
||||
@pytest.mark.skipif(os.getenv("HAVEJSONSTATS", "unset") != "1",
|
||||
reason="JSON not configured")
|
||||
def test_zone_timers_secondary_json(statsport):
|
||||
generic.test_zone_timers_secondary(fetch_zones_json, load_timers_json,
|
||||
statsip="10.53.0.3", statsport=statsport,
|
||||
@ -88,6 +94,8 @@ def test_zone_timers_secondary_json(statsport):
|
||||
|
||||
@pytest.mark.json
|
||||
@pytest.mark.requests
|
||||
@pytest.mark.skipif(os.getenv("HAVEJSONSTATS", "unset") != "1",
|
||||
reason="JSON not configured")
|
||||
def test_zone_with_many_keys_json(statsport):
|
||||
generic.test_zone_with_many_keys(fetch_zones_json, load_zone_json,
|
||||
statsip="10.53.0.2", statsport=statsport)
|
||||
@ -96,6 +104,8 @@ def test_zone_with_many_keys_json(statsport):
|
||||
@pytest.mark.json
|
||||
@pytest.mark.requests
|
||||
@pytest.mark.dnspython
|
||||
@pytest.mark.skipif(os.getenv("HAVEJSONSTATS", "unset") != "1",
|
||||
reason="JSON not configured")
|
||||
def test_traffic_json(port, statsport):
|
||||
generic.test_traffic(fetch_traffic_json,
|
||||
statsip="10.53.0.2", statsport=statsport,
|
||||
|
@ -13,6 +13,8 @@
|
||||
import xml.etree.ElementTree as ET
|
||||
from datetime import datetime
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
|
||||
@ -102,6 +104,8 @@ def load_zone_xml(zone):
|
||||
|
||||
@pytest.mark.xml
|
||||
@pytest.mark.requests
|
||||
@pytest.mark.skipif(os.getenv("HAVEXMLSTATS", "unset") != "1",
|
||||
reason="XML not configured")
|
||||
def test_zone_timers_primary_xml(statsport):
|
||||
generic.test_zone_timers_primary(fetch_zones_xml, load_timers_xml,
|
||||
statsip="10.53.0.1", statsport=statsport,
|
||||
@ -110,6 +114,8 @@ def test_zone_timers_primary_xml(statsport):
|
||||
|
||||
@pytest.mark.xml
|
||||
@pytest.mark.requests
|
||||
@pytest.mark.skipif(os.getenv("HAVEXMLSTATS", "unset") != "1",
|
||||
reason="XML not configured")
|
||||
def test_zone_timers_secondary_xml(statsport):
|
||||
generic.test_zone_timers_secondary(fetch_zones_xml, load_timers_xml,
|
||||
statsip="10.53.0.3", statsport=statsport,
|
||||
@ -118,6 +124,8 @@ def test_zone_timers_secondary_xml(statsport):
|
||||
|
||||
@pytest.mark.xml
|
||||
@pytest.mark.requests
|
||||
@pytest.mark.skipif(os.getenv("HAVEXMLSTATS", "unset") != "1",
|
||||
reason="XML not configured")
|
||||
def test_zone_with_many_keys_xml(statsport):
|
||||
generic.test_zone_with_many_keys(fetch_zones_xml, load_zone_xml,
|
||||
statsip="10.53.0.2", statsport=statsport)
|
||||
@ -126,6 +134,8 @@ def test_zone_with_many_keys_xml(statsport):
|
||||
@pytest.mark.xml
|
||||
@pytest.mark.requests
|
||||
@pytest.mark.dnspython
|
||||
@pytest.mark.skipif(os.getenv("HAVEXMLSTATS", "unset") != "1",
|
||||
reason="XML not configured")
|
||||
def test_traffic_xml(port, statsport):
|
||||
generic.test_traffic(fetch_traffic_xml,
|
||||
statsip="10.53.0.2", statsport=statsport,
|
||||
|
Loading…
x
Reference in New Issue
Block a user