From patchwork Tue Jun 10 10:03:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4327411 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 59DAC9F314 for ; Tue, 10 Jun 2014 10:04:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F14820176 for ; Tue, 10 Jun 2014 10:04:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A50BA20295 for ; Tue, 10 Jun 2014 10:04:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750963AbaFJKEK (ORCPT ); Tue, 10 Jun 2014 06:04:10 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:43053 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbaFJKEJ (ORCPT ); Tue, 10 Jun 2014 06:04:09 -0400 Received: by mail-pa0-f54.google.com with SMTP id rd3so537379pab.41 for ; Tue, 10 Jun 2014 03:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=Wyllss2/HdNkLR/N+fk4lb2NlPT8UA2IY8x01h3vlBo=; b=mOTauQlKOOlHlE8p4XIqBtesfR3UOrQoHe5xLB9k77FHBHNK9uNeewdtPdjlMrxmuz ERgxPZV9zS7ARnU8OGwBwOgyTDG6WhCtJ7LGbZQStpPQdI1Tly51JnwXi42kfZPu7EkB 7bAGiG9BQEfiwqrUbJfjFBfIEhI/onC9a7OkPlKEZOI1tFArZm4WKyBxvBK5glVjE690 9VIo5DYkZcqFKdagMEaXv3FILFqadS2Q9cFuXw2B2pFBjItwslCQon8UF5r3UL530MlB /yTHi3ABGdkFDI4gNuVeYlLyVRjafZnbKRAjR8OEKrpMGNSvtiU/3kJlSFSNjXYkY3rD b5SA== X-Received: by 10.68.135.42 with SMTP id pp10mr10688779pbb.58.1402394648712; Tue, 10 Jun 2014 03:04:08 -0700 (PDT) Received: from [192.168.31.158] ([125.67.97.90]) by mx.google.com with ESMTPSA id g6sm10787980pat.2.2014.06.10.03.04.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 03:04:07 -0700 (PDT) Message-ID: <5396D7FA.4050303@gmail.com> Date: Tue, 10 Jun 2014 18:03:38 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "J. Bruce Fields" CC: Linux NFS Mailing List , kinglongmee@gmail.com Subject: [PATCH] NFS4.1: try to clean sessions after testing Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 There are many sessions left after testing, they hold drc memory at server. This patch tries to clean session after each testcase. Signed-off-by: Kinglong Mee --- nfs4.1/server41tests/environment.py | 7 ++++++- nfs4.1/testmod.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py index b2df732..7632655 100644 --- a/nfs4.1/server41tests/environment.py +++ b/nfs4.1/server41tests/environment.py @@ -248,7 +248,12 @@ class Environment(testmod.Environment): def testname(self, t): """Returns a name for the test that is unique between runs""" return "%s_%i" % (t.code, self.timestamp) - + + def clean_sessions(self): + """Destroy client name env.c1""" + for sessionid in self.c1.sessions.keys(): + self.c1.compound([op.destroy_session(sessionid)]) + ######################################### debug_fail = False diff --git a/nfs4.1/testmod.py b/nfs4.1/testmod.py index 5908066..661aed0 100644 --- a/nfs4.1/testmod.py +++ b/nfs4.1/testmod.py @@ -220,6 +220,7 @@ class Test(object): environment.startUp() self.runtest(self, environment) self.result = self._pass_result + environment.clean_sessions() except KeyboardInterrupt: raise except TestException, e: