From patchwork Thu Jan 19 16:48:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mkrtchyan, Tigran" X-Patchwork-Id: 9526393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC76D6020B for ; Thu, 19 Jan 2017 16:49:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF21D285D0 for ; Thu, 19 Jan 2017 16:49:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3D78285D4; Thu, 19 Jan 2017 16:49:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A1FD285D0 for ; Thu, 19 Jan 2017 16:49:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751807AbdASQtG (ORCPT ); Thu, 19 Jan 2017 11:49:06 -0500 Received: from smtp-o-1.desy.de ([131.169.56.154]:40452 "EHLO smtp-o-1.desy.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753618AbdASQtE (ORCPT ); Thu, 19 Jan 2017 11:49:04 -0500 X-Clacks-Overhead: GNU Terry Pratchett DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-1.desy.de 16AE3280700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1484844509; bh=2vAjciHfLL79FjW9jX+a9/K8hfBJOdnXAZkSi/3Adzg=; h=From:To:Cc:Subject:Date:From; b=FvBvcmNkcfXGJAsDKHTjkGwA3wsWTtZ6DV9/5w83koqi1mFDTWkJIE9qaz9Vd9w3c KBRU/wZxMg1Zhirm4XnkX9ZFFlSZow6JOPqZaNgeZYaaxkyFDUsAZRXrg+7PKvgJxN RK3OTY47FZTNjBCJS+feHlu52pfuKj4mkYG3pcuo= Received: from smtp-map-1.desy.de (smtp-map-1.desy.de [131.169.56.66]) by smtp-o-1.desy.de (DESY-O-1) with ESMTP id 16AE3280700 for ; Thu, 19 Jan 2017 17:48:29 +0100 (CET) Received: from ZITSWEEP2.win.desy.de (zitsweep2.win.desy.de [131.169.97.96]) by smtp-map-1.desy.de (DESY_MAP_1) with ESMTP id 0B71713E88 for ; Thu, 19 Jan 2017 17:48:28 +0100 (MET) Received: from smtp-intra-1.desy.de (lb-40-26.desy.de) by ZITSWEEP2.win.desy.de (Clearswift SMTPRS 5.5.0) with ESMTP id ; Thu, 19 Jan 2017 17:48:28 +0100 Received: from ani.desy.de (zitpcx21033.desy.de [131.169.185.213]) by smtp-intra-1.desy.de (DESY-INTRA-1) with ESMTP id BD5533E901; Thu, 19 Jan 2017 17:48:28 +0100 (MET) From: Tigran Mkrtchyan To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, Tigran Mkrtchyan Subject: [PATCH] pynfs: do not fail test which expects STALE_STATEID Date: Thu, 19 Jan 2017 17:48:25 +0100 Message-Id: <20170119164825.5962-1-tigran.mkrtchyan@desy.de> X-Mailer: git-send-email 2.9.3 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Stale stateid tests assume to know how state ids are constructed. When this is not the case, then server will return BAD_STATEID and test will fail. update **check** function to always add BAD_STATEID status code to the warning list. Some code duplication, due to testing framework structure. Signed-off-by: Tigran Mkrtchyan --- nfs4.0/servertests/environment.py | 6 ++++++ nfs4.1/server41tests/environment.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/nfs4.0/servertests/environment.py b/nfs4.0/servertests/environment.py index 11658b3..c6ede8f 100644 --- a/nfs4.0/servertests/environment.py +++ b/nfs4.0/servertests/environment.py @@ -248,6 +248,12 @@ def check(res, stat=NFS4_OK, msg=None, warnlist=[]): if not (debug_fail and msg): return + # stale state id test expect some structure stateid.other field. + # as this is not the case for all server, do not fail tests if they + # have returned BAD_STATEID + if res.status == NFS4ERR_STALE_STATEID: + warnlist.append(NFS4ERR_BAD_STATEID) + statnames = [nfsstat4[stat] for stat in statlist] desired = ' or '.join(statnames) if not desired: diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py index a910a69..8bae69b 100644 --- a/nfs4.1/server41tests/environment.py +++ b/nfs4.1/server41tests/environment.py @@ -282,6 +282,12 @@ def check(res, stat=NFS4_OK, msg=None, warnlist=[]): if not (debug_fail and msg): return + # stale state id test expect some structure stateid.other field. + # as this is not the case for all server, do not fail tests if they + # have returned BAD_STATEID + if res.status == NFS4ERR_STALE_STATEID: + warnlist.append(NFS4ERR_BAD_STATEID) + statnames = [nfsstat4[stat] for stat in statlist] desired = ' or '.join(statnames) if not desired: