def test_tunedadm_list_parse(self): tuned_list_output = """\ Available profiles: - balanced - General non-specialized tuned profile - desktop - Optmize for the desktop use-case - latency-performance - Optimize for deterministic performance\ at the cost of increased power consumption - network-latency - Optimize for deterministic performance\ at the cost of increased power consumption, focused on low latency network\ performance - network-throughput - Optimize for streaming network throughput.\ Generally only necessary on older CPUs or 40G+ networks. - powersave - Optimize for low power consumption - throughput-performance - Broadly applicable tuning that provides\ excellent performance across a variety of common server workloads.\ This is the default profile for RHEL7. - virtual-guest - Optimize for running inside a virtual guest. - virtual-host - Optimize for running KVM guests Current active profile: throughput-performance""" profiles = powermanag.parse_tunedadm_list(tuned_list_output) self.assertEqual(9, len(profiles)) self.assertIn('balanced', profiles) self.assertIn('desktop', profiles) self.assertIn('latency-performance', profiles) self.assertIn('network-latency', profiles) self.assertIn('network-throughput', profiles) self.assertIn('powersave', profiles) self.assertIn('throughput-performance', profiles) self.assertIn('virtual-guest', profiles) self.assertIn('virtual-host', profiles)
def test_tunedadm_list_parse(self): tuned_list_output = """\ Available profiles: - balanced - General non-specialized tuned profile - desktop - Optmize for the desktop use-case - latency-performance - Optimize for deterministic performance\ at the cost of increased power consumption - network-latency - Optimize for deterministic performance\ at the cost of increased power consumption, focused on low latency network\ performance - network-throughput - Optimize for streaming network throughput.\ Generally only necessary on older CPUs or 40G+ networks. - powersave - Optimize for low power consumption - throughput-performance - Broadly applicable tuning that provides\ excellent performance across a variety of common server workloads.\ This is the default profile for RHEL7. - virtual-guest - Optimize for running inside a virtual guest. - virtual-host - Optimize for running KVM guests Current active profile: throughput-performance""" profiles = powermanag.parse_tunedadm_list(tuned_list_output) self.assertEqual(9, len(profiles)) self.assertIn('balanced', profiles) self.assertIn('desktop', profiles) self.assertIn('latency-performance', profiles) self.assertIn('network-latency', profiles) self.assertIn('network-throughput', profiles) self.assertIn('powersave', profiles) self.assertIn('throughput-performance', profiles) self.assertIn('virtual-guest', profiles) self.assertIn('virtual-host', profiles)
def test_old_tunedadm_list_parse(self): tuned_list_output = """\ Available profiles: - balanced - desktop - latency-performance - network-latency - network-throughput - powersave - throughput-performance - virtual-guest - virtual-host Current active profile: throughput-performance""" profiles = powermanag.parse_tunedadm_list(tuned_list_output) self.assertEqual(9, len(profiles)) self.assertIn('balanced', profiles) self.assertIn('desktop', profiles) self.assertIn('latency-performance', profiles) self.assertIn('network-latency', profiles) self.assertIn('network-throughput', profiles) self.assertIn('powersave', profiles) self.assertIn('throughput-performance', profiles) self.assertIn('virtual-guest', profiles) self.assertIn('virtual-host', profiles)
def test_old_tunedadm_list_parse(self): tuned_list_output = """\ Available profiles: - balanced - desktop - latency-performance - network-latency - network-throughput - powersave - throughput-performance - virtual-guest - virtual-host Current active profile: throughput-performance""" profiles = powermanag.parse_tunedadm_list(tuned_list_output) self.assertEqual(9, len(profiles)) self.assertIn('balanced', profiles) self.assertIn('desktop', profiles) self.assertIn('latency-performance', profiles) self.assertIn('network-latency', profiles) self.assertIn('network-throughput', profiles) self.assertIn('powersave', profiles) self.assertIn('throughput-performance', profiles) self.assertIn('virtual-guest', profiles) self.assertIn('virtual-host', profiles)