The LUN is an 8 byte array that is displayed in hexadecimal
format with byte 0 first (i.e., on the left) and byte 7 last
(i.e, on the right).

Cc: Supreeth Venkatesh <supreeth.venkat...@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin <eric....@intel.com>
---
 .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c         | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
index fc099d8..96cd84f 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2017 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -1445,6 +1445,7 @@ CreateiScsiDeviceNode (
   UINT64                      LunNum;
   ISCSI_DEVICE_PATH_WITH_NAME *iSCSI;
 
+  LunNum            = 0;
   NameStr           = SctSplitStr (&TextDeviceNode, L',');
   PortalGroupStr    = SctSplitStr (&TextDeviceNode, L',');
   LunStr            = SctSplitStr (&TextDeviceNode, L',');
@@ -1459,7 +1460,7 @@ CreateiScsiDeviceNode (
                                                         );
   SctUnicodeToAscii (iSCSI->iSCSITargetName, NameStr, SctStrLen (NameStr));
   iSCSI->TargetPortalGroupTag = (UINT16) SctStrToUInt (PortalGroupStr);
-  SctStrToUInt64 (LunStr, &LunNum);
+  StrToUInt8Array(LunStr, &LunNum);
   iSCSI->Lun = LunNum;
 
   Options = 0x0000;
@@ -2846,12 +2847,12 @@ DevicePathFromTextConvertTextToDeviceNodeCoverageTest (
                 (UINTN)__LINE__
                 );
   //
-  // TDS 3.10.1.2.26
+  // TDS 3.10.1.2.26   In Lun 0x0000005678000000, byte 3 is 0x56 and byte4 is 
0x78
   //
-  SctStrCpy (text, L"MyTargetName,0x12AB,5678,CRC32C,None,CHAP_BI,TCP");
+  SctStrCpy (text, 
L"MyTargetName,0x12AB,0x0000005678000000,CRC32C,None,CHAP_BI,TCP");
   pDevicePath = CreateiScsiDeviceNode(text);
 
-  SctStrCpy (text, L"iSCSI(MyTargetName,0x12AB,5678,CRC32C,None,CHAP_BI,TCP)");
+  SctStrCpy (text, 
L"iSCSI(MyTargetName,0x12AB,0x0000005678000000,CRC32C,None,CHAP_BI,TCP)");
   pReDevicePath = DevicePathFromText->ConvertTextToDeviceNode (text);
   if (SctCompareMem (pDevicePath, pReDevicePath, SctDevicePathNodeLength 
((EFI_DEVICE_PATH_PROTOCOL *) pReDevicePath)) == 0) {
     AssertionType = EFI_TEST_ASSERTION_PASSED;
@@ -2866,7 +2867,7 @@ DevicePathFromTextConvertTextToDeviceNodeCoverageTest (
                 AssertionType,
                 gDevicePathFromTextBBTestFunctionAssertionGuid114,
                 L"EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL - ConvertDeviceNodeToText 
must correctly recover the converting ConvertTextToDeviceNode has acted on the 
device node string",
-                L"%a:%d, Convert 
iSCSI(MyTargetName,0x12AB,5678,CRC32C,None,CHAP_BI,TCP)",
+                L"%a:%d, Convert 
iSCSI(MyTargetName,0x12AB,0x0000005678000000,CRC32C,None,CHAP_BI,TCP)",
                 __FILE__,
                 (UINTN)__LINE__
                 );
-- 
2.9.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to