linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: Fred Isaman <iisaman@netapp.com>
Cc: linux-nfs@vger.kernel.org, Mi Jinlong <mijinlong@cn.fujitsu.com>,
	"J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 3/6] Share showresults.py between 4.0 and 4.1
Date: Thu, 28 Jul 2011 16:03:01 -0400	[thread overview]
Message-ID: <1311883384-20260-4-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1311883384-20260-1-git-send-email-bfields@redhat.com>

Code for showresults.py is identical between 4.0 and 4.1.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 nfs4.0/showresults.py |   74 -------------------------------------------------
 nfs4.1/showresults.py |   74 -------------------------------------------------
 showresults.py        |   74 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 74 insertions(+), 148 deletions(-)
 delete mode 100755 nfs4.0/showresults.py
 delete mode 100755 nfs4.1/showresults.py
 create mode 100755 showresults.py

diff --git a/nfs4.0/showresults.py b/nfs4.0/showresults.py
deleted file mode 100755
index 4b69b0e..0000000
--- a/nfs4.0/showresults.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python
-# showresults.py - redisplay results from nfsv4 server tester output file
-#
-# Requires python 2.3
-# 
-# Written by Fred Isaman <iisaman@citi.umich.edu>
-# Copyright (C) 2004 University of Michigan, Center for 
-#                    Information Technology Integration
-#
-
-
-# Allow to be run stright from package root
-if  __name__ == "__main__":
-    import os.path
-    import sys
-    if os.path.isfile(os.path.join(sys.path[0], 'lib', 'testmod.py')):
-        sys.path.insert(1, os.path.join(sys.path[0], 'lib'))
-
-#import cPickle as pickle
-import pickle
-import testmod
-from optparse import OptionParser
-
-class MyUnpickler(pickle.Unpickler):
-    class Unknown(object):
-        def __init__(self, name):
-            self.name = name
-    
-    def find_class(self, module, name):
-        # Handle function renames gracefully
-        __import__(module)
-        mod = sys.modules[module]
-        try:
-            klass = getattr(mod, name)
-            return klass
-        except:
-            return self.Unknown(name)
-
-def show(filename, opt):
-    fd = file(filename, 'r')
-    p = MyUnpickler(fd)
-    tests = p.load()
-    testmod.printresults(tests, opt)
-
-def scan_options(p):
-    """Parse command line options"""
-    p.add_option("--showpass", action="store_true", default=True,
-                 help="Show passed tests [default]")
-    p.add_option("--hidepass", action="store_false", dest="showpass",
-                 help="Hide passed tests")
-    p.add_option("--showomit", action="store_true", default=False,
-                 help="Show omitted tests")
-    p.add_option("--hideomit", action="store_false", dest="showomit",
-                 help="Hide omitted tests [default]")
-    p.add_option("--showwarn", action="store_true", default=True,
-                 help="Show tests that gave warnings [default]")
-    p.add_option("--hidewarn", action="store_false", dest="showwarn",
-                 help="Hide tests that gave warnings")
-    p.add_option("--showfail", action="store_true", default=True,
-                 help="Show failed tests [default]")
-    p.add_option("--hidefail", action="store_false", dest="showfail",
-                 help="Hide failed tests")
-    return p.parse_args()
-
-def main():
-    p = OptionParser("%prog [options] filename")
-    opt, args = scan_options(p)
-    if not args:
-        p.error("Need a filename")
-    for a in args:
-        show(a, opt)
-
-if __name__ == "__main__":
-    main()
diff --git a/nfs4.1/showresults.py b/nfs4.1/showresults.py
deleted file mode 100755
index 4b69b0e..0000000
--- a/nfs4.1/showresults.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python
-# showresults.py - redisplay results from nfsv4 server tester output file
-#
-# Requires python 2.3
-# 
-# Written by Fred Isaman <iisaman@citi.umich.edu>
-# Copyright (C) 2004 University of Michigan, Center for 
-#                    Information Technology Integration
-#
-
-
-# Allow to be run stright from package root
-if  __name__ == "__main__":
-    import os.path
-    import sys
-    if os.path.isfile(os.path.join(sys.path[0], 'lib', 'testmod.py')):
-        sys.path.insert(1, os.path.join(sys.path[0], 'lib'))
-
-#import cPickle as pickle
-import pickle
-import testmod
-from optparse import OptionParser
-
-class MyUnpickler(pickle.Unpickler):
-    class Unknown(object):
-        def __init__(self, name):
-            self.name = name
-    
-    def find_class(self, module, name):
-        # Handle function renames gracefully
-        __import__(module)
-        mod = sys.modules[module]
-        try:
-            klass = getattr(mod, name)
-            return klass
-        except:
-            return self.Unknown(name)
-
-def show(filename, opt):
-    fd = file(filename, 'r')
-    p = MyUnpickler(fd)
-    tests = p.load()
-    testmod.printresults(tests, opt)
-
-def scan_options(p):
-    """Parse command line options"""
-    p.add_option("--showpass", action="store_true", default=True,
-                 help="Show passed tests [default]")
-    p.add_option("--hidepass", action="store_false", dest="showpass",
-                 help="Hide passed tests")
-    p.add_option("--showomit", action="store_true", default=False,
-                 help="Show omitted tests")
-    p.add_option("--hideomit", action="store_false", dest="showomit",
-                 help="Hide omitted tests [default]")
-    p.add_option("--showwarn", action="store_true", default=True,
-                 help="Show tests that gave warnings [default]")
-    p.add_option("--hidewarn", action="store_false", dest="showwarn",
-                 help="Hide tests that gave warnings")
-    p.add_option("--showfail", action="store_true", default=True,
-                 help="Show failed tests [default]")
-    p.add_option("--hidefail", action="store_false", dest="showfail",
-                 help="Hide failed tests")
-    return p.parse_args()
-
-def main():
-    p = OptionParser("%prog [options] filename")
-    opt, args = scan_options(p)
-    if not args:
-        p.error("Need a filename")
-    for a in args:
-        show(a, opt)
-
-if __name__ == "__main__":
-    main()
diff --git a/showresults.py b/showresults.py
new file mode 100755
index 0000000..b843a5f
--- /dev/null
+++ b/showresults.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+# showresults.py - redisplay results from nfsv4 server tester output file
+#
+# Requires python 2.3
+# 
+# Written by Fred Isaman <iisaman@citi.umich.edu>
+# Copyright (C) 2004 University of Michigan, Center for 
+#                    Information Technology Integration
+#
+
+
+# Allow to be run stright from package root
+if  __name__ == "__main__":
+    import os.path
+    import sys
+    if os.path.isfile(os.path.join(sys.path[0], 'nfs4.1', 'testmod.py')):
+        sys.path.insert(1, os.path.join(sys.path[0], 'nfs4.1'))
+
+#import cPickle as pickle
+import pickle
+import testmod
+from optparse import OptionParser
+
+class MyUnpickler(pickle.Unpickler):
+    class Unknown(object):
+        def __init__(self, name):
+            self.name = name
+    
+    def find_class(self, module, name):
+        # Handle function renames gracefully
+        __import__(module)
+        mod = sys.modules[module]
+        try:
+            klass = getattr(mod, name)
+            return klass
+        except:
+            return self.Unknown(name)
+
+def show(filename, opt):
+    fd = file(filename, 'r')
+    p = MyUnpickler(fd)
+    tests = p.load()
+    testmod.printresults(tests, opt)
+
+def scan_options(p):
+    """Parse command line options"""
+    p.add_option("--showpass", action="store_true", default=True,
+                 help="Show passed tests [default]")
+    p.add_option("--hidepass", action="store_false", dest="showpass",
+                 help="Hide passed tests")
+    p.add_option("--showomit", action="store_true", default=False,
+                 help="Show omitted tests")
+    p.add_option("--hideomit", action="store_false", dest="showomit",
+                 help="Hide omitted tests [default]")
+    p.add_option("--showwarn", action="store_true", default=True,
+                 help="Show tests that gave warnings [default]")
+    p.add_option("--hidewarn", action="store_false", dest="showwarn",
+                 help="Hide tests that gave warnings")
+    p.add_option("--showfail", action="store_true", default=True,
+                 help="Show failed tests [default]")
+    p.add_option("--hidefail", action="store_false", dest="showfail",
+                 help="Hide failed tests")
+    return p.parse_args()
+
+def main():
+    p = OptionParser("%prog [options] filename")
+    opt, args = scan_options(p)
+    if not args:
+        p.error("Need a filename")
+    for a in args:
+        show(a, opt)
+
+if __name__ == "__main__":
+    main()
-- 
1.7.4.1


  parent reply	other threads:[~2011-07-28 20:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28 20:02 [PATCH 0/6] pynfs patches J. Bruce Fields
2011-07-28 20:02 ` [PATCH 1/6] CLNT: provide new_client_session shortcut J. Bruce Fields
2011-07-28 20:03 ` [PATCH 2/6] CLNT: send RECLAIM_COMPLETE when required J. Bruce Fields
2011-07-28 20:03 ` J. Bruce Fields [this message]
2011-07-28 20:03 ` [PATCH 4/6] Make top-level setup.py set up nfs4.0 as well J. Bruce Fields
2011-07-28 20:03 ` [PATCH 5/6] Merge top-level READMEs J. Bruce Fields
2011-07-28 20:45   ` J. Bruce Fields
2011-07-28 20:03 ` [PATCH 6/6] Share testmod.py between nfs4.0 and nfs4.1 J. Bruce Fields
2011-08-01 22:35 ` [PATCH 0/6] pynfs patches J. Bruce Fields
2011-08-09 20:30 ` two more minor " J. Bruce Fields
2011-08-17 20:54   ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311883384-20260-4-git-send-email-bfields@redhat.com \
    --to=bfields@redhat.com \
    --cc=iisaman@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mijinlong@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).