[PATCH 1/2] nfs4client: add test name as a compound tag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



allowes to easy trace tests, e.q: [st_verify.py:_try_mand]

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@xxxxxxx>
---
 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
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux