def test_basic001(self): # reset list of syscalls #print '++++++++++ DEBUG: starting test_basic001' global mycmds mycmds = [] mgr = ClusterMgr() c1 = mgr.alloc_new('testsub1',self._defcfg,'vagrant') utils.syscall_cb = mysyscb c1.start() tr = TestRunner() testsuite = tests.call_by_name('basic001') result = tr.run(c1, testsuite) print 'Status:', 'Pass' if result.passfail() else 'Fail' # now check that the right system calls were executed callpats = [ 'vagrant.*up', 'ssh.*echo', 'ssh.*dbFunctional.sh' ] self.check_syscalls(callpats) utils.syscall_cb = None mgr.destroy(c1)
def testBasicWithStep(self): tr = TestRunner() tsstub = TestSuiteStepsStub('unit') trstub = TestReportStub() result = tr.run(0, tsstub, testreport=trstub) self.assertEqual(result.passfail(), True) self.assertEqual(len(trstub.results), 3)
def run(self, args): if not len(args) == 2: self.usage() cluster = self._attach_by_name(args[0]) tr = TestRunner() testsuite = tests.call_by_name(args[1]) result = tr.run(cluster, testsuite) print "Status:", "Pass" if result.passfail() else "Fail"
def test_basic002(self): # reset list of syscalls #print '++++++++++ DEBUG: starting test_basic002' global mycmds mycmds = [] mgr = ClusterMgr() c1 = mgr.alloc_new('testbasic002',self._defcfg,'vagrant') utils.syscall_cb = mysyscb c1.start() tr = TestRunner() testsuite = tests.call_by_name('basic002') result = tr.run(c1, testsuite) print 'Status:', 'Pass' if result.passfail() else 'Fail' # now check that the right system calls were executed callpats = [ 'vagrant.*up', 'ssh.*echo', 'ssh.*upgradeTest2.sh', 'ssh.*calpontConsole shutdown y', 'ssh.*sleep 5', 'ssh.*infinidb_not_running.sh', 'ssh.*calpontConsole startsystem', 'ssh.*sleep 5', 'ssh.*upgradeTest2.sh', 'ssh.*calpontConsole restartsystem y', 'ssh.*sleep 5', 'ssh.*upgradeTest2.sh', 'ssh.*calpontConsole stopsystem y', 'ssh.*sleep 5', 'ssh.*calpontConsole startsystem', 'ssh.*sleep 5', 'ssh.*upgradeTest2.sh', 'ssh.*calpontConsole shutdown y', 'ssh.*sleep 5', 'ssh.*infinidb_not_running.sh', 'vagrant halt', 'vboxmanage startvm.*headless', 'vboxmanage startvm.*headless', 'ssh.*healthcheck', 'ssh.*upgradeTest2.sh', ] self.check_syscalls(callpats) utils.syscall_cb = None mgr.destroy(c1)
def testNegativeExc(self): tr = TestRunner() tsstub = TestSuiteStub(1,True, withexc=True) result = tr.run(0, tsstub) self.assertEqual(result.passfail(), False) self.assertAlmostEqual(result.elapsed().total_seconds(), 1.0, 1)
def testBasic(self): tr = TestRunner() tsstub = TestSuiteStub(1,True) result = tr.run(0, tsstub) self.assertEqual(result.passfail(), True) self.assertAlmostEqual(result.elapsed().total_seconds(), 1.0, 1)