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.31; helo=mga06.intel.com; envelope-from=eric.jin@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 D108521B02822 for ; Fri, 12 Oct 2018 00:04:59 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2018 00:04:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,371,1534834800"; d="scan'208";a="271768084" Received: from shwdeopenpsi175.ccr.corp.intel.com ([10.239.9.140]) by fmsmga006.fm.intel.com with ESMTP; 12 Oct 2018 00:04:57 -0700 From: Eric Jin To: edk2-devel@lists.01.org Cc: Supreeth Venkatesh , Jiaxin Wu Date: Fri, 12 Oct 2018 15:04:48 +0800 Message-Id: <20181012070448.15172-1-eric.jin@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 Subject: [edk2-test][Patch] uefi-sct\EMS:Add HTTP 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: Fri, 12 Oct 2018 07:05:00 -0000 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Jin Cc: Supreeth Venkatesh Cc: Jiaxin Wu --- .../EMS/Bin/TestCase/HTTP/Cancel.Conf1.Case1.tcl | 80 ++++++++ .../Bin/TestCase/HTTP/Configure.Conf2.Case1.tcl | 96 ++++++++++ .../Bin/TestCase/HTTP/Configure.Conf2.Case2.tcl | 118 ++++++++++++ .../Bin/TestCase/HTTP/Configure.Conf3.Case1.tcl | 118 ++++++++++++ .../Bin/TestCase/HTTP/Configure.Conf4.Case1.tcl | 102 +++++++++++ .../Bin/TestCase/HTTP/GetModeData.Conf1.Case1.tcl | 87 +++++++++ .../Bin/TestCase/HTTP/GetModeData.Conf1.Case2.tcl | 117 ++++++++++++ .../Bin/TestCase/HTTP/GetModeData.Conf1.Case3.tcl | 112 ++++++++++++ .../Bin/TestCase/HTTP/GetModeData.Conf2.Case1.tcl | 89 +++++++++ .../EMS/Bin/TestCase/HTTP/Include/Http.inc.tcl | 201 +++++++++++++++++++++ .../TestCase/HTTP/Include/HttpAssertionGuid.tcl | 34 ++++ .../EMS/Bin/TestCase/HTTP/Request.Conf1.Case1.tcl | 122 +++++++++++++ .../EMS/Bin/TestCase/HTTP/Request.Conf2.Case1.tcl | 165 +++++++++++++++++ .../EMS/Bin/TestCase/HTTP/Request.Conf3.Case1.tcl | 84 +++++++++ .../EMS/Bin/TestCase/HTTP/Request.Conf3.Case2.tcl | 101 +++++++++++ .../EMS/Bin/TestCase/HTTP/Request.Conf3.Case3.tcl | 178 ++++++++++++++++++ .../EMS/Bin/TestCase/HTTP/Response.Conf1.Case1.tcl | 118 ++++++++++++ .../EMS/Bin/TestCase/HTTP/Response.Conf2.Case1.tcl | 86 +++++++++ .../EMS/Bin/TestCase/HTTP/Response.Conf2.Case2.tcl | 136 ++++++++++++++ 19 files changed, 2144 insertions(+) create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Cancel.Conf1.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf2.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf2.Case2.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf3.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf4.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case2.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case3.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf2.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Include/Http.inc.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Include/HttpAssertionGuid.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf1.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf2.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case2.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case3.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf1.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf2.Case1.tcl create mode 100644 uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf2.Case2.tcl diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Cancel.Conf1.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Cancel.Conf1.Case1.tcl new file mode 100644 index 0000000..62f6967 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Cancel.Conf1.Case1.tcl @@ -0,0 +1,80 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 9B735919-A37E-4480-A49A-F0C7F47BBB9C +CaseName Cancel.Conf1.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_NOT_STARTED. \ + -- This EFI HTTP Protocol instance has not been configured.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +proc CleanUpEutEnvironmentBegin {} { + HttpServiceBinding->DestroyChild "@R_Handle, &@R_Status" + GetAck +} + +proc CleanUpEutEnvironmentEnd {} { + EndScope _HTTP_SPEC_CONFORMANCE_ + EndLog +} + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _HTTP_SPEC_CONFORMANCE_ + +UINTN R_Status +UINTN R_Handle + +EFI_HTTP_TOKEN R_HTTP_Token + +# +# Create Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +SetVar R_HTTP_Token 0 + +Http->Cancel "&@R_HTTP_Token, &@R_Status" +GetAck +set assert [VerifyReturnStatus R_Status $EFI_NOT_STARTED] +RecordAssertion $assert $HttpCancelConf1AssertionGuid001 \ + "Http.Cancel - Call Cancel() without a configuration." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_NOT_STARTED" + +# +# Clean up the environment on EUT side. +# + +CleanUpEutEnvironmentBegin + +CleanUpEutEnvironmentEnd diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf2.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf2.Case1.tcl new file mode 100644 index 0000000..c891caf --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf2.Case1.tcl @@ -0,0 +1,96 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 02EB1F9B-713E-456c-85BA-8C2BD7B3B1A6 +CaseName Configure.Conf2.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER\ + -- HttpConfigData->IPv4Node is NULL when \ + HttpConfigData->LocalAddressIsIPv6 is FALSE.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _CONFIGURE_CONF2_CASE1_ + + +UINTN R_Status +UINTN R_Handle + +EFI_HTTP_CONFIG_DATA_ACCESSPOINT R_Configure_AccessPoint +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# Check Point: Call Http.Configure() to configure the HTTP instance, +# with null IPv4Node when +# HttpConfigData->LocalAddressIsIPv6 is FALSE +# +SetVar R_Configure_AccessPoint.IPv4Node 0 + + +SetVar R_Configure_HttpConfigData.HttpVersion $HttpVersion10 +SetVar R_Configure_HttpConfigData.TimeOutMillisec 128 +SetVar R_Configure_HttpConfigData.LocalAddressIsIPv6 FALSE +SetVar R_Configure_HttpConfigData.AccessPoint @R_Configure_AccessPoint + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpConfigureConf2AssertionGuid001 \ + "Http.Configure - Call Configure() with IPv4Node is NULL." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + +# +# Destroy Http Child. +# +HttpServiceBinding->DestroyChild {@R_Handle, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.DestroyChild - Destroy Child 1." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# EndScope +# +EndScope _CONFIGURE_CONF2_CASE1_ + +# +# End Log +# +EndLog \ No newline at end of file diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf2.Case2.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf2.Case2.tcl new file mode 100644 index 0000000..def9e3a --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf2.Case2.tcl @@ -0,0 +1,118 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 1F800B6F-943A-4b5e-9E55-9C3E0DAE320B +CaseName Configure.Conf2.Case2 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER\ + -- HttpConfigData->IPv6Node is NULL when \ + HttpConfigData->LocalAddressIsIPv6 is TRUE.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _CONFIGURE_CONF2_CASE2_ + + +UINTN R_Status +UINTN R_Handle + +EFI_HTTP_CONFIG_DATA_ACCESSPOINT R_Configure_AccessPoint +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# Check Point: Call Http.Configure() to configure the HTTP instance, +# with null IPv6Node when +# HttpConfigData->LocalAddressIsIPv6 is TRUE +# +SetVar R_Configure_AccessPoint.IPv6Node 0 + +SetVar R_Configure_HttpConfigData.HttpVersion $HttpVersion10 +SetVar R_Configure_HttpConfigData.TimeOutMillisec 128 +SetVar R_Configure_HttpConfigData.LocalAddressIsIPv6 TRUE +SetVar R_Configure_HttpConfigData.AccessPoint @R_Configure_AccessPoint + + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpConfigureConf2AssertionGuid002 \ + "Http.Configure - Call Configure() with IPv6Node is NULL." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + +# +# Destroy Http Child. +# +HttpServiceBinding->DestroyChild {@R_Handle, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.DestroyChild - Destroy Child 1." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# EndScope +# +EndScope _CONFIGURE_CONF2_CASE2_ + +# +# End Log +# +EndLog + + + + + + + + + + + + + + + + + + + + + + diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf3.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf3.Case1.tcl new file mode 100644 index 0000000..0c0cc24 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf3.Case1.tcl @@ -0,0 +1,118 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 1B0A0EAA-086A-42d1-8B77-37862EEBD411 +CaseName Configure.Conf3.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_ALREADY_STARTED \ + in the implementation.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _CONFIGURE_CONF3_CASE1_ + + +UINTN R_Status +UINTN R_Handle + +EFI_IPv4_ADDRESS R_Configure_LocalAddress +EFI_IPv4_ADDRESS R_Configure_SubnetMask +EFI_HTTPv4_ACCESS_POINT R_Configure_AccessPointv4 +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData +EFI_HTTP_CONFIG_DATA_ACCESSPOINT R_Configure_AccessPoint + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# Check Point: Call Http.Configure() to configure the HTTP instance +# +SetIpv4Address R_Configure_LocalAddress "192.168.88.88" +SetIpv4Address R_Configure_SubnetMask "255.255.255.0" +SetVar R_Configure_AccessPointv4.UseDefaultAddress FALSE +SetVar R_Configure_AccessPointv4.LocalAddress @R_Configure_LocalAddress +SetVar R_Configure_AccessPointv4.LocalSubnet @R_Configure_SubnetMask +SetVar R_Configure_AccessPointv4.LocalPort 6666 +SetVar R_Configure_AccessPoint.IPv4Node &@R_Configure_AccessPointv4 + + +SetVar R_Configure_HttpConfigData.HttpVersion $HttpVersion10 +SetVar R_Configure_HttpConfigData.TimeOutMillisec 10 +SetVar R_Configure_HttpConfigData.LocalAddressIsIPv6 FALSE +SetVar R_Configure_HttpConfigData.AccessPoint @R_Configure_AccessPoint + + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "Http.Configure - Call Configure() with the valid settings." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +SetIpv4Address R_Configure_LocalAddress "172.16.210.102" + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_ALREADY_STARTED] +RecordAssertion $assert $HttpConfigureConf3AssertionGuid001 \ + "Http.Configure - Call Configure() to reinitialize it ." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_ALREADY_STARTED" + + +# +# Destroy Http Child. +# +HttpServiceBinding->DestroyChild {@R_Handle, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.DestroyChild - Destroy Child 1." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# EndScope +# +EndScope _CONFIGURE_CONF3_CASE1_ + +# +# End Log +# +EndLog + + + + + diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf4.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf4.Case1.tcl new file mode 100644 index 0000000..a7e7f8d --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Configure.Conf4.Case1.tcl @@ -0,0 +1,102 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid C23174C5-1640-4b5e-9211-7AFC1CE5653D +CaseName Configure.Conf4.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_UNSUPPORTED\ + -- One or more options in ConfigData are not supported\ + in the implementation.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _CONFIGURE_CONF4_CASE1_ + + +UINTN R_Status +UINTN R_Handle + +EFI_IPv6_ADDRESS R_Configure_LocalAddress +EFI_HTTPv6_ACCESS_POINT R_Configure_AccessPointv6 +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# Check Point: Call Http.Configure() to configure the HTTP instance, +# with unsupported HttpVersion +# + + +SetIpv6Address R_Configure_LocalAddress "2002::1" +SetVar R_Configure_AccessPointv6.LocalAddress @R_Configure_LocalAddress +SetVar R_Configure_AccessPointv6.LocalPort 0 + + +SetVar R_Configure_HttpConfigData.HttpVersion $HttpVersionUnsupported +SetVar R_Configure_HttpConfigData.TimeOutMillisec 128 +SetVar R_Configure_HttpConfigData.LocalAddressIsIPv6 TRUE +SetVar R_Configure_HttpConfigData.AccessPoint.IPv6Node &@R_Configure_AccessPointv6 + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_UNSUPPORTED] +RecordAssertion $assert $HttpConfigureConf4AssertionGuid001 \ + "Http.Configure - Call Configure() with One or more options in \ + ConfigData are not supported." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_UNSUPPORTED" + +# +# Destroy Http Child. +# +HttpServiceBinding->DestroyChild {@R_Handle, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.DestroyChild - Destroy Child 1." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# EndScope +# +EndScope _CONFIGURE_CONF4_CASE1_ + +# +# End Log +# +EndLog + diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case1.tcl new file mode 100644 index 0000000..4813171 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case1.tcl @@ -0,0 +1,87 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 0FB1D983-75DE-4db2-AAB9-374F0B90B6D4 +CaseName GetModeData.Conf1.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER\ + -- HttpConfigData is NULL.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _GETMODEDATA_CONF1_CASE1_ + + +UINTN R_Status +UINTN R_Handle + + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +Http->GetModeData "NULL, &@R_Status" +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpGetModeDataConf1AssertionGuid001 \ + "Http.GetModeData - Call GetModeData() with NULL HttpConfigData." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + + +# +# Destroy Http Child. +# +HttpServiceBinding->DestroyChild {@R_Handle, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.DestroyChild - Destroy Child 1." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# EndScope +# +EndScope _GETMODEDATA_CONF1_CASE1_ + +# +# End Log +# +EndLog + + + + + diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case2.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case2.tcl new file mode 100644 index 0000000..f48a9ad --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case2.tcl @@ -0,0 +1,117 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid C6241E00-7E77-41ce-8974-08A9248B7123 +CaseName GetModeData.Conf1.Case2 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER \ + -- HttpConfigData->LocalAddressIsIPv6 is FALSE and HttpConfigData->IPv4Node is NULL.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _GETMODEDATA_CONF1_CASE2_ + + +UINTN R_Status +UINTN R_Handle + +EFI_IPv4_ADDRESS R_Configure_LocalAddress +EFI_IPv4_ADDRESS R_Configure_SubnetMask +EFI_HTTPv4_ACCESS_POINT R_Configure_AccessPointv4 +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData +EFI_HTTP_CONFIG_DATA_ACCESSPOINT R_Configure_AccessPoint + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +SetIpv4Address R_Configure_LocalAddress "192.168.88.88" +SetIpv4Address R_Configure_SubnetMask "255.255.255.0" +SetVar R_Configure_AccessPointv4.UseDefaultAddress FALSE +SetVar R_Configure_AccessPointv4.LocalAddress @R_Configure_LocalAddress +SetVar R_Configure_AccessPointv4.LocalSubnet @R_Configure_SubnetMask +SetVar R_Configure_AccessPointv4.LocalPort 6666 +SetVar R_Configure_AccessPoint.IPv4Node &@R_Configure_AccessPointv4 + + +SetVar R_Configure_HttpConfigData.HttpVersion $HttpVersion10 +SetVar R_Configure_HttpConfigData.TimeOutMillisec 10 +SetVar R_Configure_HttpConfigData.LocalAddressIsIPv6 FALSE +SetVar R_Configure_HttpConfigData.AccessPoint @R_Configure_AccessPoint + + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "Http.Configure - Call Configure() with valid setting." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +SetVar R_Configure_HttpConfigData.AccessPoint.IPv4Node 0 + +# +# Check Point: Call Http.GetModeData(), +# HttpConfigData->LocalAddressIsIPv6 is FALSE and HttpConfigData->IPv4Node is NULL. + +Http->GetModeData {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpGetModeDataConf1AssertionGuid002 \ + "Http.GetModeData - Call GetModeData() with parameters \ + HttpConfigData->LocalAddressIsIPv6 is FALSE and HttpConfigData->IPv4Node is NULL." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + + +# +# Destroy Http Child. +# +HttpServiceBinding->DestroyChild {@R_Handle, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.DestroyChild - Destroy Child 1." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# EndScope +# +EndScope _GETMODEDATA_CONF1_CASE2_ + +# +# End Log +# +EndLog \ No newline at end of file diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case3.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case3.tcl new file mode 100644 index 0000000..074c5cf --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf1.Case3.tcl @@ -0,0 +1,112 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 75713B03-0CB1-41d9-9F8D-2941BFC1F7E7 +CaseName GetModeData.Conf1.Case3 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER\ + -- HttpConfigData->LocalAddressIsIPv6 is TRUE and HttpConfigData->IPv6Node is NULL. } +################################################################################ + +Include HTTP/include/Http.inc.tcl + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _GETMODEDATA_CONF1_CASE3_ + + +UINTN R_Status +UINTN R_Handle + +EFI_IPv6_ADDRESS R_Configure_LocalAddress +EFI_HTTPv6_ACCESS_POINT R_Configure_AccessPointv6 +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +SetIpv6Address R_Configure_LocalAddress "20::1" +SetVar R_Configure_AccessPointv6.LocalAddress @R_Configure_LocalAddress +SetVar R_Configure_AccessPointv6.LocalPort 0 + + +SetVar R_Configure_HttpConfigData.HttpVersion $HttpVersion10 +SetVar R_Configure_HttpConfigData.TimeOutMillisec 128 +SetVar R_Configure_HttpConfigData.LocalAddressIsIPv6 TRUE +SetVar R_Configure_HttpConfigData.AccessPoint.IPv6Node &@R_Configure_AccessPointv6 + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "Http.Configure - Call Configure() with valid settings." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + + +SetVar R_Configure_HttpConfigData.AccessPoint.IPv6Node 0 + +# +# Check Point: Call Http.GetModeData(), +# HttpConfigData->LocalAddressIsIPv6 is TRUE and HttpConfigData->IPv6Node is NULL. + +Http->GetModeData {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpGetModeDataConf1AssertionGuid003 \ + "Http.GetModeData - Call GetModeData() with parameters \ + HttpConfigData->LocalAddressIsIPv6 is TRUE and HttpConfigData->IPv6Node is NULL." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + + +# +# Destroy Http Child. +# +HttpServiceBinding->DestroyChild {@R_Handle, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.DestroyChild - Destroy Child 1." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# EndScope +# +EndScope _GETMODEDATA_CONF1_CASE3_ + +# +# End Log +# +EndLog + diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf2.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf2.Case1.tcl new file mode 100644 index 0000000..5238e56 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/GetModeData.Conf2.Case1.tcl @@ -0,0 +1,89 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid C076FA7C-FE7B-4393-9734-EA60606546AE +CaseName GetModeData.Conf2.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_NOT_STARTED\ + -- This EFI HTTP Protocol instance has not been started.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _GETMODEDATA_CONF2_CASE1_ + + +UINTN R_Status +UINTN R_Handle + + + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# Check Point: Call Http.GetModeData() before the Http.Configure() on the HTTP instance +# +EFI_HTTPv4_ACCESS_POINT R_Configure_AccessPointv4 +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData + +SetVar R_Configure_HttpConfigData.AccessPoint.IPv4Node &@R_Configure_AccessPointv4 + +Http->GetModeData {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_NOT_STARTED] +RecordAssertion $assert $HttpGetModeDataConf2AssertionGuid001 \ + "Http.GetModeData - Call GetModeData() before the instance is configured" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_NOT_STARTED" + +# +# Destroy Http Child. +# +HttpServiceBinding->DestroyChild {@R_Handle, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.DestroyChild - Destroy Child 1." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +# +# EndScope +# +EndScope _GETMODEDATA_CONF2_CASE1_ + +# +# End Log +# +EndLog \ No newline at end of file diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Include/Http.inc.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Include/Http.inc.tcl new file mode 100644 index 0000000..94de266 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Include/Http.inc.tcl @@ -0,0 +1,201 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +if {[info exist HTTP_INC] == 1} { + return +} +set HTTP_INC 1 + +Include Include/EntsProtocolTest.inc.tcl +Include Include/EntsConfigure.tcl +Include Include/EfiBootService.inc.tcl +Include EfiUtil/EfiInclude.tcl +Include Http/Include/HttpAssertionGuid.tcl +Include Include/GenericAssertionGuid.tcl + + + +Func HttpServiceBinding->CreateChild { + POINTER + POINTER +} + +Func HttpServiceBinding->DestroyChild { + UINTN + POINTER +} + +Func Http->GetModeData { + POINTER + POINTER +} + +Func Http->Configure { + POINTER + POINTER +} + +Func Http->Request { + POINTER + POINTER +} + +Func Http->Cancel { + POINTER + POINTER +} + +Func Http->Response { + POINTER + POINTER +} +Func Http->Poll { + POINTER +} + + + +################################################################### +# EFI_HTTPv4_ACCESS_POINT +################################################################### +Struct EFI_HTTPv4_ACCESS_POINT { + BOOLEAN UseDefaultAddress; + EFI_IPv4_ADDRESS LocalAddress; + EFI_IPv4_ADDRESS LocalSubnet; + UINT16 LocalPort; +} + +################################################################### +# EFI_HTTPv6_ACCESS_POINT +################################################################### +Struct EFI_HTTPv6_ACCESS_POINT { + EFI_IPv6_ADDRESS LocalAddress; + UINT16 LocalPort; +} + + set HTTP_STATUS_UNSUPPORTED_STATUS 0; + set HTTP_STATUS_100_CONTINUE 1; + set HTTP_STATUS_101_SWITCHING_PROTOCOLS 2; + set HTTP_STATUS_200_OK 3; + set HTTP_STATUS_201_CREATED 4; + set HTTP_STATUS_202_ACCEPTED 5; + set HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION 6; + set HTTP_STATUS_204_NO_CONTENT 7; + set HTTP_STATUS_205_RESET_CONTENT 8; + set HTTP_STATUS_206_PARTIAL_CONTENT 9; + set HTTP_STATUS_300_MULTIPLE_CHIOCES 10; + set HTTP_STATUS_301_MOVED_PERMANENTLY 11; + set HTTP_STATUS_302_FOUND 12; + set HTTP_STATUS_303_SEE_OTHER 13; + set HTTP_STATUS_304_NOT_MODIFIED 14; + set HTTP_STATUS_305_USE_PROXY 15; + set HTTP_STATUS_307_TEMPORARY_REDIRECT 16; + set HTTP_STATUS_400_BAD_REQUEST 17; + set HTTP_STATUS_401_UNAUTHORIZED 18; + set HTTP_STATUS_402_PAYMENT_REQUIRED 19; + set HTTP_STATUS_403_FORBIDDEN 20; + set HTTP_STATUS_404_NOT_FOUND 21; + set HTTP_STATUS_405_METHOD_NOT_ALLOWED 22; + set HTTP_STATUS_406_NOT_ACCEPTABLE 23; + set HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED 24; + set HTTP_STATUS_408_REQUEST_TIME_OUT 25; + set HTTP_STATUS_409_CONFLICT 26; + set HTTP_STATUS_410_GONE 27; + set HTTP_STATUS_411_LENGTH_REQUIRED 28; + set HTTP_STATUS_412_PRECONDITION_FAILED 29; + set HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE 30; + set HTTP_STATUS_414_REQUEST_URI_TOO_LARGE 31; + set HTTP_STATUS_415_UNSUPPORETD_MEDIA_TYPE 32; + set HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED 33; + set HTTP_STATUS_417_EXPECTATION_FAILED 34; + set HTTP_STATUS_500_INTERNAL_SERVER_ERROR 35; + set HTTP_STATUS_501_NOT_IMIPLEMENTED 36; + set HTTP_STATUS_502_BAD_GATEWAY 37; + set HTTP_STATUS_503_SERVICE_UNAVAILABLE 38; + set HTTP_STATUS_504_GATEWAY_TIME_OUT 39; + set HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED 40; + + set HttpVersion10 0; + set HttpVersion11 1; + set HttpVersionUnsupported 2; + + set HttpMethodGet 0; + set HttpMethodPost 1; + set HttpMethodPatch 2; + set HttpMethodOptions 3; + set HttpMethodConnect 4; + set HttpMethodHead 5; + set HttpMethodPut 6; + set HttpMethodDelete 7; + set HttpMethodTrace 8; + + +#################################################################### +# EFI_HTTP_RESPONSE_DATA +##################################################################### +Struct EFI_HTTP_RESPONSE_DATA { + UINT32 StatusCode; +} + +################################################################### +# EFI_HTTP_CONFIG_DATA +################################################################### +Union EFI_HTTP_CONFIG_DATA_ACCESSPOINT { + POINTER IPv4Node; + POINTER IPv6Node; +} + +Struct EFI_HTTP_CONFIG_DATA { + UINT32 HttpVersion; + UINT32 TimeOutMillisec; + BOOLEAN LocalAddressIsIPv6; + EFI_HTTP_CONFIG_DATA_ACCESSPOINT AccessPoint; +} + +#################################################################### +# EFI_HTTP_REQUEST_DATA +##################################################################### +Struct EFI_HTTP_REQUEST_DATA { + UINT32 Method; + POINTER Url; +} + +#################################################################### +# EFI_HTTP_HEADER +##################################################################### +Struct EFI_HTTP_HEADER { + POINTER FieldName; + POINTER FieldValue; +} + +################################################################### +# EFI_HTTP_MESSAGE +################################################################### +Union EFI_HTTP_MESSAGE_DATA { + POINTER Request; + POINTER Response; +}; +Struct EFI_HTTP_MESSAGE { + EFI_HTTP_MESSAGE_DATA Data; + UINTN HeaderCount; + POINTER Headers; + UINTN BodyLength; + POINTER Body; +} + +################################################################### +# EFI_HTTP_TOKEN +################################################################### +Struct EFI_HTTP_TOKEN { + UINTN Event; + UINTN Status; + POINTER Message; +} diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Include/HttpAssertionGuid.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Include/HttpAssertionGuid.tcl new file mode 100644 index 0000000..5c36bd4 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Include/HttpAssertionGuid.tcl @@ -0,0 +1,34 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# + + +set HttpConfigureConf2AssertionGuid001 E8CEF00F-0796-4b1c-BD09-2C86DB4DBA5E +set HttpConfigureConf2AssertionGuid002 FD95EF4B-3097-472f-8A5D-12B56495DD51 +set HttpConfigureConf3AssertionGuid001 6E184D97-B0B4-417f-B869-47436617AB69 +set HttpConfigureConf4AssertionGuid001 89EAAF00-CE69-4519-AA6E-B5637170A1AE + +set HttpGetModeDataConf1AssertionGuid001 E3232706-A7BB-4b67-BB81-8843D0C298D7 +set HttpGetModeDataConf1AssertionGuid002 E858845B-6837-4a12-B7C6-3A98247A4D10 +set HttpGetModeDataConf1AssertionGuid003 DEDB45A1-8D75-4da9-95C9-9778056B26FC +set HttpGetModeDataConf2AssertionGuid001 7863457D-A4E9-4bef-9DD4-F7179941336E + +set HttpRequestConf1AssertionGuid001 86E72504-7585-44ac-8432-211307A22B9A +set HttpRequestConf2AssertionGuid001 7E8B0074-90C0-4529-9E44-98C8478B3DA8 +set HttpRequestConf3AssertionGuid001 9BC1E514-1383-4007-B25D-4524B43D985D +set HttpRequestConf3AssertionGuid002 9F4F1BAE-F587-4ac6-B172-DDB4C1F38377 +set HttpRequestConf3AssertionGuid003 C9AB5933-3879-4cea-858E-EB98966BE42E + +set HttpResponseConf1AssertionGuid001 1265E57A-E6BC-45bc-A12B-2A548F930120 +set HttpResponseConf2AssertionGuid001 BE2E5EE8-D659-4340-89F0-FB5715D673E8 +set HttpResponseConf2AssertionGuid002 AA9E05A8-0F95-4997-A50F-92AB3B69A4C5 + +set HttpCancelConf1AssertionGuid001 E338B87D-B208-4745-A7D6-F7AA7060E16C \ No newline at end of file diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf1.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf1.Case1.tcl new file mode 100644 index 0000000..3163d3c --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf1.Case1.tcl @@ -0,0 +1,122 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 74E37C30-B50D-4fdf-9604-8E249687802D +CaseName Request.Conf1.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_NOT_STARTED. \ + -- This EFI HTTP Protocol instance has not been configured.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +proc CleanUpEutEnvironmentBegin {} { + HttpServiceBinding->DestroyChild "@R_Handle, &@R_Status" + GetAck +} + +proc CleanUpEutEnvironmentEnd {} { + EndScope _REQUEST_CONF1_CASE1_ + EndLog +} + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _REQUEST_CONF1_CASE1_ + +# +# Parameter Definition +# R_ represents "Remote EFI Side Parameter" +# L_ represents "Local OS Side Parameter" +# + +UINTN R_Status +UINTN R_Handle +UINTN R_Context + +CHAR16 R_Request_Url(30) +EFI_HTTP_REQUEST_DATA R_Request_Data +EFI_HTTP_MESSAGE_DATA R_Request_Message_Data +UINTN R_Request_HeaderCount +EFI_HTTP_HEADER R_Request_Headers +EFI_HTTP_MESSAGE R_Request_Message +EFI_HTTP_TOKEN R_Request_Token + + + +# +# Create Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +BS->CreateEvent "$EVT_NOTIFY_SIGNAL, $EFI_TPL_CALLBACK, 1, &@R_Context, \ + &@R_Request_Token.Event, &@R_Status" +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "BS.CreateEvent." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +SetVar R_Request_Token.Status $EFI_SUCCESS + +SetVar R_Request_Url "http://192.168.88.1:8888" +SetVar R_Request_Data.Url &@R_Request_Url +SetVar R_Request_Data.Method $HttpMethodGet +SetVar R_Request_Message_Data.Request &@R_Request_Data +SetVar R_Request_Message.Data @R_Request_Message_Data + +SetVar R_Request_HeaderCount 1 +SetVar R_Request_Message.HeaderCount @R_Request_HeaderCount + +SetVar R_Request_Headers.FieldName 0 +SetVar R_Request_Headers.FieldValue 0 +SetVar R_Request_Message.Headers &@R_Request_Headers + +SetVar R_Request_Message.BodyLength 0 +SetVar R_Request_Message.Body 0 + +SetVar R_Request_Token.Message &@R_Request_Message + + +Http->Request {&@R_Request_Token, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_NOT_STARTED] +RecordAssertion $assert $HttpRequestConf1AssertionGuid001 \ + "Http.Request - Call Request() without a configuration." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_NOT_STARTED" + +# +# Clean up the environment on EUT side. +# +CleanUpEutEnvironmentBegin +BS->CloseEvent "@R_Request_Token.Event, &@R_Status" +GetAck +CleanUpEutEnvironmentEnd diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf2.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf2.Case1.tcl new file mode 100644 index 0000000..fb11576 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf2.Case1.tcl @@ -0,0 +1,165 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 33E75173-1C47-4642-AFA0-2CC2FCCE3379 +CaseName Request.Conf2.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_TIMEOUT. \ + Httpcreateconnection return EFI_TIMEOUT.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +proc CleanUpEutEnvironmentBegin {} { + HttpServiceBinding->DestroyChild "@R_Handle, &@R_Status" + GetAck +} + +proc CleanUpEutEnvironmentEnd {} { + EndScope _REQUEST_CONF2_CASE1_ + EndLog +} + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _REQUEST_CONF2_CASE1_ + + +UINTN R_Status +UINTN R_Handle +UINTN R_Context + +CHAR16 R_Request_Url(30) +CHAR8 R_Request_Headers_Name(10) +CHAR8 R_Request_Headers_Value(30) +EFI_HTTP_REQUEST_DATA R_Request_Data + +EFI_HTTP_MESSAGE_DATA R_Request_Message_Data +EFI_HTTP_HEADER R_Request_Headers +UINTN R_Request_HeaderCount +EFI_HTTP_MESSAGE R_Request_Message +EFI_HTTP_TOKEN R_Request_Token + +EFI_IPv4_ADDRESS R_Configure_LocalAddress +EFI_IPv4_ADDRESS R_Configure_SubnetMask +EFI_HTTPv4_ACCESS_POINT R_Configure_AccessPointv4 +EFI_HTTP_CONFIG_DATA_ACCESSPOINT R_Configure_AccessPoint +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData + + + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +SetIpv4Address R_Configure_LocalAddress "192.168.88.88" +SetIpv4Address R_Configure_SubnetMask "255.255.255.0" +SetVar R_Configure_AccessPointv4.UseDefaultAddress FALSE +SetVar R_Configure_AccessPointv4.LocalAddress @R_Configure_LocalAddress +SetVar R_Configure_AccessPointv4.LocalSubnet @R_Configure_SubnetMask +SetVar R_Configure_AccessPointv4.LocalPort 6666 +SetVar R_Configure_AccessPoint.IPv4Node &@R_Configure_AccessPointv4 + + +SetVar R_Configure_HttpConfigData.HttpVersion $HttpVersion10 +SetVar R_Configure_HttpConfigData.TimeOutMillisec 10 +SetVar R_Configure_HttpConfigData.LocalAddressIsIPv6 FALSE +SetVar R_Configure_HttpConfigData.AccessPoint @R_Configure_AccessPoint + + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "Http.Configure - Call Configure()" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +BS->CreateEvent "$EVT_NOTIFY_SIGNAL, $EFI_TPL_CALLBACK, 1, &@R_Context, \ + &@R_Request_Token.Event, &@R_Status" +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "BS.CreateEvent." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +SetVar R_Request_Token.Status $EFI_SUCCESS + +SetVar R_Request_Url "http://192.168.88.1:8888" +SetVar R_Request_Data.Url &@R_Request_Url +SetVar R_Request_Data.Method $HttpMethodGet +SetVar R_Request_Message_Data.Request &@R_Request_Data +SetVar R_Request_Message.Data @R_Request_Message_Data + +SetVar R_Request_HeaderCount 1 +SetVar R_Request_Message.HeaderCount @R_Request_HeaderCount + +SetVar R_Request_Headers.FieldName &@R_Request_Headers_Name +SetVar R_Request_Headers.FieldValue &@R_Request_Headers_Value +SetVar R_Request_Message.Headers &@R_Request_Headers + +SetVar R_Request_Message.BodyLength 0 +SetVar R_Request_Message.Body 0 + +SetVar R_Request_Token.Message &@R_Request_Message + + +# +# Check Point: Call Http.Request(). +# +Http->Request {&@R_Request_Token, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_TIMEOUT] +RecordAssertion $assert $HttpRequestConf2AssertionGuid001 \ + "Http.Request - Call Request()" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_TIMEOUT" + + +# +# Clean up the environment on EUT side. +# +CleanUpEutEnvironmentBegin +BS->CloseEvent "@R_Request_Token.Event, &@R_Status" +GetAck +CleanUpEutEnvironmentEnd + + + + + + + + + + diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case1.tcl new file mode 100644 index 0000000..1d72cd4 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case1.tcl @@ -0,0 +1,84 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 485A2F17-5D74-4481-9A97-A6B287403632 +CaseName Request.Conf3.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER. \ + -- Token is NULL.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +proc CleanUpEutEnvironmentBegin {} { + HttpServiceBinding->DestroyChild "@R_Handle, &@R_Status" + GetAck +} + +proc CleanUpEutEnvironmentEnd {} { + EndScope _REQUEST_CONF3_CASE1_ + EndLog +} + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _REQUEST_CONF3_CASE1_ + + +UINTN R_Status +UINTN R_Handle + + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +# +# Check Point: Call Http.Request() +# with NULL Token. +# +Http->Request {NULL, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpRequestConf3AssertionGuid001 \ + "Http.Request - Call Request() with NULL Token." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + + +# +# Clean up the environment on EUT side. +# + +CleanUpEutEnvironmentBegin + +CleanUpEutEnvironmentEnd diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case2.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case2.tcl new file mode 100644 index 0000000..860d536 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case2.tcl @@ -0,0 +1,101 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid BA421B49-FBAB-455d-98CD-45AC8DF36A43 +CaseName Request.Conf3.Case2 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER. \ + -- Token->Message is NULL.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +proc CleanUpEutEnvironmentBegin {} { + HttpServiceBinding->DestroyChild "@R_Handle, &@R_Status" + GetAck +} + +proc CleanUpEutEnvironmentEnd {} { + EndScope _REQUEST_CONF3_CASE2_ + EndLog +} + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _REQUEST_CONF3_CASE2_ + + +UINTN R_Status +UINTN R_Handle +UINTN R_Context + +UINTN R_Request_Token_Status +EFI_HTTP_TOKEN R_Request_Token + + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + + +BS->CreateEvent "$EVT_NOTIFY_SIGNAL, $EFI_TPL_CALLBACK, 1, &@R_Context, \ + &@R_Request_Token.Event, &@R_Status" +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "BS.CreateEvent." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +SetVar R_Request_Token.Status @R_Request_Token_Status +SetVar R_Request_Token.Message 0 + +# +# Check Point: Call Http.Request() +# with NULL Token->Message. +# +Http->Request {&@R_Request_Token, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpRequestConf3AssertionGuid002 \ + "Http.Request - Call Request() with NULL Token->Message." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + + +# +# Clean up the environment on EUT side. +# + +CleanUpEutEnvironmentBegin +BS->CloseEvent "@R_Request_Token.Event, &@R_Status" +GetAck +CleanUpEutEnvironmentEnd diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case3.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case3.tcl new file mode 100644 index 0000000..0c00ca7 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Request.Conf3.Case3.tcl @@ -0,0 +1,178 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 3D0A0CF4-C769-4127-9299-7D802395290A +CaseName Request.Conf3.Case3 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER. \ + Token->Message->Body is not NULL, Token->Message->BodyLength is non-zero, \ + and Token->Message->Data is NULL, \ + but a previous call to Request()has not been completed successfully.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +proc CleanUpEutEnvironmentBegin {} { + HttpServiceBinding->DestroyChild "@R_Handle, &@R_Status" + GetAck + +} + +proc CleanUpEutEnvironmentEnd {} { + EndScope _REQUEST_CONF3_CASE3_ + EndLog +} + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _REQUEST_CONF3_CASE3_ + + +UINTN R_Status +UINTN R_Handle +UINTN R_Context + +CHAR16 R_Request_Url(30) +CHAR8 R_Request_Headers_Name(10) +CHAR8 R_Request_Headers_Value(30) +EFI_HTTP_REQUEST_DATA R_Request_Data + + + +EFI_HTTP_MESSAGE_DATA R_Request_Message_Data +EFI_HTTP_HEADER R_Request_Headers +UINTN R_Request_HeaderCount +CHAR8 R_Request_Body(20) +EFI_HTTP_MESSAGE R_Request_Message +EFI_HTTP_TOKEN R_Request_Token + +EFI_IPv4_ADDRESS R_Configure_LocalAddress +EFI_IPv4_ADDRESS R_Configure_SubnetMask +EFI_HTTPv4_ACCESS_POINT R_Configure_AccessPointv4 +EFI_HTTP_CONFIG_DATA_ACCESSPOINT R_Configure_AccessPoint +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData + + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +SetIpv4Address R_Configure_LocalAddress "192.168.88.88" +SetIpv4Address R_Configure_SubnetMask "255.255.255.0" +SetVar R_Configure_AccessPointv4.UseDefaultAddress FALSE +SetVar R_Configure_AccessPointv4.LocalAddress @R_Configure_LocalAddress +SetVar R_Configure_AccessPointv4.LocalSubnet @R_Configure_SubnetMask +SetVar R_Configure_AccessPointv4.LocalPort 6666 +SetVar R_Configure_AccessPoint.IPv4Node &@R_Configure_AccessPointv4 + + +SetVar R_Configure_HttpConfigData.HttpVersion $HttpVersion10 +SetVar R_Configure_HttpConfigData.TimeOutMillisec 10 +SetVar R_Configure_HttpConfigData.LocalAddressIsIPv6 FALSE +SetVar R_Configure_HttpConfigData.AccessPoint @R_Configure_AccessPoint + + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "Http.Configure - Call Configure()" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +BS->CreateEvent "$EVT_NOTIFY_SIGNAL, $EFI_TPL_CALLBACK, 1, &@R_Context, \ + &@R_Request_Token.Event, &@R_Status" +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "BS.CreateEvent." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +SetVar R_Request_Token.Status $EFI_SUCCESS + +SetVar R_Request_Url "http://192.168.88.1:8888" +SetVar R_Request_Data.Url &@R_Request_Url +SetVar R_Request_Data.Method $HttpMethodGet +SetVar R_Request_Message_Data.Request &@R_Request_Data +SetVar R_Request_Message.Data @R_Request_Message_Data + +SetVar R_Request_HeaderCount 1 +SetVar R_Request_Message.HeaderCount @R_Request_HeaderCount + +SetVar R_Request_Headers.FieldName &@R_Request_Headers_Name +SetVar R_Request_Headers.FieldValue &@R_Request_Headers_Value +SetVar R_Request_Message.Headers &@R_Request_Headers + +SetVar R_Request_Message.BodyLength 0 +SetVar R_Request_Message.Body 0 + +SetVar R_Request_Token.Message &@R_Request_Message +# +# Check Point: Call Http.Request(). +# +Http->Request {&@R_Request_Token, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_TIMEOUT] +RecordAssertion $assert $GenericAssertionGuid \ + "Http.Request - Call Request()" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_TIMEOUT" + + + + +SetVar R_Request_Message_Data.Request 0 +SetVar R_Request_Message.Data @R_Request_Message_Data + +SetVar R_Request_Body "name=Professional" +SetVar R_Request_Message.BodyLength 20 +SetVar R_Request_Message.Body &@R_Request_Body + + +Http->Request {&@R_Request_Token, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpRequestConf3AssertionGuid003 \ + "Http.Request - Call Request()" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + + + +# +# Clean up the environment on EUT side. +# + +CleanUpEutEnvironmentBegin +BS->CloseEvent "@R_Request_Token.Event, &@R_Status" +GetAck +CleanUpEutEnvironmentEnd diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf1.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf1.Case1.tcl new file mode 100644 index 0000000..74bd10b --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf1.Case1.tcl @@ -0,0 +1,118 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid 06946A35-FF0A-4dd7-A1D6-36B9851AC79B +CaseName Response.Conf1.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_NOT_STARTED. \ + -- This EFI HTTP Protocol instance has not been configured.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +proc CleanUpEutEnvironmentBegin {} { + HttpServiceBinding->DestroyChild "@R_Handle, &@R_Status" + GetAck + +} + +proc CleanUpEutEnvironmentEnd {} { + EndScope _RESPONSE_CONF1_CASE1_ + EndLog +} + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _RESPONSE_CONF1_CASE1_ + + +# +# Parameter Definition +# R_ represents "Remote EFI Side Parameter" +# L_ represents "Local OS Side Parameter" +# + +UINTN R_Status +UINTN R_Handle +UINTN R_Context + +EFI_HTTP_RESPONSE_DATA R_Response_Data +EFI_HTTP_MESSAGE_DATA R_Response_Message_Data; + +EFI_HTTP_MESSAGE R_Response_Message +EFI_HTTP_TOKEN R_Response_Token + + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +BS->CreateEvent "$EVT_NOTIFY_SIGNAL, $EFI_TPL_CALLBACK, 1, &@R_Context, \ + &@R_Response_Token.Event, &@R_Status" +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "BS.CreateEvent." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + + +SetVar R_Response_Data.StatusCode $EFI_SUCCESS +SetVar R_Response_Message_Data.Response &@R_Response_Data + +SetVar R_Response_Message.Data @R_Response_Message_Data +SetVar R_Response_Message.HeaderCount 0 +SetVar R_Response_Message.Headers 0 + +SetVar R_Response_Message.BodyLength 0 +SetVar R_Response_Message.Body 0 + +SetVar R_Response_Token.Status $EFI_SUCCESS +SetVar R_Response_Token.Message &@R_Response_Message + + + +Http->Response {&@R_Response_Token, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_NOT_STARTED] +RecordAssertion $assert $HttpResponseConf1AssertionGuid001 \ + "Http.Response - Call Response() without a configuration." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_NOT_STARTED" + +# +# Clean up the environment on EUT side. +# + +CleanUpEutEnvironmentBegin +BS->CloseEvent "@R_Response_Token.Event, &@R_Status" +GetAck +CleanUpEutEnvironmentEnd diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf2.Case1.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf2.Case1.tcl new file mode 100644 index 0000000..d978b5e --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf2.Case1.tcl @@ -0,0 +1,86 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid E58E6C52-2A88-40a5-9C03-A045ED99C6D1 +CaseName Response.Conf2.Case1 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER. \ + -- Token is NULL.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +proc CleanUpEutEnvironmentBegin {} { + HttpServiceBinding->DestroyChild "@R_Handle, &@R_Status" + GetAck + +} + +proc CleanUpEutEnvironmentEnd {} { + EndScope _RESPONSE_CONF2_CASE1_ + EndLog +} + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _RESPONSE_CONF2_CASE1_ + + + +UINTN R_Status +UINTN R_Handle + + + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +# +# Check Point: Call Http.Response() +# with NULL Token. +# +Http->Response {NULL, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpResponseConf2AssertionGuid001 \ + "Http.Response - Call Response() with NULL Token." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + +# +# Clean up the environment on EUT side. +# + +CleanUpEutEnvironmentBegin + +CleanUpEutEnvironmentEnd diff --git a/uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf2.Case2.tcl b/uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf2.Case2.tcl new file mode 100644 index 0000000..7e76cb6 --- /dev/null +++ b/uefi-sct/EMS/Bin/TestCase/HTTP/Response.Conf2.Case2.tcl @@ -0,0 +1,136 @@ +# +# Copyright (c) 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 +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +################################################################################ +CaseLevel CONFORMANCE +CaseAttribute AUTO +CaseVerboseLevel DEFAULT + +# +# test case Name, category, description, GUID... +# +CaseGuid AEA768FC-9585-4530-9A26-76F8310962F0 +CaseName Response.Conf2.Case2 +CaseCategory HTTP +CaseDescription {This case is to test the conformance - EFI_INVALID_PARAMETER. \ + -- Token->Message is NULL.} +################################################################################ + +Include HTTP/include/Http.inc.tcl + +proc CleanUpEutEnvironmentBegin {} { + HttpServiceBinding->DestroyChild "@R_Handle, &@R_Status" + GetAck + +} + +proc CleanUpEutEnvironmentEnd {} { + EndScope _RESPONSE_CONF2_CASE2_ + EndLog +} + +# +# Begin log ... +# +BeginLog + +# +# BeginScope +# +BeginScope _RESPONSE_CONF2_CASE2_ + + + +UINTN R_Status +UINTN R_Handle +UINTN R_Context + +EFI_HTTP_RESPONSE_DATA R_Response_Data +EFI_HTTP_HEADER R_Response_Headers +EFI_HTTP_MESSAGE R_Response_Message +EFI_HTTP_TOKEN R_Response_Token +EFI_HTTP_MESSAGE_DATA R_Response_Message_Data + +UINTN R_Response_Token_Status + +EFI_IPv4_ADDRESS R_Configure_LocalAddress +EFI_IPv4_ADDRESS R_Configure_SubnetMask +EFI_HTTPv4_ACCESS_POINT R_Configure_AccessPointv4 +EFI_HTTP_CONFIG_DATA_ACCESSPOINT R_Configure_AccessPoint +EFI_HTTP_CONFIG_DATA R_Configure_HttpConfigData + + + +# +# Create Http Child. +# +HttpServiceBinding->CreateChild "&@R_Handle, &@R_Status" +GetAck +SetVar [subst $ENTS_CUR_CHILD] @R_Handle +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "HttpSBP.CreateChild - Create Child 1" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +SetIpv4Address R_Configure_LocalAddress "192.168.88.88" +SetIpv4Address R_Configure_SubnetMask "255.255.255.0" +SetVar R_Configure_AccessPointv4.UseDefaultAddress FALSE +SetVar R_Configure_AccessPointv4.LocalAddress @R_Configure_LocalAddress +SetVar R_Configure_AccessPointv4.LocalSubnet @R_Configure_SubnetMask +SetVar R_Configure_AccessPointv4.LocalPort 6666 +SetVar R_Configure_AccessPoint.IPv4Node &@R_Configure_AccessPointv4 + + +SetVar R_Configure_HttpConfigData.HttpVersion $HttpVersion10 +SetVar R_Configure_HttpConfigData.TimeOutMillisec 10 +SetVar R_Configure_HttpConfigData.LocalAddressIsIPv6 FALSE +SetVar R_Configure_HttpConfigData.AccessPoint @R_Configure_AccessPoint + + +Http->Configure {&@R_Configure_HttpConfigData, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "Http.Configure - Call Configure()" \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + + +BS->CreateEvent "$EVT_NOTIFY_SIGNAL, $EFI_TPL_CALLBACK, 1, &@R_Context, \ + &@R_Response_Token.Event, &@R_Status" +GetAck +set assert [VerifyReturnStatus R_Status $EFI_SUCCESS] +RecordAssertion $assert $GenericAssertionGuid \ + "BS.CreateEvent." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_SUCCESS" + +SetVar R_Response_Token_Status $EFI_SUCCESS +SetVar R_Response_Token.Status @R_Response_Token_Status +SetVar R_Response_Token.Message 0 + +# +# Check Point: Call Http.Response() +# with NULL Token->Message. +# +Http->Response {&@R_Response_Token, &@R_Status} +GetAck +set assert [VerifyReturnStatus R_Status $EFI_INVALID_PARAMETER] +RecordAssertion $assert $HttpResponseConf2AssertionGuid002 \ + "Http.Request - Call Request() with NULL Token->Message." \ + "ReturnStatus - $R_Status, ExpectedStatus - $EFI_INVALID_PARAMETER" + +# +# Clean up the environment on EUT side. +# + +CleanUpEutEnvironmentBegin +BS->CloseEvent "@R_Response_Token.Event, &@R_Status" +GetAck +CleanUpEutEnvironmentEnd -- 2.9.0.windows.1