From patchwork Mon Jun 23 13:56:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mkrtchyan, Tigran" X-Patchwork-Id: 4403361 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C7D8BBEEAA for ; Mon, 23 Jun 2014 13:56:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B98D4200C1 for ; Mon, 23 Jun 2014 13:56:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AEDC6201D3 for ; Mon, 23 Jun 2014 13:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753888AbaFWN4J (ORCPT ); Mon, 23 Jun 2014 09:56:09 -0400 Received: from smtp-o-3.desy.de ([131.169.56.156]:42452 "EHLO smtp-o-3.desy.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754058AbaFWN4I (ORCPT ); Mon, 23 Jun 2014 09:56:08 -0400 Received: from smtp-map-3.desy.de (smtp-map-3.desy.de [131.169.56.68]) by smtp-o-3.desy.de (DESY-O-3) with ESMTP id 938FC2808E4 for ; Mon, 23 Jun 2014 15:56:07 +0200 (CEST) Received: from ZITSWEEP1.win.desy.de (zitsweep1.win.desy.de [131.169.97.95]) by smtp-map-3.desy.de (DESY_MAP_3) with ESMTP id 858C710D9 for ; Mon, 23 Jun 2014 15:56:07 +0200 (MEST) Received: from smtp-intra-3.desy.de (lb-40-26.desy.de) by ZITSWEEP1.win.desy.de (Clearswift SMTPRS 5.5.0) with ESMTP id ; Mon, 23 Jun 2014 15:56:07 +0200 Received: from anahit.desy.de (anahit.desy.de [131.169.185.68]) by smtp-intra-3.desy.de (DESY-INTRA-3) with ESMTP id 3C0AD10D9; Mon, 23 Jun 2014 15:56:07 +0200 (MEST) From: Tigran Mkrtchyan To: linux-nfs@vger.kernel.org, bfields@fieldses.org Cc: Tigran Mkrtchyan Subject: [PATCH 1/2] nfs4client: add test name as a compound tag Date: Mon, 23 Jun 2014 15:56:02 +0200 Message-Id: <1403531763-13441-2-git-send-email-tigran.mkrtchyan@desy.de> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1403531763-13441-1-git-send-email-tigran.mkrtchyan@desy.de> References: <1403531763-13441-1-git-send-email-tigran.mkrtchyan@desy.de> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD,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 allowes to easy trace tests, e.q: [st_verify.py:_try_mand] Signed-off-by: Tigran Mkrtchyan --- nfs4.1/nfs4client.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py index 6912565..c536897 100644 --- a/nfs4.1/nfs4client.py +++ b/nfs4.1/nfs4client.py @@ -9,6 +9,8 @@ import nfs_ops import time, struct import threading import hmac +import inspect +from os.path import basename from nfs4commoncode import CBCompoundState as CompoundState, \ cb_encode_status as encode_status, \ cb_encode_status_by_name as encode_status_by_name @@ -82,6 +84,7 @@ class NFS4Client(rpc.Client, rpc.Server): return self.send_call(pipe, 1, p.get_buffer(), credinfo) def compound(self, *args, **kwargs): + self.tag = self.create_tag() xid = self.compound_async(*args, **kwargs) pipe = kwargs.get("pipe", None) res = self.listen(xid, pipe=pipe) @@ -292,6 +295,14 @@ class NFS4Client(rpc.Client, rpc.Server): s.compound([op4.reclaim_complete(FALSE)]) return s + def create_tag(self): + current_stack = inspect.stack() + stackid = 0 + while basename(current_stack[stackid][1]) == 'environment.py' or basename(current_stack[stackid][1]) == 'nfs4client.py': + stackid = stackid + 1 + test_name = '%s:%s' % (basename(current_stack[stackid][1]), current_stack[stackid][3]) + return test_name + class ClientStateProtection(object): def __init__(self, p_res, p_arg): self.type = p_res.spr_how