Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3661267imw; Mon, 11 Jul 2022 13:06:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vZ3SKDZ8NYFArX3fKuRsfGmolxb+a9F832lOW47e9rKL5pNE0eDBrgnt8d3pHNKf3emXnc X-Received: by 2002:a17:902:d50d:b0:16b:ff69:35 with SMTP id b13-20020a170902d50d00b0016bff690035mr20282690plg.160.1657570003642; Mon, 11 Jul 2022 13:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657570003; cv=none; d=google.com; s=arc-20160816; b=qakzpmej5JDkqwtmQx78yBGZoCMC+/wwdxcbKn6BmLj33550Xqp3F37sEhFWeuBCNE IzCHbG2dswRhMgbN9Bgs0sy7vaQq6qd4GUTpaQcoxHf3v7UQFZG9LjoOQ/L96hbmcqoW X62oVjxW8Ks2pf00C18KnqEkCFA1OKp+Yn0fmczjG3uVkHDg3lOPU491PcCsT2PSOSG8 8P3cNfQHuj8LO1rDUqgr3QtIeYWMEToZePnjVj8+WNGoif2xiX7wbMmAXVcuWefyW0VS oZleV9BX019BRICy3zk2kKOAZ+pjOlz45jrUxGZKlU2o+rJWS9+BcZLvvZEMWJnVJdcX kmBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject; bh=CR+FwLNgRzR4ZEmddW+L3UYoCqLPdiDwveF2o3Y75FY=; b=BStdWbyHE2iFIVjIpAX5Q/P6LkpQkBiU8QX3eVza/2O9TJbA0DX5F2nfEN3g8/8nR5 PYCLAtPQuLo8n4xvPMQX8VvnGKKLnL87rR37GiO3Mea3yHyYSqB8jSyPVn/Y5vGcZuUv iGTZbQO4v0d/gdOhscAWs1VfS0REHY36uX1g3J+oGQaQKe8kgcoCP4zZTlnpJQuO3Aat pS+7WQXv1E+MGI5OaqRB9XPZEexOAiby+Rfuc0h266D/S9Sx2bAR5JVp9X0I5O8R2tXl C9AhJowPS5FgdkQtedIeQrF0QR1TNFkTpkLXv2dxFwWDfH49bdVju7+o4FeSs+Js7eXz PZHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 196-20020a6218cd000000b00528c09bb548si9583482pfy.167.2022.07.11.13.06.14; Mon, 11 Jul 2022 13:06:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231300AbiGKTzf (ORCPT + 99 others); Mon, 11 Jul 2022 15:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbiGKTzf (ORCPT ); Mon, 11 Jul 2022 15:55:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5630B550A8 for ; Mon, 11 Jul 2022 12:55:34 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id DE8EE615E3 for ; Mon, 11 Jul 2022 19:55:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FEF0C34115; Mon, 11 Jul 2022 19:55:33 +0000 (UTC) Subject: [PATCH v1] Add basic tests for DESTROY_SESSION From: Chuck Lever To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Date: Mon, 11 Jul 2022 15:55:32 -0400 Message-ID: <165756921593.2281287.10609723157095539123.stgit@morisot.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org The existing DSESS tests seem specific to Ganesha; they fail when run against Linux NFSD. Here's a basic one that all server implementations should PASS. Signed-off-by: Chuck Lever --- nfs4.1/server41tests/st_destroy_session.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/nfs4.1/server41tests/st_destroy_session.py b/nfs4.1/server41tests/st_destroy_session.py index b8be62582366..bd5e12d7ebf1 100644 --- a/nfs4.1/server41tests/st_destroy_session.py +++ b/nfs4.1/server41tests/st_destroy_session.py @@ -1,12 +1,33 @@ from .st_create_session import create_session from xdrdef.nfs4_const import * -from .environment import check, fail, create_file, open_file +from .environment import check, fail, create_file, open_file, close_file from xdrdef.nfs4_type import open_owner4, openflag4, createhow4, open_claim4 import nfs_ops op = nfs_ops.NFS4ops() import threading import rpc.rpc as rpc +def testDestroyBasic(t, env): + """Operations after DESTROY_SESSION should fail with BADSESSION + + FLAGS: destroy_session all + CODE: DSESS1 + """ + c = env.c1.new_client(env.testname(t)) + sess1 = c.create_session() + sess1.compound([op.reclaim_complete(FALSE)]) + res = c.c.compound([op.destroy_session(sess1.sessionid)]) + res = create_file(sess1, env.testname(t), + access=OPEN4_SHARE_ACCESS_READ) + check(res, NFS4ERR_BADSESSION) + sess2 = c.create_session() + res = create_file(sess2, env.testname(t), + access=OPEN4_SHARE_ACCESS_READ) + check(res) + fh = res.resarray[-1].object + open_stateid = res.resarray[-2].stateid + close_file(sess2, fh, stateid=open_stateid) + def testDestroy(t, env): """ - create a session