From patchwork Tue Jun 10 11:55:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4328571 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 269019F3B4 for ; Tue, 10 Jun 2014 11:56:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 483AD201B4 for ; Tue, 10 Jun 2014 11:56:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 643E820107 for ; Tue, 10 Jun 2014 11:56:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750883AbaFJL4S (ORCPT ); Tue, 10 Jun 2014 07:56:18 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:51039 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbaFJL4S (ORCPT ); Tue, 10 Jun 2014 07:56:18 -0400 Received: by mail-pd0-f175.google.com with SMTP id z10so6009930pdj.6 for ; Tue, 10 Jun 2014 04:56:17 -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 :references:in-reply-to:content-type:content-transfer-encoding; bh=Ii6TS2csGNysU0eHLg5Oheya7nM/FvMr+eOTCExd41k=; b=ZcHz/ptQ0sOo+dAHttx8tuFSQpG9IycsSCO2T0wQjMMUSjyHgxV3+rOqNtXeIvuj6Y gXqfNPofA4z3BdZ5o3pfApNIECyjhRQmwMYuTuxNJyMFHV8yZN/w5hkY5ZMBlRvNb4/g 5dCCcANI6bYjzTbonLl73yBSwLuv/x8pkY9AboqwqyjKrgdDGjQjpuCvmWTIHAKRoUwR C/rxvzat/Z19kPbI5r6mfOUJJZyMyzAddHu6OpjSYWCSXIRRfz1DGYNmvw1ae5MMh4VB ZZ0ZeUg78R/W6leu+3cBkSJG7+Dsmvw+JdCVdA74d0NdfZhYc/W8L13t/YZB/jyom/Sk 7cHw== X-Received: by 10.68.242.135 with SMTP id wq7mr10451829pbc.147.1402401377663; Tue, 10 Jun 2014 04:56:17 -0700 (PDT) Received: from [192.168.31.158] ([125.67.97.90]) by mx.google.com with ESMTPSA id x5sm69203434pbw.26.2014.06.10.04.56.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 04:56:16 -0700 (PDT) Message-ID: <5396F243.8080606@gmail.com> Date: Tue, 10 Jun 2014 19:55:47 +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 v2] NFS4.1: try to clean sessions after testing References: <5396D7FA.4050303@gmail.com> In-Reply-To: <5396D7FA.4050303@gmail.com> 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. v2, adds empty function of clean_sessions for nfs4.0, because they are using the same testmod.py Signed-off-by: Kinglong Mee --- nfs4.0/servertests/environment.py | 3 +++ nfs4.1/server41tests/environment.py | 7 ++++++- nfs4.1/testmod.py | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/nfs4.0/servertests/environment.py b/nfs4.0/servertests/environment.py index 993320d..9852178 100644 --- a/nfs4.0/servertests/environment.py +++ b/nfs4.0/servertests/environment.py @@ -226,6 +226,9 @@ class Environment(testmod.Environment): cmd += ' ' + args os.system(cmd); + def clean_sessions(self): + return + ######################################### debug_fail = False 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: