示例#1
0
    def test_is_sstcp_enabled(self):
        class SYS:
            def __init__(self, enabled):
                self.epp_enabled = enabled
                self.sst_bf_enabled = enabled

        with mock.patch("pwr.get_system",
                        return_value=SYS(True)) as mock_get_system:
            assert power.is_sstcp_enabled()
            mock_get_system.assert_called_once()

        with mock.patch("pwr.get_system",
                        return_value=SYS(False)) as mock_get_system:
            assert not power.is_sstcp_enabled()
            mock_get_system.assert_called_once()

        with mock.patch("pwr.get_system",
                        return_value=None) as mock_get_system:
            assert not power.is_sstcp_enabled()
            mock_get_system.assert_called_once()

        with mock.patch("pwr.get_system",
                        side_effect=IOError('Test')) as mock_get_system:
            assert not power.is_sstcp_enabled()
            mock_get_system.assert_called_once()
示例#2
0
def detect_supported_caps():
    """
    Generates list of supported caps

    Returns
        list of supported caps
    """
    result = []
    # generate list of supported capabilities

    # Intel RDT L3 CAT
    if common.PQOS_API.is_l3_cat_supported():
        result.append(common.CAT_CAP)

    # Intel RDT MBA
    if common.PQOS_API.is_mba_supported():
        result.append(common.MBA_CAP)

    if sstbf.is_sstbf_enabled():
        result.append(common.SSTBF_CAP)

    if power.is_sstcp_enabled():
        result.append(common.POWER_CAP)

    return result