From: "J. Bruce Fields" <bfields@fieldses.org>
To: iisaman@umich.edu
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 2/2] TESTS: make reboot tests run non-interactively
Date: Mon, 20 Sep 2010 11:04:41 -0400 [thread overview]
Message-ID: <20100920150441.GG4580@fieldses.org> (raw)
In-Reply-To: <20100920150413.GF4580@fieldses.org>
From: J. Bruce Fields <bfields@redhat.com>
If I asked for reboot tests on the commandline, then I shouldn't need to
be asked again.
And if I want something different from the default I'll modify the
script, or add a commandline option. It's more important that the tests
be easy to run unattended.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
lib/nfs4/servertests/st_reboot.py | 49 +++++++++----------------------------
1 files changed, 12 insertions(+), 37 deletions(-)
diff --git a/lib/nfs4/servertests/st_reboot.py b/lib/nfs4/servertests/st_reboot.py
index 4828cb8..758c54c 100644
--- a/lib/nfs4/servertests/st_reboot.py
+++ b/lib/nfs4/servertests/st_reboot.py
@@ -5,29 +5,6 @@ import os
# NOTE - reboot tests are NOT part of the standard test suite
-__asked = None
-
-def _ask(t, env):
- global __asked
- if __asked is None:
- print "Reboot tests are not part of the standard test suite."
- if not env.opts.verbose:
- print "Also, it is probably better to use the -v option"
- print "Are you *sure* you want to run them?"
- answer = sys.stdin.readline()
- c = answer.lower()[0]
- __asked = (c=='y')
- return __asked
-
-def _getcount(t, env):
- print "For test %s, how many clientids to use?" % t.code
- answer = sys.stdin.readline()
- try:
- t.__clientcount = int(answer)
- return True
- except:
- return False
-
def _waitForReboot(c):
"""Wait for server to reboot.
@@ -57,7 +34,7 @@ def testRebootValid(t, env):
"""REBOOT with valid CLAIM_PREVIOUS
FLAGS: reboot
- DEPEND: _ask MKFILE
+ DEPEND: MKFILE
CODE: REBT1
"""
c = env.c1
@@ -79,21 +56,19 @@ def testManyClaims(t, env):
"""REBOOT test
FLAGS: reboot
- DEPEND: _ask _getcount MKDIR MKFILE
+ DEPEND: MKDIR MKFILE
CODE: REBT2
"""
c = env.c1
- if not hasattr(t, '__clientcount'):
- # default if use --force
- t.__clientcount = 5
+ clientcount = 5
pid = str(os.getpid())
basedir = c.homedir + [t.code]
res = c.create_obj(basedir)
check(res, msg="Creating test directory %s" % t.code)
# Make lots of client ids
fhdict = {}
- idlist = ['pynfs%s%06i' % (pid, x) for x in range(t.__clientcount)]
- badids = ['badpynfs%s%06i' % (pid, x) for x in range(t.__clientcount)]
+ idlist = ['pynfs%s%06i' % (pid, x) for x in range(clientcount)]
+ badids = ['badpynfs%s%06i' % (pid, x) for x in range(clientcount)]
for id in idlist:
c.init_connection(id)
fh, stateid = c.create_confirm(t.code, basedir + [id])
@@ -120,7 +95,7 @@ def testRebootWait(t, env):
"""REBOOT with late CLAIM_PREVIOUS should return NFS4ERR_NO_GRACE
FLAGS: reboot
- DEPEND: _ask MKFILE
+ DEPEND: MKFILE
CODE: REBT3
"""
c = env.c1
@@ -142,7 +117,7 @@ def testRebootInvalid(t, env):
"""REBOOT with invalid CLAIM_PREVIOUS
FLAGS: reboot
- DEPEND: _ask MKFILE
+ DEPEND: MKFILE
CODE: REBT4
"""
c = env.c1
@@ -164,7 +139,7 @@ def testEdge1(t, env):
"""REBOOT with first edge condition from RFC 3530
FLAGS: reboot
- DEPEND: _ask MKFILE
+ DEPEND: MKFILE
CODE: REBT5
"""
c1 = env.c1
@@ -210,7 +185,7 @@ def testEdge2(t, env):
"""REBOOT with second edge condition from RFC 3530
FLAGS: reboot
- DEPEND: _ask MKFILE
+ DEPEND: MKFILE
CODE: REBT6
"""
c1 = env.c1
@@ -257,7 +232,7 @@ def testRootSquash(t, env):
"""REBOOT root squash does not work after grace ends?
FLAGS: reboot
- DEPEND: _ask MKFILE MKDIR
+ DEPEND: MKFILE MKDIR
CODE: REBT7
"""
# Note this assumes we can legally use uid 0...either we are using
@@ -295,7 +270,7 @@ def testValidDeleg(t, env):
"""REBOOT with read delegation and reclaim it
FLAGS: reboot delegations
- DEPEND: _ask MKFILE
+ DEPEND: MKFILE
CODE: REBT8
"""
from st_delegation import _get_deleg
@@ -325,7 +300,7 @@ def testRebootMultiple(t, env):
"""REBOOT multiple times with valid CLAIM_PREVIOUS
FLAGS: reboot
- DEPEND: _ask MKFILE
+ DEPEND: MKFILE
CODE: REBT10
"""
c = env.c1
--
1.7.0.4
next prev parent reply other threads:[~2010-09-20 15:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-20 3:36 hang on server boot J. Bruce Fields
2010-09-20 15:03 ` J. Bruce Fields
2010-09-20 15:04 ` [PATCH 1/2] TESTS: fix error when rebootscript defined but not rebootargs J. Bruce Fields
2010-09-20 15:04 ` J. Bruce Fields [this message]
2010-09-20 15:05 ` hang on server boot J. Bruce Fields
2010-09-21 16:11 ` [PATCH] CLNT: preliminary reboot test 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=20100920150441.GG4580@fieldses.org \
--to=bfields@fieldses.org \
--cc=iisaman@umich.edu \
--cc=linux-nfs@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.