Files
Nathaniel Mitchell a032f04630 Update haldata and msr hal/cmd/tests
Change haldata to use cpuid mfgstr
Update MSR hal/cmd/tests

Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2025-02-18 12:53:25 -08:00

44 lines
1.4 KiB
Python

# CHIPSEC: Platform Security Assessment Framework
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; Version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
import unittest
from tests.software import mock_helper, util
class TestMSRChipsecUtil(util.TestChipsecUtil):
"""Test the MSR commands exposed by chipsec_utils."""
def test_msr(self):
class MSRHelper(mock_helper.TestHelper):
def get_threads_count(self):
return 1
def read_msr(self, thread_id, msr_addr):
if msr_addr == 0x2FF:
return [0x1234, 0xcdef]
else:
return [0x0, 0x0]
self._chipsec_util("msr 0x2FF", MSRHelper)
self._assertLogValue("EAX", "00001234")
self._assertLogValue("EDX", "0000CDEF")
if __name__ == '__main__':
unittest.main()