Lines Matching +full:self +full:- +full:test

31     def __init__(self):  argument
32 self.config = None
33 self.logger = None
34 self.successes = 0
35 self.skips = 0
36 self.failures = 0
37 self.exceptions = 0
38 self.clnt_tab = {}
39 self.mkclient = None
40 self.stop = False
41 self.gid = 0
43 def ccc(self, cid=None): argument
49 In any case we return the now-connected client, plus the
54 pair = self.clnt_tab.get(cid)
56 clnt = self.mkclient()
58 self.clnt_tab[cid] = pair
65 def dcc(self, cid=None): argument
71 for cid in list(self.clnt_tab.keys()):
72 self.dcc(cid)
73 pair = self.clnt_tab.get(cid)
78 del self.clnt_tab[cid]
80 def ccs(self, cid=None): argument
87 pair = self.ccc(cid)
90 # No session yet - establish one. Note, this may fail.
91 section = None if cid is None else ('client-' + cid)
92 aname = getconf(self.config, section, 'aname', '')
93 uname = getconf(self.config, section, 'uname', '')
95 n_uname = getint(self.config, section, 'n_uname', 1001)
172 "used in succ/fail/skip - skips rest of testcase with"
177 Start a test case. Most callers must then do a ccs() to connect.
179 A failed test will generally disconnect from the server; a
182 def __init__(self, name, tstate): argument
183 self.name = name
184 self.status = None
185 self.detail = None
186 self.tstate = tstate
187 self._shutdown = None
188 self._autoclunk = None
189 self._acconn = None
191 def auto_disconnect(self, conn): argument
192 self._shutdown = conn
194 def succ(self, detail=None): argument
196 self.status = 'SUCC'
197 self.detail = detail
200 def fail(self, detail): argument
202 self.status = 'FAIL'
203 self.detail = detail
206 def skip(self, detail=None): argument
208 self.status = 'SKIP'
209 self.detail = detail
212 def autoclunk(self, fid): argument
213 "mark fid to be closed/clunked on test exit"
214 if self._acconn is None:
216 self._autoclunk.append(fid)
218 def trace(self, msg, *args, **kwargs): argument
219 "add tracing info to log-file output"
221 self.tstate.logger.log(level, ' ' + msg, *args, **kwargs)
223 def ccs(self): argument
224 "call tstate ccs, turn socket.error connect failure into test fail"
226 self.detail = 'connecting'
227 ret = self.tstate.ccs()
228 self.detail = None
229 self._acconn = ret
232 self.fail(str(err))
234 def __enter__(self): argument
235 self.tstate.logger.log(logging.DEBUG, 'ENTER: %s', self.name)
236 self._autoclunk = []
237 return self
239 def __exit__(self, exc_type, exc_val, exc_tb): argument
240 tstate = self.tstate
248 if self.status is None:
249 self.status = 'EXCP'
251 self.status += ' EXC'
253 # timeout/eof - best guess is that we crashed the server!
264 if self.status is None:
265 self.status = 'SUCC'
266 if self.status == 'SUCC':
269 elif self.status == 'SKIP':
275 tstate.logger.log(level, '%s: %s', self.status, self.name)
276 if self.detail:
277 tstate.logger.log(level, ' detail: %s', self.detail)
281 for fid in self._autoclunk:
282 self._acconn.clunk(fid, ignore_error=True)
283 if self._shutdown:
284 self._shutdown.shutdown()
291 parser.add_argument('-c', '--config',
307 failed = set(ok) - set(args.config)
384 # can't test any further, but this might be success
394 section = 'attach-with-bad-afid'
425 'test', 'tests')))
445 # test case.
467 # the dot-L readdir().
469 # The test case will fail if we don't have permission to remove
495 # Note that this test may fail for the wrong reason if /dir
501 tc.skip('cannot test dot-L mkdir on {0}'.format(clnt.proto))
548 # This test is not really thorough enough, need to test
549 # all combinations of settings. Should also test that
582 # this test should be much later, but we know the current