Esempio n. 1
0
    def testBasic(self):
        # turn on unit-test mode so that we don't actually run vagrant commands
        common.props['vmi.vagrantvmi.unit-test'] = True
        
        cfg1 = configs.multi_1um_2pm('3.5.1-5')
        cfg1['boxtype'] = 'cal-precise64'
        cfg2 = configs.multi_1um_2pm('3.5.1-5')
        cfg2['boxtype'] = 'cal-lucid64'
        runlist = [ (cfg1, 'vagrant', tests.basic001()),
                    (cfg2, 'vagrant', tests.basic001()) ]

        mgrfile = '/tmp/%s_test_testmgr.log' % getpass.getuser()
        mgr = TestManager(mgrfile)

        # need to disable real system calls for unit-test
        utils.syscall_cb = mysyscb

        self.assertTrue( mgr.run_all(runlist) )
        self.assertEqual(mgr.test_report().passing(), 6)
        self.assertEqual(mgr.test_report().failing(), 0)
        self.assertEqual(mgr.test_report().total(), 6)
        utils.syscall_cb = None

        os.remove(mgrfile)
Esempio n. 2
0
    def testBasicEm(self):
        # turn on unit-test mode so that we don't actually run vagrant commands
        common.props['vmi.vagrantvmi.unit-test'] = True
        
        cfg1 = configs.multi_1um_2pm('4.5.0-1')
        cfg1['boxtype'] = 'cal-precise64'
        cfg1['binary'] = True
        cfg1['em'] = { 'present' : True, 'invm' : True, 'emhost' : 'localhost', 'emport' : 9090, 'boxtype' : 'cal-centos6', 'oamserver_role' : "pm1", "role" : "em1" }
        runlist = [ (cfg1, 'vagrant', tests.basic001()) ]

        mgrfile = '/tmp/%s_test_testmgr.log' % getpass.getuser()
        mgr = TestManager(mgrfile)

        # need to disable real system calls for unit-test
        utils.syscall_cb = mysyscb

        ret = mgr.run_all(runlist)
        self.assertTrue( ret )
        self.assertEqual(mgr.test_report().passing(), 10)
        self.assertEqual(mgr.test_report().failing(), 0)
        self.assertEqual(mgr.test_report().total(), 10)
        utils.syscall_cb = None

        os.remove(mgrfile)