From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: xianhuix.liu@intel.com) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by groups.io with SMTP; Tue, 24 Sep 2019 01:50:57 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 01:50:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,543,1559545200"; d="scan'208";a="388788072" Received: from xianhu2x-mobl.ccr.corp.intel.com ([10.239.196.243]) by fmsmga005.fm.intel.com with ESMTP; 24 Sep 2019 01:50:55 -0700 From: "xianhui liu" To: devel@edk2.groups.io Cc: Heinrich Schuchardt , Supreeth Venkatesh , Eric Jin Subject: [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check Date: Tue, 24 Sep 2019 16:50:52 +0800 Message-Id: <20190924085052.8484-1-xianhuix.liu@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2061 check MediaPresent while MediaPresentSupported is TRUE sync change from EFI to IHV SimpleNetworkBBTestFunction Cc: Heinrich Schuchardt Cc: Supreeth Venkatesh Cc: Eric Jin Signed-off-by: xianhui liu --- .../BlackBoxTest/SimpleNetworkBBTestFunction.c | 64 +++++++++++----------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c index b4c7b5ee..8559e894 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c @@ -1888,38 +1888,40 @@ BBTestGetStatusFunctionTest ( Status = SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &TxBuf); Status1 = SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &TxBuf); - if (SnpInterface->Mode->MediaPresent == FALSE) { - if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) && (InterruptStatus == 0)) { - AssertionType = EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType = EFI_TEST_ASSERTION_FAILED; - } - } else { - if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) { - AssertionType = EFI_TEST_ASSERTION_PASSED; - if (InterruptStatus & - ~( EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT | - EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT | - EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT | - EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT)) { - AssertionType = EFI_TEST_ASSERTION_FAILED; - } - } else { - AssertionType = EFI_TEST_ASSERTION_FAILED; - } + if (SnpInterface->Mode-> MediaPresentSupported == TRUE) { + if (SnpInterface->Mode->MediaPresent == FALSE) { + if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS) && (InterruptStatus == 0)) { + AssertionType = EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType = EFI_TEST_ASSERTION_FAILED; + } + } else { + if ((Status1 == EFI_SUCCESS) && (Status == EFI_SUCCESS)) { + AssertionType = EFI_TEST_ASSERTION_PASSED; + if (InterruptStatus & + ~( EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT | + EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT | + EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT | + EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT)) { + AssertionType = EFI_TEST_ASSERTION_FAILED; + } + } else { + AssertionType = EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid022, + L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke GetStatus() and verify interface correctness within test case", + L"%a:%d:Status - %r, Status1 - %r, InterruptStatus - %d", + __FILE__, + (UINTN)__LINE__, + Status, + Status1, + InterruptStatus + ); } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid022, - L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke GetStatus() and verify interface correctness within test case", - L"%a:%d:Status - %r, Status1 - %r, InterruptStatus - %d", - __FILE__, - (UINTN)__LINE__, - Status, - Status1, - InterruptStatus - ); // // Restore SNP State -- 2.14.1.windows.1