From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: xianhuix.liu@intel.com) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by groups.io with SMTP; Sun, 22 Sep 2019 18:43:00 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2019 18:43:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,538,1559545200"; d="scan'208";a="389321068" Received: from xianhu2x-mobl.ccr.corp.intel.com ([10.239.196.243]) by fmsmga006.fm.intel.com with ESMTP; 22 Sep 2019 18:42:59 -0700 From: xianhuix.liu@intel.com To: devel@edk2.groups.io Cc: Heinrich Schuchardt , Supreeth Venkatesh , Eric Jin Subject: [edk2-test][Patch] uefi-sct/SctPkg: Add MediaPresentSupported check Date: Mon, 23 Sep 2019 09:42:21 +0800 Message-Id: <20190923014221.14780-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 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/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c index 133ef8a9..563e5361 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/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