Skip to content

Commit

Permalink
Report unchecked device model in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-r-thorpe committed Nov 17, 2023
1 parent 7c93b49 commit 12f556b
Showing 1 changed file with 34 additions and 11 deletions.
45 changes: 34 additions & 11 deletions nmostesting/suites/IS1201Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,6 @@ def generate_device_model_datatype_schemas(self, test):

def check_device_model(self, test):
if not self.device_model_metadata["checked"]:
self.device_model_metadata["checked"] = True

self.create_ncp_socket(test)
class_manager = self.get_class_manager(test)
device_model = self.query_device_model(test)
Expand All @@ -613,6 +611,7 @@ def check_device_model(self, test):
device_model,
class_manager.class_descriptors)

self.device_model_metadata["checked"] = True
return

def nc_object_factory(self, test, class_id, oid, role):
Expand Down Expand Up @@ -664,6 +663,9 @@ def test_05(self, test):
if self.device_model_metadata["error"]:
return test.FAIL(self.device_model_metadata["error_msg"])

if not self.device_model_metadata["checked"]:
return test.UNCLEAR("Unable to check Device Model.")

return test.PASS()

def test_06(self, test):
Expand All @@ -674,14 +676,17 @@ def test_06(self, test):
self.check_device_model(test)
except NMOSTestException as e:
# Couldn't validate model so can't perform test
return test.UNCLEAR(e.args[0].detail, e.args[0].link)
return test.FAIL(e.args[0].detail, e.args[0].link)

if self.unique_roles_error:
return test.FAIL("Roles must be unique. ",
"https://specs.amwa.tv/ms-05-02/branches/{}"
"/docs/NcObject.html"
.format(self.apis[MS05_API_KEY]["spec_branch"]))

if not self.device_model_metadata["checked"]:
return test.UNCLEAR("Unable to check Device Model.")

return test.PASS()

def test_07(self, test):
Expand All @@ -692,14 +697,17 @@ def test_07(self, test):
self.check_device_model(test)
except NMOSTestException as e:
# Couldn't validate model so can't perform test
return test.UNCLEAR(e.args[0].detail, e.args[0].link)
return test.FAIL(e.args[0].detail, e.args[0].link)

if self.unique_oids_error:
return test.FAIL("Oids must be unique. ",
"https://specs.amwa.tv/ms-05-02/branches/{}"
"/docs/NcObject.html"
.format(self.apis[MS05_API_KEY]["spec_branch"]))

if not self.device_model_metadata["checked"]:
return test.UNCLEAR("Unable to check Device Model.")

return test.PASS()

def test_08(self, test):
Expand All @@ -713,14 +721,17 @@ def test_08(self, test):
self.check_device_model(test)
except NMOSTestException as e:
# Couldn't validate model so can't perform test
return test.UNCLEAR(e.args[0].detail, e.args[0].link)
return test.FAIL(e.args[0].detail, e.args[0].link)

if self.organization_metadata["error"]:
return test.FAIL(self.organization_metadata["error_msg"],
"https://specs.amwa.tv/ms-05-02/branches/{}"
"/docs/Framework.html#ncclassid"
.format(self.apis[MS05_API_KEY]["spec_branch"]))

if not self.device_model_metadata["checked"]:
return test.UNCLEAR("Unable to check Device Model.")

if not self.organization_metadata["checked"]:
return test.UNCLEAR("No non-standard classes found.")

Expand All @@ -737,14 +748,17 @@ def test_09(self, test):
self.check_device_model(test)
except NMOSTestException as e:
# Couldn't validate model so can't perform test
return test.UNCLEAR(e.args[0].detail, e.args[0].link)
return test.FAIL(e.args[0].detail, e.args[0].link)

if self.touchpoints_metadata["error"]:
return test.FAIL(self.touchpoints_metadata["error_msg"],
"https://specs.amwa.tv/ms-05-02/branches/{}"
"/docs/NcObject.html#touchpoints"
.format(self.apis[MS05_API_KEY]["spec_branch"]))

if not self.device_model_metadata["checked"]:
return test.UNCLEAR("Unable to check Device Model.")

if not self.touchpoints_metadata["checked"]:
return test.UNCLEAR("No Touchpoints found.")
return test.PASS()
Expand All @@ -758,14 +772,17 @@ def test_09_01(self, test):
self.check_device_model(test)
except NMOSTestException as e:
# Couldn't validate model so can't perform test
return test.UNCLEAR(e.args[0].detail, e.args[0].link)
return test.FAIL(e.args[0].detail, e.args[0].link)

if self.deprecated_property_metadata["error"]:
return test.FAIL(self.deprecated_property_metadata["error_msg"],
"https://specs.amwa.tv/ms-05-02/branches/{}"
"/docs/Framework.html#ncmethodstatus"
.format(self.apis[MS05_API_KEY]["spec_branch"]))

if not self.device_model_metadata["checked"]:
return test.UNCLEAR("Unable to check Device Model.")

if not self.deprecated_property_metadata["checked"]:
return test.UNCLEAR("No deprecated properties found.")
return test.PASS()
Expand All @@ -779,14 +796,17 @@ def test_10(self, test):
self.check_device_model(test)
except NMOSTestException as e:
# Couldn't validate model so can't perform test
return test.UNCLEAR(e.args[0].detail, e.args[0].link)
return test.FAIL(e.args[0].detail, e.args[0].link)

if self.managers_members_root_block_error:
return test.FAIL("Managers must be members of Root Block. ",
"https://specs.amwa.tv/ms-05-02/branches/{}"
"/docs/Managers.html"
.format(self.apis[MS05_API_KEY]["spec_branch"]))

if not self.device_model_metadata["checked"]:
return test.UNCLEAR("Unable to check Device Model.")

return test.PASS()

def test_11(self, test):
Expand All @@ -798,14 +818,17 @@ def test_11(self, test):
self.check_device_model(test)
except NMOSTestException as e:
# Couldn't validate model so can't perform test
return test.UNCLEAR(e.args[0].detail, e.args[0].link)
return test.FAIL(e.args[0].detail, e.args[0].link)

if self.managers_are_singletons_error:
return test.FAIL("Managers must be singleton classes. ",
"https://specs.amwa.tv/ms-05-02/branches/{}"
"/docs/Managers.html"
.format(self.apis[MS05_API_KEY]["spec_branch"]))

if not self.device_model_metadata["checked"]:
return test.UNCLEAR("Unable to check Device Model.")

return test.PASS()

def test_12(self, test):
Expand Down Expand Up @@ -952,7 +975,7 @@ def test_17(self, test):
self.check_device_model(test)
except NMOSTestException as e:
# Couldn't validate model so can't perform test
return test.UNCLEAR(e.args[0].detail, e.args[0].link)
return test.FAIL(e.args[0].detail, e.args[0].link)

if self.get_sequence_item_metadata["error"]:
return test.FAIL(self.get_sequence_item_metadata["error_msg"])
Expand All @@ -972,7 +995,7 @@ def test_18(self, test):
self.check_device_model(test)
except NMOSTestException as e:
# Couldn't validate model so can't perform test
return test.UNCLEAR(e.args[0].detail, e.args[0].link)
return test.FAIL(e.args[0].detail, e.args[0].link)

if self.get_sequence_length_metadata["error"]:
return test.FAIL(self.get_sequence_length_metadata["error_msg"])
Expand Down

0 comments on commit 12f556b

Please sign in to comment.