TianoCore EDK2 master
|
#include "EfiMpServicesUnitTestCommom.h"
Go to the source code of this file.
Common code to test EdkiiPeiMpServices2Ppi and EfiMpServiceProtocol.
Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EfiMpServicesUnitTestCommom.c.
EFI_STATUS AddCommonTestCase | ( | IN UNIT_TEST_FRAMEWORK_HANDLE | Framework, |
IN MP_SERVICE_UT_CONTEXT * | Context | ||
) |
Create test suite and unit tests for both EdkiiPeiMpServices2Ppi and EfiMpServiceProtocol.
[in] | Framework | A pointer to the framework that is being persisted. |
[in] | Context | A pointer to the private data buffer. |
EFI_SUCCESS | Create test suite and unit tests successfully. |
Others | Create test suite and unit tests unsuccessfully. |
Definition at line 1661 of file EfiMpServicesUnitTestCommom.c.
VOID EFIAPI CheckUTContext | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Cleanup routine for Unit test function. If any processor is disabled unexpectedly then reenable it.
[in] | Context | Context pointer for this test. |
Definition at line 117 of file EfiMpServicesUnitTestCommom.c.
Empty procedure to be run on specified CPU.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 311 of file EfiMpServicesUnitTestCommom.c.
VOID EFIAPI FreeUTContext | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Cleanup routine for Unit test function. It will be called by the last "AddTestCase" to restore AP state and free pointer.
[in] | Context | Context pointer for this test. |
Definition at line 187 of file EfiMpServicesUnitTestCommom.c.
Infinite loop procedure to be run on specified CPU.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 293 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI InitUTContext | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Prep routine for Unit test function. To save the ProcessorNumber of disabled AP and temporarily enable it.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | Prep routine runs successful. |
UNIT_TEST_ERROR_TEST_FAILED | Prep routine runs unsuccessful. |
Definition at line 23 of file EfiMpServicesUnitTestCommom.c.
Procedure to run MP service EnableDisableAP on AP.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 368 of file EfiMpServicesUnitTestCommom.c.
Procedure to run MP service GetNumberOfProcessors on AP.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 323 of file EfiMpServicesUnitTestCommom.c.
Procedure to run MP service GetProcessorInfo on AP.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 346 of file EfiMpServicesUnitTestCommom.c.
Procedure to run MP service StartupAllAPs on AP.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 413 of file EfiMpServicesUnitTestCommom.c.
Procedure to run MP service StartupThisAP on AP.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 390 of file EfiMpServicesUnitTestCommom.c.
Procedure to run MP service SwitchBSP on AP.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 436 of file EfiMpServicesUnitTestCommom.c.
Produce to store the ProcessorNumber of AP execution order in CommonBuffer.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 263 of file EfiMpServicesUnitTestCommom.c.
Produce to store ProcessorNumber in the corresponding location of CommonBuffer.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 234 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestEnableDisableAP1 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service EnableDisableAP. When called with BSP number, the return status should be EFI_INVALID_PARAMETER. When called with a nonexistent processor handle, the return status should be EFI_NOT_FOUND. The AP should be really Enable/Disabled.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 774 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestEnableDisableAP2 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service EnableDisableAP. When run this procedure on AP, the return status should be EFI_DEVICE_ERROR.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 842 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestEnableDisableAP3 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service EnableDisableAP. When run this procedure on AP, the return status should be EFI_DEVICE_ERROR.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 885 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestGetNumberOfProcessors1 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service GetNumberOfProcessors. NumberOfProcessors should be greater that 0 and not less than NumberOfEnabledProcessors.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 518 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestGetNumberOfProcessors2 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service GetNumberOfProcessors. When this service is called from an AP, the return status should be EFI_DEVICE_ERROR.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 552 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestGetNumberOfProcessors3 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service GetNumberOfProcessors. Call EnableDisableAP() to change the number of enabled AP.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 595 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestGetProcessorInfo1 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service GetProcessorInfo. When all the parameters are valid, all reserved bits of StatusFlag in ProcessorInfoBuffer should be set to zero. When all the parameters are valid, the StatusFlag should not have an invalid value (The BSP can never be in the disabled state.). When called with nonexistent processor handle, the return status should be EFI_NOT_FOUND.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 682 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestGetProcessorInfo2 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service GetProcessorInfo. When this service is called from an AP, the return status should be EFI_DEVICE_ERROR.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 729 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs1 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service StartupAllAPs. All APs should execute the Procedure when called by StartupAllAPs.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1157 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs2 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service StartupAllAPs. When called in single thread, the return status should be EFI_SUCCESS and AP executes in ascending order of processor handle number.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1200 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs3 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service StartupAllAPs. When this service is called from an AP, the return status should be EFI_DEVICE_ERROR.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1246 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs4 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service StartupAllAPs. When called with all AP timeout, the return status should be EFI_TIMEOUT.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1289 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs5 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service StartupAllAPs. When called with the empty Procedure on all disabled APs, the return status should be EFI_NOT_STARTED.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1331 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestStartupThisAP1 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service StartupThisAP. When called to startup a BSP, the return status should be EFI_INVALID_PARAMETER. When called with a nonexistent processor handle, the return status should be EFI_NOT_FOUND. The requested AP should execute the Procedure when called by StartupThisAP.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 955 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestStartupThisAP2 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service StartupThisAP. When this service is called from an AP, the return status should be EFI_DEVICE_ERROR.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1007 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestStartupThisAP3 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service StartupThisAP. When timeout expired before the requested AP has finished, the return status should be EFI_TIMEOUT.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1050 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestStartupThisAP4 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service StartupThisAP. When called with disabled AP, the return status should be EFI_INVALID_PARAMETER.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1091 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestSwitchBSP1 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service SwitchBSP. When switch current BSP to be BSP, the return status should be EFI_INVALID_PARAMETER. When switch nonexistent processor to be BSP, the return status should be EFI_NOT_FOUND. After switch BSP, all APs(includes new AP) should execute the Procedure when called by StartupAllAP.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1397 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestSwitchBSP2 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service SwitchBSP. When run this procedure on AP, the return status should be EFI_DEVICE_ERROR.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1463 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestSwitchBSP3 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service SwitchBSP. When switch a disabled AP to be BSP, the return status should be EFI_INVALID_PARAMETER.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1506 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestSwitchBSP4 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service SwitchBSP. When SwitchBSP and EnableOldBSP is TRUE, the new BSP should be in the enabled state and the old BSP should be in the enabled state. When SwitchBSP and EnableOldBSP is False, the new BSP should be in the enabled state and the old BSP should be in the disabled state.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1564 of file EfiMpServicesUnitTestCommom.c.
UNIT_TEST_STATUS EFIAPI TestWhoAmI1 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of MP service WhoAmI. The range of ProcessorNumber should be from 0 to NumberOfCPUs minus 1. The ProcessorNumbers of all CPUs are unique.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 464 of file EfiMpServicesUnitTestCommom.c.