def test_getTscFrequency_libvirt(self): freq = caps._getTscFrequency() self.assertEqual(freq, "1234000000")
def test_getTscFrequency_no_counter(self): freq = caps._getTscFrequency() self.assertEqual(freq, "")
def test_getTscFrequency_dmesg(self): with open('/tmp/test_dmesg', 'w') as d: d.write('[ 0.000000] tsc: Detected 4321.123 MHz processor') freq = caps._getTscFrequency() self.assertEqual(freq, "4321.123")