From patchwork Thu Jul 11 18:53:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2826574 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C031E9F756 for ; Thu, 11 Jul 2013 18:50:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2C0420218 for ; Thu, 11 Jul 2013 18:50:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D7827201D3 for ; Thu, 11 Jul 2013 18:50:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C08C0E6621 for ; Thu, 11 Jul 2013 11:50:35 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.localdomain (unknown [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id D471DE5DFE for ; Thu, 11 Jul 2013 11:49:49 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 99) id 76AD48864E; Thu, 11 Jul 2013 18:49:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lundgren.jf.intel.com (unknown [134.134.139.76]) by shiva.localdomain (Postfix) with ESMTPSA id D9D3A8862F; Thu, 11 Jul 2013 18:49:48 +0000 (UTC) From: Ben Widawsky To: Intel GFX Date: Thu, 11 Jul 2013 11:53:07 -0700 Message-Id: <1373568787-3145-2-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1373568787-3145-1-git-send-email-ben@bwidawsk.net> References: <1373568732-3061-1-git-send-email-ben@bwidawsk.net> <1373568787-3145-1-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 2/2] tests: Basic tools tester X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Virus-Scanned: ClamAV using ClamSMTP v2: Remove the reg write test because it breaks pre gen5 Add the llc size param test Requested-by: Daniel Vetter Signed-off-by: Ben Widawsky --- tests/Makefile.am | 1 + tests/drm_lib.sh | 4 ++++ tests/tools_test | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100755 tests/tools_test diff --git a/tests/Makefile.am b/tests/Makefile.am index a422899..ccc97b8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -115,6 +115,7 @@ TESTS_scripts_M = \ TESTS_scripts = \ test_rte_check \ + tools_test \ debugfs_reader \ debugfs_emon_crash \ sysfs_l3_parity \ diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh index 5ca815b..5975b58 100755 --- a/tests/drm_lib.sh +++ b/tests/drm_lib.sh @@ -4,6 +4,10 @@ die() { exit 1 } +do_or_die() { + $@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit -1) +} + if [ -d /debug/dri ] ; then debugfs_path=/debug/dri fi diff --git a/tests/tools_test b/tests/tools_test new file mode 100755 index 0000000..17f7822 --- /dev/null +++ b/tests/tools_test @@ -0,0 +1,21 @@ +#!/bin/bash +# Test some of the most critical tools we have accidentally broken before. +# TODO: Possibly make tests parse output + +whoami | grep -q root || ( echo ERROR: not running as root; exit 1 ) + +SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" +. $SOURCE_DIR/drm_lib.sh + +# ARB_MODE has existed for many gens. It differs per gen, but should be safe to +# read regardless +do_or_die "$SOURCE_DIR/../tools/intel_reg_read 0x4030" + +do_or_die "$SOURCE_DIR/../tools/intel_reg_dumper" + +do_or_die "$SOURCE_DIR/../tools/intel_get_llc_size" + +# TODO: Add more tests + +exit 0 +