All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-renesas-soc@vger.kernel.org
Cc: Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: [kms-test] [PATCH 5/7] tests: crc: Skip test if CRC support isn't available
Date: Sun, 31 Jul 2022 18:20:22 +0300	[thread overview]
Message-ID: <20220731152024.24090-6-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20220731152024.24090-1-laurent.pinchart@ideasonboard.com>

If CRC support isn't available (most likely caused by debugfs not being
mounted), the CRCReader constructor will throw an exception that the crc
test doesn't handle. Move construction of the CRCReader earlier and skip
the test if it fails.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 tests/kms-test-crc.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/kms-test-crc.py b/tests/kms-test-crc.py
index efb3cf0dbe41..01f9606f2de9 100755
--- a/tests/kms-test-crc.py
+++ b/tests/kms-test-crc.py
@@ -123,6 +123,13 @@ class CRCTest(kmstest.KMSTest):
         for crtc in self.card.crtcs:
             self.start(f'CRC calculation on CRTC {crtc.id}')
 
+            try:
+                crc_reader = kmstest.CRCReader(crtc)
+            except:
+                self.logger.log('Failed to create CRC reader, check that debugfs is mounted')
+                self.skip(f'CRC support not available for CRTC {crtc.id}')
+                continue
+
             # Get the connector and default mode
             try:
                 connector = connectors[crtc];
@@ -198,7 +205,6 @@ class CRCTest(kmstest.KMSTest):
                 # Set the CRC source and acquire 10 CRC values. Discard the
                 # first value, as the device is running and the new source
                 # needs one frame to take effect.
-                crc_reader = kmstest.CRCReader(crtc)
                 crc_reader.start(crc_source)
                 crcs = crc_reader.read(10)
                 crc_reader.stop()
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2022-07-31 15:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-31 15:20 [kms-test] [PATCH 0/7] Miscellaneous fixes and improvements Laurent Pinchart
2022-07-31 15:20 ` [kms-test] [PATCH 1/7] tests: brxalloc: Fix test start log message Laurent Pinchart
2022-07-31 15:20 ` [kms-test] [PATCH 2/7] tests: modes: Fix access to RuntimeError message text Laurent Pinchart
2022-07-31 15:20 ` [kms-test] [PATCH 3/7] kmstest: Fix CRC directory name string Laurent Pinchart
2022-07-31 15:20 ` [kms-test] [PATCH 4/7] kmstest: Fix exception handling in CRCReader constructor and destructor Laurent Pinchart
2022-07-31 15:20 ` Laurent Pinchart [this message]
2022-07-31 15:20 ` [kms-test] [PATCH 6/7] tests: Only call execute() if the test is run directly Laurent Pinchart
2022-07-31 15:20 ` [kms-test] [PATCH 7/7] kmstest: Implement test runner when executed directly Laurent Pinchart
2022-07-31 18:52 ` [kms-test] [PATCH 8/7] tests: Don't skip formats and plane-position tests on unconnected connector Laurent Pinchart
2022-07-31 18:52 ` [kms-test] [PATCH 9/7] kmstest: Raise clear exception when property is not found Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220731152024.24090-6-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.