示例#1
0
def test_available_domains_with_pkg_dram_rapl_api_two_cpu_return_correct_values(fs_pkg_dram_two_socket):
    returned_values = RaplDevice.available_domains()
    correct_values = [RaplPackageDomain(0), RaplDramDomain(0), RaplPackageDomain(1), RaplDramDomain(1)]
    assert sorted(correct_values) == sorted(returned_values)
示例#2
0
def test_available_domains_with_pkg_uncore_and_dram_rapl_api_return_correct_values(fs_pkg_dram_uncore_one_socket):
    returned_values = RaplDevice.available_domains()
    correct_values = [RaplPackageDomain(0), RaplDramDomain(0), RaplUncoreDomain(0)]
    assert sorted(correct_values) == sorted(returned_values)
示例#3
0
def test_available_domains_with_pkg_psys_rapl_api_return_correct_values(fs_pkg_psys_one_socket):
    returned_values = RaplDevice.available_domains()
    correct_values = [RaplPackageDomain(0)]
    assert sorted(correct_values) == sorted(returned_values)
示例#4
0
def test_available_domains_with_no_rapl_api_raise_NoSuchEnergyDeviceError(empty_fs):
    with pytest.raises(NoSuchEnergyDeviceError):
        RaplDevice.available_domains()