diff --git a/nmostesting/suites/BCP00301Test.py b/nmostesting/suites/BCP00301Test.py index 87d1c12f..6081f765 100644 --- a/nmostesting/suites/BCP00301Test.py +++ b/nmostesting/suites/BCP00301Test.py @@ -84,7 +84,7 @@ def test_01(self, test): elif report["id"] in ["TLS1_3"] and not report["finding"].startswith("offered"): return test.OPTIONAL("Protocol {} should be offered".format(report["id"].replace("_", ".")), "https://specs.amwa.tv/bcp-003-01/branches/{}" - "/docs/1.0._Secure_Communication.html#tls-versions" + "/docs/Secure_Communication.html#tls-versions" .format(self.apis[SECURE_API_KEY]["spec_branch"])) return test.PASS() @@ -135,13 +135,13 @@ def test_02(self, test): return test.OPTIONAL("Implementation of the following TLS 1.2 ciphers is recommended: {}" .format(",".join(tls1_2_should)), "https://specs.amwa.tv/bcp-003-01/branches/{}" - "/docs/1.0._Secure_Communication.html#tls-12-cipher-suites" + "/docs/Secure_Communication.html#tls-12-cipher-suites" .format(self.apis[SECURE_API_KEY]["spec_branch"])) elif tls1_3_supported and len(tls1_3_should) > 0: return test.OPTIONAL("Implementation of the following TLS 1.3 ciphers is recommended: {}" .format(",".join(tls1_3_should)), "https://specs.amwa.tv/bcp-003-01/branches/{}" - "/docs/1.0._Secure_Communication.html#tls-13-cipher-suites" + "/docs/Secure_Communication.html#tls-13-cipher-suites" .format(self.apis[SECURE_API_KEY]["spec_branch"])) else: return test.PASS() @@ -161,7 +161,7 @@ def test_03(self, test): ipaddress.ip_address(report["finding"]) return test.WARNING("CN is an IP address: {}".format(report["finding"]), "https://specs.amwa.tv/bcp-003-01/branches/{}" - "/docs/1.0._Secure_Communication.html" + "/docs/Secure_Communication.html" "#x509-certificates-and-certificate-authority" .format(self.apis[SECURE_API_KEY]["spec_branch"])) except ValueError: @@ -170,7 +170,7 @@ def test_03(self, test): if report["finding"].startswith("No SAN"): return test.OPTIONAL("No SAN was found in the certificate", "https://specs.amwa.tv/bcp-003-01/branches/{}" - "/docs/1.0._Secure_Communication.html" + "/docs/Secure_Communication.html" "#x509-certificates-and-certificate-authority" .format(self.apis[SECURE_API_KEY]["spec_branch"])) else: @@ -178,7 +178,7 @@ def test_03(self, test): if common_name not in alt_names: return test.OPTIONAL("CN {} was not found in the SANs".format(common_name), "https://specs.amwa.tv/bcp-003-01/branches/{}" - "/docs/1.0._Secure_Communication.html" + "/docs/Secure_Communication.html" "#x509-certificates-and-certificate-authority" .format(self.apis[SECURE_API_KEY]["spec_branch"])) for name in alt_names: @@ -186,7 +186,7 @@ def test_03(self, test): ipaddress.ip_address(name) return test.WARNING("SAN is an IP address: {}".format(name), "https://specs.amwa.tv/bcp-003-01/branches/{}" - "/docs/1.0._Secure_Communication.html" + "/docs/Secure_Communication.html" "#x509-certificates-and-certificate-authority" .format(self.apis[SECURE_API_KEY]["spec_branch"])) except ValueError: @@ -216,7 +216,7 @@ def test_04(self, test): elif hsts_supported is False: return test.OPTIONAL("Strict Transport Security (HSTS) should be supported", "https://specs.amwa.tv/bcp-003-01/branches/{}" - "/docs/1.0._Secure_Communication.html#http-server" + "/docs/Secure_Communication.html#http-server" .format(self.apis[SECURE_API_KEY]["spec_branch"])) else: return test.FAIL("Error in HSTS header: {}".format(hsts_supported)) @@ -248,7 +248,7 @@ def test_06(self, test): if report["finding"] == "not offered": return test.OPTIONAL("OCSP stapling is not offered by this server", "https://specs.amwa.tv/bcp-003-01/branches/{}" - "/docs/1.0._Secure_Communication.html" + "/docs/Secure_Communication.html" "#x509-certificates-and-certificate-authority" .format(self.apis[SECURE_API_KEY]["spec_branch"])) elif report["id"].split()[0] == "cert_ocspURL": diff --git a/nmostesting/suites/IS0401Test.py b/nmostesting/suites/IS0401Test.py index 9750957f..baddb834 100644 --- a/nmostesting/suites/IS0401Test.py +++ b/nmostesting/suites/IS0401Test.py @@ -493,6 +493,7 @@ def do_test_referential_integrity(self, test, res_type): and the recommended order for referential integrity has been adhered to""" api = self.apis[NODE_API_KEY] + api_docs_numbered = self.is04_utils.compare_api_version(api["version"], "v1.2") <= 0 # Look up data in local mock registry registry_data = self.registry_primary_data @@ -526,8 +527,8 @@ def do_test_referential_integrity(self, test, res_type): if preceding_warn: return test.WARNING(preceding_warn, "https://specs.amwa.tv/is-04/branches/{}" - "/docs/4.1._Behaviour_-_Registration.html#referential-integrity" - .format(api["spec_branch"])) + "/docs/{}Behaviour_-_Registration.html#referential-integrity" + .format(api["spec_branch"], "4.1._" if api_docs_numbered else "")) elif found_resource: return test.PASS() else: @@ -550,6 +551,7 @@ def test_05(self, test): return test.DISABLED("This test cannot be performed when ENABLE_DNS_SD is False") api = self.apis[NODE_API_KEY] + api_docs_numbered = self.is04_utils.compare_api_version(api["version"], "v1.2") <= 0 self.do_registry_basics_prereqs() @@ -581,14 +583,14 @@ def test_05(self, test): if heartbeat[1]["payload"] is not bytes(): return test.WARNING("Heartbeat POST contained a payload body.", "https://specs.amwa.tv/is-04/branches/{}" - "/docs/2.2._APIs_-_Client_Side_Implementation_Notes.html#empty-request-bodies" - .format(api["spec_branch"])) + "/docs/{}APIs_-_Client_Side_Implementation_Notes.html#empty-request-bodies" + .format(api["spec_branch"], "2.2._" if api_docs_numbered else "")) if "Content-Type" in heartbeat[1]["headers"]: return test.WARNING("Heartbeat POST contained a Content-Type header.", "https://specs.amwa.tv/is-04/branches/{}" - "/docs/2.2._APIs_-_Client_Side_Implementation_Notes.html#empty-request-bodies" - .format(api["spec_branch"])) + "/docs/{}APIs_-_Client_Side_Implementation_Notes.html#empty-request-bodies" + .format(api["spec_branch"], "2.2._" if api_docs_numbered else "")) if "Transfer-Encoding" not in heartbeat[1]["headers"]: if "Content-Length" not in heartbeat[1]["headers"] or \ @@ -597,8 +599,8 @@ def test_05(self, test): # and omitting it causes problems for commonly deployed HTTP servers return test.WARNING("Heartbeat POST did not contain a valid Content-Length header.", "https://specs.amwa.tv/is-04/branches/{}" - "/docs/2.2._APIs_-_Client_Side_Implementation_Notes.html#empty-request-bodies" - .format(api["spec_branch"])) + "/docs/{}APIs_-_Client_Side_Implementation_Notes.html#empty-request-bodies" + .format(api["spec_branch"], "2.2._" if api_docs_numbered else "")) else: if "Content-Length" in heartbeat[1]["headers"]: return test.FAIL("API signalled both Transfer-Encoding and Content-Length") @@ -1522,7 +1524,7 @@ def test_23(self, test): else: return test.OPTIONAL("No BCP-002-01 groups were identified in Sender or Receiver tags", "https://specs.amwa.tv/bcp-002-01/branches/v1.0.x" - "/docs/1.0._Natural_Grouping.html") + "/docs/Natural_Grouping.html") def test_24(self, test): """Periodic Sources specify a 'grain_rate'""" @@ -1594,6 +1596,7 @@ def test_25(self, test): """Receivers expose expected 'caps' for their API version""" api = self.apis[NODE_API_KEY] + api_docs_numbered = self.is04_utils.compare_api_version(api["version"], "v1.2") <= 0 if self.is04_utils.compare_api_version(api["version"], "v1.1") < 0: return test.NA("Capabilities are not used before API v1.1") @@ -1609,8 +1612,8 @@ def test_25(self, test): return test.WARNING("Receiver 'caps' should include a list of accepted 'media_types', unless " "this Receiver can handle any 'media_type'", "https://specs.amwa.tv/is-04/branches/{}" - "/docs/4.3._Behaviour_-_Nodes.html#all-resources" - .format(api["spec_branch"])) + "/docs/{}Behaviour_-_Nodes.html#all-resources" + .format(api["spec_branch"], "4.3._" if api_docs_numbered else "")) if self.is04_utils.compare_api_version(api["version"], "v1.3") >= 0: if receiver["format"] == "urn:x-nmos:format:data" and \ receiver["transport"] in ["urn:x-nmos:transport:websocket", "urn:x-nmos:transport:mqtt"]: @@ -1620,8 +1623,8 @@ def test_25(self, test): "if the Receiver accepts IS-07 events, unless this Receiver can " "handle any 'event_type'", "https://specs.amwa.tv/is-04/branches/{}" - "/docs/4.3._Behaviour_-_Nodes.html#all-resources" - .format(api["spec_branch"])) + "/docs/{}Behaviour_-_Nodes.html#all-resources" + .format(api["spec_branch"], "4.3._" if api_docs_numbered else "")) except json.JSONDecodeError: return test.FAIL("Non-JSON response returned from Node API") except KeyError as e: @@ -1686,7 +1689,7 @@ def test_27_1(self, test): return test.FAIL("Receiver {} does not comply with the BCP-004-01 schema: " "{}".format(receiver["id"], str(e)), "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html" + "/docs/Receiver_Capabilities.html" "#validating-parameter-constraints-and-constraint-sets" .format(api["spec_branch"])) for constraint_set in receiver["caps"]["constraint_sets"]: @@ -1696,7 +1699,7 @@ def test_27_1(self, test): return test.FAIL("Receiver {} does not comply with the Capabilities register schema: " "{}".format(receiver["id"], str(e)), "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html" + "/docs/Receiver_Capabilities.html" "#behaviour-receivers" .format(api["spec_branch"])) found_param_constraint = False @@ -1708,7 +1711,7 @@ def test_27_1(self, test): return test.FAIL("Receiver {} caps includes a constraint set without any " "parameter constraints".format(receiver["id"]), "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html" + "/docs/Receiver_Capabilities.html" "#constraint-sets" .format(api["spec_branch"])) except json.JSONDecodeError: @@ -1721,7 +1724,7 @@ def test_27_1(self, test): elif no_constraint_sets: return test.OPTIONAL("No BCP-004-01 'constraint_sets' were identified in Receiver caps", "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#listing-constraint-sets" + "/docs/Receiver_Capabilities.html#listing-constraint-sets" .format(api["spec_branch"])) else: return test.PASS() @@ -1747,7 +1750,7 @@ def test_27_2(self, test): return test.FAIL("Receiver {} caps version is later than resource version" .format(receiver["id"]), "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#behaviour-receivers" + "/docs/Receiver_Capabilities.html#behaviour-receivers" .format(api["spec_branch"])) except json.JSONDecodeError: return test.FAIL("Non-JSON response returned from Node API") @@ -1759,7 +1762,7 @@ def test_27_2(self, test): elif no_caps_version: return test.OPTIONAL("No Receiver caps versions were found", "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#capabilities-version" + "/docs/Receiver_Capabilities.html#capabilities-version" .format(api["spec_branch"])) else: return test.PASS() @@ -1803,12 +1806,12 @@ def test_27_3(self, test): elif no_constraint_sets: return test.OPTIONAL("No BCP-004-01 'constraint_sets' were identified in Receiver caps", "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#listing-constraint-sets" + "/docs/Receiver_Capabilities.html#listing-constraint-sets" .format(api["spec_branch"])) elif warn_unregistered: return test.WARNING(warn_unregistered, "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#defining-parameter-constraints" + "/docs/Receiver_Capabilities.html#defining-parameter-constraints" .format(api["spec_branch"])) else: return test.PASS() @@ -1855,17 +1858,17 @@ def do_test_constraint_set_meta(self, test, meta, description, warn_not_all=Fals elif no_constraint_sets: return test.OPTIONAL("No BCP-004-01 'constraint_sets' were identified in Receiver caps", "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#listing-constraint-sets" + "/docs/Receiver_Capabilities.html#listing-constraint-sets" .format(api["spec_branch"])) elif no_meta: return test.OPTIONAL("No BCP-004-01 'constraint_sets' have {}".format(description), "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#constraint-set-{}" + "/docs/Receiver_Capabilities.html#constraint-set-{}" .format(api["spec_branch"], meta)) elif warn_not_all and not all_meta: return test.WARNING("Only some BCP-004-01 'constraint_sets' have {}".format(description), "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#constraint-set-{}" + "/docs/Receiver_Capabilities.html#constraint-set-{}" .format(api["spec_branch"], meta)) else: return test.PASS() @@ -1935,7 +1938,7 @@ def test_27_7(self, test): elif no_constraint_sets: return test.OPTIONAL("No BCP-004-01 'constraint_sets' were identified in Receiver caps", "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#listing-constraint-sets" + "/docs/Receiver_Capabilities.html#listing-constraint-sets" .format(api["spec_branch"])) elif warn_format: return test.WARNING(warn_format) @@ -1978,7 +1981,7 @@ def test_27_8(self, test): elif no_constraint_sets: return test.OPTIONAL("No BCP-004-01 'constraint_sets' were identified in Receiver caps", "https://specs.amwa.tv/bcp-004-01/branches/{}" - "/docs/1.0._Receiver_Capabilities.html#listing-constraint-sets" + "/docs/Receiver_Capabilities.html#listing-constraint-sets" .format(api["spec_branch"])) else: return test.PASS() diff --git a/nmostesting/suites/IS0702Test.py b/nmostesting/suites/IS0702Test.py index 7096cc37..e71f6261 100644 --- a/nmostesting/suites/IS0702Test.py +++ b/nmostesting/suites/IS0702Test.py @@ -207,7 +207,7 @@ def test_02(self, test): if warn_topic: return test.WARNING(warn_message, "https://specs.amwa.tv/is-07/branches/{}" - "/docs/5.1._Transport_-_MQTT.html#32-broker_topic" + "/docs/Transport_-_MQTT.html#32-broker_topic" .format(api["spec_branch"])) else: return test.PASS()