Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2538736pxb; Mon, 17 Jan 2022 00:03:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+sLDhT0D7f30iPLOWwjmjgKgV9n7b9gxBn1YY4Fm1EsQQtYBuT4ijKziUu04y56QmlU+P X-Received: by 2002:a63:b90e:: with SMTP id z14mr18050376pge.189.1642406628536; Mon, 17 Jan 2022 00:03:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642406628; cv=none; d=google.com; s=arc-20160816; b=iaWYnOUsV1uxXn5+MOG+85H++q317IiUBteMtTGf1BAAynugbnsdXb92l9fRU9+H1j MweqjwsI3TXYLKhCieYyA+rcEy4KuBAM8YfiESMnkY/tGPJggFLSjBL/JRUzU5XIKtWe yrRbQeZaBFY5cRwMQjnEE3IZ9Jydo6Bbks1Fzn3Uydy6BLxnt+l+GRviGxwe0r7u9aA7 RWKDXTHgqPLwfjQfeQBvWtqkI9ihBWDr6rGOcOLt0hntj7zgkglQIyfV7laHx8eW83q7 RZCN+HL8MfnwR3gIRvTfLx4BvSb/iV+tKmX7prP42APoGBYMA4zKJ0zeNb+tQYNioUlG XUhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=df32tALyz+lbAuQC1UcqwLZWOWbSilFiv14dlF19yx0=; b=y8FL85hENS/mQHlEO1JBwr7h+nX86q8pZJYUFqWBlIY6ykhGr9SNYPPIYEoUhB/uQF vewGpqPRwpJSSsOsefbEvl/a8P9xDG8yHT9+1ENplqVLsDYXwCq9Y30Uir5fAxYxUQrR n5btufDXHH1UIgvddgjny+lq1yTFhEsnqJ5z4kzuQhVBa/dC6qf2BYFdz+0iUipcJPBa wGmcmPq+zrdlWcGPd9DLqb/8FPm0SBggZQK5/vQZnKQwusdQCnf8lRpRvbNPwQavd6ff BNMYa5HN+/ft15HQBM3OJUWL22f4xSr4rd0jm+uMEiG4Bbm8nZUvjJ9txsD3aBNC1SbF UcOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="j58W1h/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp21si11997965pjb.155.2022.01.17.00.03.37; Mon, 17 Jan 2022 00:03:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="j58W1h/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235443AbiAPOeg (ORCPT + 99 others); Sun, 16 Jan 2022 09:34:36 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:33146 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiAPOef (ORCPT ); Sun, 16 Jan 2022 09:34:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 14139B80D05; Sun, 16 Jan 2022 14:34:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FF34C36AE7; Sun, 16 Jan 2022 14:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642343672; bh=oCqvjsNEHd9Y5M9rEsW3iU49LfLeq8eNQ8Zn339zLqU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j58W1h/obVl+IfAzefOxcsNjkMZGG9Dh7jPlmOPhHkz2nq9mysO1oJvaEn9mQkNfj ylI2Advz7kOA48NCzouItB152EWl6E3XY8I5hGqc9jNY/PpeIAqcx0CHKaudy8Pc9Z KJKtfAh1LmpnPXYD7eyVGZCazzJeMzNPV48SLuuZ7ZP8GyLjllSCfApEZnJIrUVVAG S1f34/3bv2CEgtlXTn3BVTEsuvxHkAatjm0N0NqnQaZuMC5Jtss+lTcguvnLE0AIw7 zqYC+7leO0dKC6vTQLEwFC88CA/rv+rcZWpfBRSpqQW0M5i6te5pTUTSdeghWOBGFU 6J3bPsKGKjbcQ== Date: Sun, 16 Jan 2022 16:34:20 +0200 From: Jarkko Sakkinen To: Tadeusz Struk Cc: Shuah Khan , linux-integrity@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] selftests: tpm: add async space test with noneexisting handle Message-ID: References: <20220116012627.2031-1-tstruk@gmail.com> <20220116012627.2031-2-tstruk@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220116012627.2031-2-tstruk@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 15, 2022 at 05:26:27PM -0800, Tadeusz Struk wrote: > Add a test for /dev/tpmrm0 in async mode that checks if > the code handles invalid handles correctly. > > Cc: Jarkko Sakkinen > Cc: Shuah Khan > Cc: > Cc: > Cc: > > Tested-by: Jarkko Sakkinen > Signed-off-by: Tadeusz Struk > --- > Changed in v2: > - Updated commit message > Changed in v3: > - Fixed typo in the function name > --- > tools/testing/selftests/tpm2/tpm2_tests.py | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/tools/testing/selftests/tpm2/tpm2_tests.py b/tools/testing/selftests/tpm2/tpm2_tests.py > index 9d764306887b..340ffef97fb6 100644 > --- a/tools/testing/selftests/tpm2/tpm2_tests.py > +++ b/tools/testing/selftests/tpm2/tpm2_tests.py > @@ -302,3 +302,19 @@ class AsyncTest(unittest.TestCase): > log.debug("Calling get_cap in a NON_BLOCKING mode") > async_client.get_cap(tpm2.TPM2_CAP_HANDLES, tpm2.HR_LOADED_SESSION) > async_client.close() > + > + def test_flush_invalid_context(self): > + log = logging.getLogger(__name__) > + log.debug(sys._getframe().f_code.co_name) > + > + async_client = tpm2.Client(tpm2.Client.FLAG_SPACE | tpm2.Client.FLAG_NONBLOCK) > + log.debug("Calling flush_context passing in an invalid handle ") > + handle = 0x80123456 > + rc = 0 > + try: > + async_client.flush_context(handle) > + except OSError as e: > + rc = e.errno > + > + self.assertEqual(rc, 22) > + async_client.close() > -- > 2.30.2 > Thank you. Reviewed-by: Jarkko Sakkinen BR, Jarkko