From patchwork Thu Jul 11 16:59:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2826560 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 94AE8C0AB2 for ; Thu, 11 Jul 2013 16:57:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 647DC20347 for ; Thu, 11 Jul 2013 16:57:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D6A362034D for ; Thu, 11 Jul 2013 16:57:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C897CE65C2 for ; Thu, 11 Jul 2013 09:57:22 -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 5EA99E65C7 for ; Thu, 11 Jul 2013 09:56:58 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 99) id B94D588652; Thu, 11 Jul 2013 16:56:57 +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 17E4788167; Thu, 11 Jul 2013 16:56:57 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Thu, 11 Jul 2013 09:59:46 -0700 Message-Id: <1373561986-13492-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.3.2 Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH] 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 Requested-by: Daniel Vetter Signed-off-by: Ben Widawsky --- tests/Makefile.am | 1 + tests/drm_lib.sh | 4 ++++ tests/tools_test | 20 ++++++++++++++++++++ 3 files changed, 25 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..bca726c --- /dev/null +++ b/tests/tools_test @@ -0,0 +1,20 @@ +#!/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 +do_or_die "$SOURCE_DIR/../tools/intel_reg_read 0x4030" +# ARB_MODE should have mask bits, so it should be safe to write +do_or_die "$SOURCE_DIR/../tools/intel_reg_write 0x4030 0" + +do_or_die "$SOURCE_DIR/../tools/intel_reg_dumper" + +# TODO: Add more tests + +exit 0 +