From patchwork Thu May 21 09:44:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Weinehall X-Patchwork-Id: 6453671 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E52BDC0432 for ; Thu, 21 May 2015 09:46:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2B0C7203ED for ; Thu, 21 May 2015 09:46:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3D8D6203EC for ; Thu, 21 May 2015 09:46:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3D986E884; Thu, 21 May 2015 02:46:25 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id A7D756E884 for ; Thu, 21 May 2015 02:46:24 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 21 May 2015 02:46:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,468,1427785200"; d="scan'208";a="713566412" Received: from dweineha-mobl3.fi.intel.com (HELO boom) ([10.237.72.77]) by fmsmga001.fm.intel.com with ESMTP; 21 May 2015 02:46:23 -0700 Date: Thu, 21 May 2015 12:44:53 +0300 From: David Weinehall To: intel-gfx Message-ID: <20150521094453.GA13768@boom> Mail-Followup-To: intel-gfx MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150520135419.GA13974@boom> X-Editor: Vi Improved X-Accept-Language: Swedish, English X-GPG-Fingerprint: ED69 8CF5 6102 21B9 AFD1 9DB7 0B27 96FD 15DA A404 X-GPG-Key: http://www.acc.umu.se/~tao/files/pub_15daa404.gpg.asc X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) Subject: [Intel-gfx] [PATCH i-g-t 4/3] tests/gem_ctx_param_basic: Expand ctx_param tests X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP tests/gem_ctx_param_basic: Expand ctx_param tests Expand the context parameter tests to cover the no-zeromap parameter. Signed-off-by: David Weinehall --- gem_ctx_param_basic.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/gem_ctx_param_basic.c b/tests/gem_ctx_param_basic.c index b44b37cf0538..ba9366d1a679 100644 --- a/tests/gem_ctx_param_basic.c +++ b/tests/gem_ctx_param_basic.c @@ -98,7 +98,7 @@ igt_main ctx_param.size = 0; } - ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD + 1; + ctx_param.param = I915_CONTEXT_PARAM_NO_ZEROMAP + 1; igt_subtest("invalid-param-get") { ctx_param.context = ctx; @@ -132,6 +132,28 @@ igt_main TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); } + ctx_param.param = LOCAL_CONTEXT_PARAM_NO_ZEROMAP; + + igt_subtest("non-root-set-no-zeromap") { + igt_fork(child, 1) { + igt_drop_root(); + + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value--; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EPERM); + } + + igt_waitchildren(); + } + + igt_subtest("root-set-no-zeromap") { + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value--; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + igt_fixture close(fd); }