Ejemplo n.º 1
0
class TestEsx(TestBase):
    def setUp(self):
        config = Config('test', 'vdsm')

        def fakeSecureConnect(self):
            return MagicMock()

        Vdsm._secureConnect = fakeSecureConnect
        self.vdsm = Vdsm(self.logger, config)
        self.vdsm.prepare()

    def test_connect(self):
        self.vdsm.server.list = MagicMock()
        self.vdsm.server.list.return_value = {
            'status': {
                'code': 0
            },
            'vmList': [{
                'vmId': '1',
                'status': 'Down'
            }, {
                'vmId': '2',
                'status': 'Up'
            }, {
                'vmId': '3',
                'status': 'Up'
            }]
        }
        domains = self.vdsm.listDomains()
        self.assertEquals([d.uuid for d in domains], ['1', '2', '3'])
        self.vdsm.server.list.assert_called_once()
Ejemplo n.º 2
0
class TestEsx(TestBase):
    def setUp(self):
        config = Config('test', 'vdsm')

        def fakeSecureConnect(self):
            return MagicMock()
        Vdsm._secureConnect = fakeSecureConnect
        self.vdsm = Vdsm(self.logger, config)
        self.vdsm.prepare()

    def test_connect(self):
        self.vdsm.server.list = MagicMock()
        self.vdsm.server.list.return_value = {
            'status': {
                'code': 0
            },
            'vmList': [
                {
                    'vmId': '1',
                    'status': 'Down'
                }, {
                    'vmId': '2',
                    'status': 'Up'
                }, {
                    'vmId': '3',
                    'status': 'Up'
                }
            ]
        }
        domains = self.vdsm.listDomains()
        self.assertEquals([d.uuid for d in domains], ['1', '2', '3'])
        self.vdsm.server.list.assert_called_once()
Ejemplo n.º 3
0
    def setUp(self):
        config = Config('test', 'vdsm')

        def fakeSecureConnect(self):
            return MagicMock()

        Vdsm._secureConnect = fakeSecureConnect
        self.vdsm = Vdsm(self.logger, config)
        self.vdsm.prepare()
Ejemplo n.º 4
0
    def setUp(self):
        config = Config('test', 'vdsm')

        def fakeSecureConnect(self):
            return MagicMock()
        Vdsm._secureConnect = fakeSecureConnect
        self.vdsm = Vdsm(self.logger, config)