コード例 #1
0
    def test_ppc_g5_cpu_info_same_as_last_known_cpu_info(self):
        """Test that one message is queued for duplicate G5 CPU info."""
        filename = self.makeFile(self.SMP_PPC_G5)
        plugin = ProcessorInfo(delay=0.1,
                               machine_name="ppc64",
                               source_filename=filename)
        self.monitor.add(plugin)
        plugin.run()
        plugin.run()

        messages = self.mstore.get_pending_messages()
        self.assertEqual(len(messages), 1)

        message = messages[0]
        self.assertEqual(message["type"], "processor-info")
        self.assertEqual(len(message["processors"]), 2)

        processor_0 = message["processors"][0]
        self.assertEqual(len(processor_0), 2)
        self.assertEqual(processor_0["model"], "PPC970FX, altivec supported")
        self.assertEqual(processor_0["processor-id"], 0)

        processor_1 = message["processors"][1]
        self.assertEqual(len(processor_1), 2)
        self.assertEqual(processor_1["model"], "PPC970FX, altivec supported")
        self.assertEqual(processor_1["processor-id"], 1)
コード例 #2
0
 def test_unchanging_data(self):
     filename = self.makeFile(self.UP_PENTIUM_M)
     plugin = ProcessorInfo(delay=0.1,
                            machine_name="i686",
                            source_filename=filename)
     self.monitor.add(plugin)
     plugin.run()
     plugin.run()
     self.assertEqual(len(self.mstore.get_pending_messages()), 1)
コード例 #3
0
 def test_resynchronize(self):
     """
     The "resynchronize" reactor message should cause the plugin to
     send fresh data.
     """
     self.mstore.set_accepted_types(["processor-info"])
     plugin = ProcessorInfo()
     self.monitor.add(plugin)
     plugin.run()
     self.reactor.fire("resynchronize", scopes=["cpu"])
     plugin.run()
     messages = self.mstore.get_pending_messages()
     self.assertEqual(len(messages), 2)