From 5493e9c64964f8273453d539b89c742f36d5f279 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 12 Aug 2017 02:23:14 +0300 Subject: Initial import Signed-off-by: Laurent Pinchart --- tests/kms-test-connectors.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 tests/kms-test-connectors.py (limited to 'tests/kms-test-connectors.py') diff --git a/tests/kms-test-connectors.py b/tests/kms-test-connectors.py new file mode 100755 index 0000000..25fc5dc --- /dev/null +++ b/tests/kms-test-connectors.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 + +import kmstest +import pykms + +class ConnectorsTest(kmstest.KMSTest): + """Perform sanity checks on all connectors.""" + + def main(self): + for connector in self.card.connectors: + self.start("connector %s" % connector.fullname) + + # Every connector should have at least one suitable CRTC + crtcs = connector.get_possible_crtcs() + if len(crtcs) == 0: + self.fail("no possible CRTC") + continue + + # Connected connectors should have at least one mode + if connector.connected(): + modes = connector.get_modes() + if len(modes) == 0: + self.fail("no mode available") + continue + + self.success() + +ConnectorsTest().execute() -- cgit v1.2.3