From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=eric.jin@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A61832116746B for ; Sat, 13 Oct 2018 19:06:53 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Oct 2018 19:06:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,379,1534834800"; d="scan'208";a="100046780" Received: from jjin9-mobl.ccr.corp.intel.com ([10.249.168.56]) by orsmga002.jf.intel.com with ESMTP; 13 Oct 2018 19:06:51 -0700 From: Eric Jin To: edk2-devel@lists.01.org Cc: Supreeth Venkatesh , Jiaxin Wu Date: Sun, 14 Oct 2018 10:06:49 +0800 Message-Id: <20181014020649.1612-1-eric.jin@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 Subject: [PATCH] uefi-sct/SctPkg:Enhance the SimpleNetwork Test X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2018 02:06:54 -0000 Add the EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit in the Enable parameter Add one checkpoint to MCastFilterCount is zero Cc: Supreeth Venkatesh Cc: Jiaxin Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Jin --- .../SimpleNetwork/BlackBoxTest/Guid.c | 4 +- .../SimpleNetwork/BlackBoxTest/Guid.h | 7 +- .../SimpleNetworkBBTestConformance.c | 66 +++++++++++++------ .../SimpleNetwork/BlackBoxTest/Guid.c | 4 +- .../SimpleNetwork/BlackBoxTest/Guid.h | 7 +- .../SimpleNetworkBBTestConformance.c | 66 +++++++++++++------ 6 files changed, 110 insertions(+), 44 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c index 6ea6c4cb..72343236 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -112,6 +112,8 @@ EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid041 = EFI_TEST_SIMPLENETWOR EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042 = EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_042_GUID; +EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043 = EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID; + EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid001 = EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID; EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid002 = EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_002_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h index 281d893a..bf909d1c 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -235,6 +235,11 @@ extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid041; extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042; +#define EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID \ +{ 0x8cec0b86, 0x7773, 0x4d3c, {0x84, 0x13, 0x26, 0x37, 0xfb, 0xd0, 0x8e, 0x1b }} + +extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043; + #define EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID \ { 0xf58651fe, 0x0538, 0x4407, {0x88, 0xe0, 0x88, 0xb8, 0xda, 0x18, 0x38, 0x3a }} diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c index ccbbad08..b65d7d3b 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -581,11 +581,12 @@ BBTestReceiveFilterConformanceTest ( { EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; EFI_STATUS Status; - EFI_STATUS StatusBuf[5]; - EFI_TEST_ASSERTION AssertionType[5]; + EFI_STATUS StatusBuf[6]; + EFI_TEST_ASSERTION AssertionType[6]; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; EFI_SIMPLE_NETWORK_STATE State1, State2; - + EFI_MAC_ADDRESS MAC; + // // Get the Standard Library Interface // @@ -673,23 +674,37 @@ BBTestReceiveFilterConformanceTest ( // // Call ReceiveFilters with invalide MCastFilterCnt // - StatusBuf[3] = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCount + 1, NULL); - if (StatusBuf[3] == EFI_INVALID_PARAMETER) { - AssertionType[3] = EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType[3] = EFI_TEST_ASSERTION_FAILED; - } + if ((SnpInterface->Mode->ReceiveFilterMask & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) { + SctSetMem (&MAC, sizeof (MAC), 0x00); + MAC.Addr[0] = 0x01; + MAC.Addr[1] = 0x00; + MAC.Addr[2] = 0x5e; + MAC.Addr[3] = 0x00; + MAC.Addr[4] = 0x00; + MAC.Addr[5] = 0x02; - // - // Call ReceiveFilters with MCastFilterCnt not match MCastFilter - // - StatusBuf[4] = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 1, NULL); - if (StatusBuf[4] == EFI_INVALID_PARAMETER) { - AssertionType[4] = EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType[4] = EFI_TEST_ASSERTION_FAILED; - } + StatusBuf[3] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCount + 1, &MAC); + if (StatusBuf[3] == EFI_INVALID_PARAMETER) { + AssertionType[3] = EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType[3] = EFI_TEST_ASSERTION_FAILED; + } + StatusBuf[5] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, 0, &MAC); + if (StatusBuf[5] == EFI_INVALID_PARAMETER) { + AssertionType[5] = EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType[5] = EFI_TEST_ASSERTION_FAILED; + } + + StatusBuf[4] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, 1, NULL); + if (StatusBuf[4] == EFI_INVALID_PARAMETER) { + AssertionType[4] = EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType[4] = EFI_TEST_ASSERTION_FAILED; + } + + } StandardLib->RecordAssertion ( StandardLib, @@ -728,7 +743,7 @@ BBTestReceiveFilterConformanceTest ( StandardLib, AssertionType[3], gSimpleNetworkBBTestConformanceAssertionGuid009, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt.", + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt is greater than Snp->Mode->MaxMCastFilterCount.", L"%a:%d:Status - %r", __FILE__, (UINTN)__LINE__, @@ -746,6 +761,17 @@ BBTestReceiveFilterConformanceTest ( StatusBuf[4] ); + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[5], + gSimpleNetworkBBTestConformanceAssertionGuid043, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt is 0.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[5] + ); + // // Restore SNP State // diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.c index 6ea6c4cb..72343236 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.c @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -112,6 +112,8 @@ EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid041 = EFI_TEST_SIMPLENETWOR EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042 = EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_042_GUID; +EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043 = EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID; + EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid001 = EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID; EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid002 = EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_002_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.h index 27728964..1a6b8880 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.h @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -235,6 +235,11 @@ extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid041; extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042; +#define EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID \ +{ 0x8cec0b86, 0x7773, 0x4d3c, {0x84, 0x13, 0x26, 0x37, 0xfb, 0xd0, 0x8e, 0x1b }} + +extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043; + #define EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID \ { 0xf58651fe, 0x0538, 0x4407, 0x88, 0xe0, 0x88, 0xb8, 0xda, 0x18, 0x38, 0x3a } diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c index ccbbad08..b65d7d3b 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -581,11 +581,12 @@ BBTestReceiveFilterConformanceTest ( { EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; EFI_STATUS Status; - EFI_STATUS StatusBuf[5]; - EFI_TEST_ASSERTION AssertionType[5]; + EFI_STATUS StatusBuf[6]; + EFI_TEST_ASSERTION AssertionType[6]; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; EFI_SIMPLE_NETWORK_STATE State1, State2; - + EFI_MAC_ADDRESS MAC; + // // Get the Standard Library Interface // @@ -673,23 +674,37 @@ BBTestReceiveFilterConformanceTest ( // // Call ReceiveFilters with invalide MCastFilterCnt // - StatusBuf[3] = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCount + 1, NULL); - if (StatusBuf[3] == EFI_INVALID_PARAMETER) { - AssertionType[3] = EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType[3] = EFI_TEST_ASSERTION_FAILED; - } + if ((SnpInterface->Mode->ReceiveFilterMask & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) { + SctSetMem (&MAC, sizeof (MAC), 0x00); + MAC.Addr[0] = 0x01; + MAC.Addr[1] = 0x00; + MAC.Addr[2] = 0x5e; + MAC.Addr[3] = 0x00; + MAC.Addr[4] = 0x00; + MAC.Addr[5] = 0x02; - // - // Call ReceiveFilters with MCastFilterCnt not match MCastFilter - // - StatusBuf[4] = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 1, NULL); - if (StatusBuf[4] == EFI_INVALID_PARAMETER) { - AssertionType[4] = EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType[4] = EFI_TEST_ASSERTION_FAILED; - } + StatusBuf[3] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCount + 1, &MAC); + if (StatusBuf[3] == EFI_INVALID_PARAMETER) { + AssertionType[3] = EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType[3] = EFI_TEST_ASSERTION_FAILED; + } + StatusBuf[5] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, 0, &MAC); + if (StatusBuf[5] == EFI_INVALID_PARAMETER) { + AssertionType[5] = EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType[5] = EFI_TEST_ASSERTION_FAILED; + } + + StatusBuf[4] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, 1, NULL); + if (StatusBuf[4] == EFI_INVALID_PARAMETER) { + AssertionType[4] = EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType[4] = EFI_TEST_ASSERTION_FAILED; + } + + } StandardLib->RecordAssertion ( StandardLib, @@ -728,7 +743,7 @@ BBTestReceiveFilterConformanceTest ( StandardLib, AssertionType[3], gSimpleNetworkBBTestConformanceAssertionGuid009, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt.", + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt is greater than Snp->Mode->MaxMCastFilterCount.", L"%a:%d:Status - %r", __FILE__, (UINTN)__LINE__, @@ -746,6 +761,17 @@ BBTestReceiveFilterConformanceTest ( StatusBuf[4] ); + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[5], + gSimpleNetworkBBTestConformanceAssertionGuid043, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt is 0.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[5] + ); + // // Restore SNP State // -- 2.18.0.windows.1