Esempio n. 1
0
    def test_get_samples_with_empty_stats(self):
        self._mock_inspect_instance(virt_inspector.NoDataException())
        mgr = manager.AgentManager(0, self.CONF)
        pollster = instance_stats.MemorySwapInPollster(self.CONF)

        def all_samples():
            return list(pollster.get_samples(mgr, {}, [self.instance]))
Esempio n. 2
0
        def _check_memory_swap_in(expected_swap_in):
            pollster = instance_stats.MemorySwapInPollster(self.CONF)

            samples = list(pollster.get_samples(mgr, {}, [self.instance]))
            self.assertEqual(1, len(samples))
            self.assertEqual(set(['memory.swap.in']),
                             set([s.name for s in samples]))
            self.assertEqual(expected_swap_in, samples[0].volume)
    def test_get_samples_with_empty_stats(self):
        self._mock_inspect_instance(virt_inspector.NoDataException())
        mgr = manager.AgentManager(0, self.CONF)
        pollster = instance_stats.MemorySwapInPollster(self.CONF)

        def all_samples():
            return list(pollster.get_samples(mgr, {}, [self.instance]))

        # self.assertNotRaises(plugin_base.PollsterPermanentError, all_samples)
        all_samples()