def testSubset(self): random.seed(1) r = runlists.call_by_name('run001', '3.5.1-5', 'vagrant', 4) self.assertEqual(len(r),4) self.assertEqual(r[0][0]['boxtype'], 'cal-centos58') self.assertEqual(r[0][2].id(), 'basic001') self.assertEqual(r[1][0]['boxtype'], 'cal-precise64') self.assertEqual(r[2][0]['boxtype'], 'cal-precise64') self.assertEqual(r[3][0]['boxtype'], 'cal-centos6')
def main(argv=None): try: opts, args = getopt.getopt(sys.argv[1:], "lr:s", []) except getopt.GetoptError as err: # print help information and exit: print str(err) # will print something like "option -a not recognized" usage() sys.exit(2) numrand = 0 enterprise = True for o, a in opts: if o == "-l": for r in runlists.list_all(): print '%-20s : %s' % (r[0], r[1]) return 0 elif o == "-r": numrand = int(a) elif o == "-s": enterprise = False else: assert False, "unhandled option" if len(args) < 3: usage() version = args[0] functor = args[1] logfile = args[2] if not runlists.__dict__.has_key(functor): print "No functor name %s in runlist" % functor mgr = TestManager(logfile) final_list = runlists.call_by_name(functor, version, 'vagrant', num=numrand, enterprise=enterprise) return mgr.run_all(final_list)
def testRunRandom(self): random.seed(1) r = runlists.call_by_name('run_random_basic002', '4.5.1-3', 'vagrant', 4) self.assertEqual(len(r),4)
def testHadoop(self): r = runlists.call_by_name('run_hadoop_basic', 'Latest', 'vagrant') self.assertEqual(len(r),8)
def testUpgrade(self): r = runlists.call_by_name('run_upgrade_suite', '3.5.1-5', 'vagrant') self.assertEqual(len(r),7)
def testSmoke(self): r = runlists.call_by_name('run_chef_smoketest', '3.5.1-5', 'vagrant') self.assertEqual(len(r),7)