From nobody Fri Apr 19 05:44:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+63588+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1596216735260297.5289234935839; Fri, 31 Jul 2020 10:32:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id seppYY1788612xw3Bx7bL1jf; Fri, 31 Jul 2020 10:32:14 -0700 X-Received: from EUR01-VE1-obe.outbound.protection.outlook.com (EUR01-VE1-obe.outbound.protection.outlook.com [40.107.14.77]) by mx.groups.io with SMTP id smtpd.web11.651.1596216013395222451 for ; Fri, 31 Jul 2020 10:20:14 -0700 X-Received: from DB7PR05CA0058.eurprd05.prod.outlook.com (2603:10a6:10:2e::35) by AM5PR0801MB1763.eurprd08.prod.outlook.com (2603:10a6:203:3b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Fri, 31 Jul 2020 17:20:09 +0000 X-Received: from DB5EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::78) by DB7PR05CA0058.outlook.office365.com (2603:10a6:10:2e::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.17 via Frontend Transport; Fri, 31 Jul 2020 17:20:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+63588+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT039.mail.protection.outlook.com (10.152.21.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20 via Frontend Transport; Fri, 31 Jul 2020 17:20:09 +0000 X-Received: ("Tessian outbound 1c27ecaec3d6:v62"); Fri, 31 Jul 2020 17:20:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d1080b9978df3e16 X-CR-MTA-TID: 64aa7808 X-Received: from 967427f852a3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2FC504A5-EF08-40CB-8ED3-012CC592F745.1; Fri, 31 Jul 2020 17:20:03 +0000 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 967427f852a3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 31 Jul 2020 17:20:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ijVXRT3n31n9k8blue711oLd9rpRiBQdBRKL4q5ZAS6YOvxWFpPeh+rRoh+dSVn5SL3k7qUjahCNoIUsFOCiE2+uLqO3j569JRfdxZxHC+fK+JllJrfAe4/21WEaTQR9B2VzEOKOuPUhnuqnhbljypU++F8YFOkO+TIcAfYegn7NzbiSOyOsLB34eoyWTk8jLs6kaRsmBzy8gCLNE4H//9P440hTeLqjCD4fGn9b/+RZ2/ddt3RglLAo+obbMyZeCkUmF4FCZUJPRemS5ED8IjUjbm579eP/ta8ZruxOyQSJXJjQNgIaUMmAew/Ue9A/SqgQXAmy+0UFKgOiM1LN6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gAZf38lJuOGGk89ytgH0G0wGgEtZsUmWyrvXURDMzno=; b=b7fXQu47Q5ENm+fuqXq7d7/lCLtqxsVyJYbU++lrgzxeCeFAY4++4TzweV2kqaz90d9rYlpkOxuiJkXfXWLnNoymAHwkd2Vk5mF7RWyUkUnPi10I9LIypPDh8r4Hz1rDyiQX0Jx7Igblm/VD+cmpxJRBELArzh2fr1aWGverDrEpfzRTD902mHWNbvX2vpcV5/mHmQs6cp5qSL94EuTW11drgV2hkyv+q9TdixP5YI1lVUzf2O075jk6ui72qKV88p3rTU0bhEa2fuJ81F+kOF0QzinY2jFi/mjL53+KUJQOCUI45PGE+pSzIpeQ07Vw7a3EZWtmCf57TkrGbWNFLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; X-Received: from DB8PR08MB4010.eurprd08.prod.outlook.com (2603:10a6:10:ab::15) by DBAPR08MB5670.eurprd08.prod.outlook.com (2603:10a6:10:1a6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.26; Fri, 31 Jul 2020 17:20:02 +0000 X-Received: from DB8PR08MB4010.eurprd08.prod.outlook.com ([fe80::cde5:14f:5af0:8e44]) by DB8PR08MB4010.eurprd08.prod.outlook.com ([fe80::cde5:14f:5af0:8e44%6]) with mapi id 15.20.3239.020; Fri, 31 Jul 2020 17:20:02 +0000 From: Grant Likely To: devel@edk2.groups.io CC: nd@arm.com, Grant Likely , G Edhaya Chandran , Heinrich Schuchardt , Samer El-Haj-Mahmoud Subject: [edk2-devel] [PATCH] Check return status on calls to GetTime() Date: Fri, 31 Jul 2020 18:19:49 +0100 Message-ID: <20200731171949.15748-1-grant.likely@arm.com> X-ClientProxiedBy: LO2P265CA0282.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::30) To DB8PR08MB4010.eurprd08.prod.outlook.com (2603:10a6:10:ab::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from moist.secretlab.ca (188.28.130.137) by LO2P265CA0282.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.17 via Frontend Transport; Fri, 31 Jul 2020 17:20:00 +0000 X-Originating-IP: [188.28.130.137] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fa96ddb6-dfc0-45b5-63e1-08d83575fa05 X-MS-TrafficTypeDiagnostic: DBAPR08MB5670:|AM5PR0801MB1763: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:800;OLM:800; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: yl9u8y9f6G4V1FpDIlRSstwbz52QgRrwcQXP0YDIk7COnQkiRjFmkD9uLIDcyna6zE0C7jUvTL9yegZYX2DEAKB1CIuZq0PoQs81rTd4L40R/KURUfr6sGIFB4irckRhMTE3fEXUG5N0Q45zdcheu5F8ivwVf542hdp9NC8rVOPR56XrP0sZCWXSCJZ305x9dUDLO1siY8wxVoo7u84IgD4MazNYsWEtarUS0Hu7ElGcfW8Yeoo6mrkv83hnldIL7Bzt108MYDliy3ibyGcJ/rnMpNz6+T/ivpvBZxWwRYjYaTGdl1RIejc9MYhl/MHSJERHF6HO2x8wEVt5lvHkQN0XQnsyn7stha6d6GqMPPS54K5v5CU5Ydr7KiKXsVa7oJAXfMDunPz63f9YqLvcfA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR08MB4010.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(376002)(136003)(396003)(39860400002)(8676002)(6916009)(86362001)(8936002)(6486002)(4326008)(36756003)(54906003)(83380400001)(6512007)(316002)(66946007)(66476007)(66556008)(478600001)(2616005)(44832011)(26005)(5660300002)(1076003)(2906002)(30864003)(16526019)(6666004)(186003)(966005)(6506007)(956004)(55236004)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Bsb1wPl0yoR1QzrI+lOhNwI6TmjtxbZth2wIrRfC3rXBrOq0TkwF3g/wcNRDfA2BA6PUa/Ikt81CHue7ajydAoVVZMoK3OLitAzQSvLYJuju40xUkywPGeD4UZD5lIEr/u6gtHjC+AixDtsR/XsjdXZoin8UPCqgFL40SULTlcAreTt0LOXesInJFxSXMBoPKEJFqeMwJ64NIfDQo7RNuhANkePzcZ7UWKiAtEn+J0wtbjjYBewRWD6e0WBwlZDayRS3Qf2sC0ziGX0x7xx981DKdwq3s070LW/gzA5OtQnDPU7n+W1+wbhQeX0AOvNnD893mLQyh/ZvJKA0lMkbPRryHY841l2t5j/ShOM+/B63et6pSRlIEZRXjpcc+E6EotxHz+4LLzZDbRFOw8f9xlNy4grThxr6iZQLIy7vAOfBVoBzphop8bE3h6z/9dk5V6fQVHsgDk6wuT3sjA9XjRq+MrJPnA93/a+htzFhPCHX4MReRewEFtFk75GE7/Ns X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5670 Original-Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 4b5e6ce9-c23e-4a79-320a-08d83575f544 X-Microsoft-Antispam-Message-Info: LWK5YyXhd8NAIrt+gFvJ3e6LnF3S3c0Uf0oroVblnMaBR+ZvWaDiQkDj6+r0V91WQma1la8iRn/yuM9BvZjhTNAZLY9ocZuvql5MO7mV/cRqM0cnvn3IxrdKRXGn0L9CJW88cprCU1O2SWPyV0q8821infdisv3hissYeR8PjgWrULnu6cmJzODBH9B0VWNeMGj+eIIdgNLcLyH1s2E7RrLab7khDKGyEOJTApm84PMAC7kXWyVs5mf+QShKY99aW3M4dFcCDvdByrJLxHyqw3FCPedo55cWDw2fIJMqFcU4bb4uG9An5wZLJCsykEILrSzD/+VrF/58hOAkWdPgJWb0gTxBIa06gG1wz/cK1+A2FejKunkLMJ4ggPAL47FF4yH+NjsJiJIJjtb9G0BqF3/Ds2iVHBkVlxcV1CR9YGhYxidpD4lMMn7J4ASLuxyUdXwEwgAlwyFNc7cZdg2XYShbLkXPIGgtt6lYQoJzRHw= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2020 17:20:09.4948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa96ddb6-dfc0-45b5-63e1-08d83575fa05 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1763 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,grant.likely@arm.com X-Gm-Message-State: CGNV6uZxHcqDbOQBsZsesGEMx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1596216734; bh=Xf/X/ic75gzYL9ADF5GHdF2pq+NWX1VPcXe2aM3ZJug=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=hKQKPcpKkwUA2BVhj264hQ3GX0z0KshBj2FIxme5ZIaXoJbfh2dWkIZoFVxi1u1awWu //sT85x79Vf3c5zQTcQMt4+ImQoZusiYF/e8W2pR1CZ2LPxYgN2Z8TXK3SkqrlwppcPXz S+I5yDDenktclUtCqsRA56iQBTeidmQUgq4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Not all platforms implement GetTime(), but the SCT just assumes calls to GetTime will be successful. If GetTime() doesn't return EFI_SUCCESS, then the EFI_TIME value will be uninitialized data. Fix by checking the GetTime() return code. If it doesn't return EFI_SUCCESS, then use the traditional 1/1/1970 epoch so that the test report at least looks sane, but it is obvious that we don't have a valid timestamp. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2870 Cc: G Edhaya Chandran Cc: Heinrich Schuchardt Cc: Samer El-Haj-Mahmoud Signed-off-by: Grant Likely Reviewed-by: G Edhaya Chandran Reviewed-by: Heinrich Schuchardt Reviewed-by: Samer El-Haj-Mahmoud --- .../SimpleNetwork/SimpleNetworkENTSTestCase.c | 26 +++++++++++++------ .../MiscBootServicesBBTestFunction.c | 8 ++++-- .../DriverBindingBBTestFunction.c | 5 +++- .../SCT/Drivers/StandardTest/StandardTest.c | 11 +++++--- .../Framework/ENTS/EasDispatcher/Core/Eas.c | 9 +++++-- .../ENTS/EasDispatcher/Exec/EasCmdDisp.c | 20 +++++++++----- 6 files changed, 57 insertions(+), 22 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/RIVL/Protocol/SimpleNetwork/SimpleNet= workENTSTestCase.c b/uefi-sct/SctPkg/TestCase/RIVL/Protocol/SimpleNetwork/S= impleNetworkENTSTestCase.c index 9c8d2a70..5579be7e 100644 --- a/uefi-sct/SctPkg/TestCase/RIVL/Protocol/SimpleNetwork/SimpleNetworkENT= STestCase.c +++ b/uefi-sct/SctPkg/TestCase/RIVL/Protocol/SimpleNetwork/SimpleNetworkENT= STestCase.c @@ -24,6 +24,8 @@ Abstract: =20 #include "SimpleNetworkENTSTestCase.h" =20 +static EFI_TIME Epoch =3D { .Year =3D 1970, .Month =3D 1, .Day =3D 1 }; + // // SimpleNetwork.Start // @@ -928,7 +930,8 @@ Returns: Status =3D EFI_SUCCESS; tBS->Stall (5000); =20 - tRT->GetTime (&BeginTime, NULL); + if (tRT->GetTime (&BeginTime, NULL) !=3D EFI_SUCCESS) + BeginTime =3D Epoch; for (Index =3D 0; Index < 1;) { Status =3D SimpleNetwork->Transmit ( SimpleNetwork, @@ -964,7 +967,8 @@ Returns: } } =20 - tRT->GetTime (&BeginTime, NULL); + if (tRT->GetTime (&BeginTime, NULL) !=3D EFI_SUCCESS) + BeginTime =3D Epoch; =20 for (Index =3D 1; Index < TransmitPattern1Number;) { Status =3D SimpleNetwork->Transmit ( @@ -1002,7 +1006,8 @@ Returns: } =20 End: - tRT->GetTime (&EndTime, NULL); + if (tRT->GetTime (&EndTime, NULL) !=3D EFI_SUCCESS) + EndTime =3D Epoch; =20 *TransmitPattern1Status =3D Status; =20 @@ -1125,7 +1130,8 @@ Returns: Status =3D EFI_SUCCESS; tBS->Stall (5000); =20 - tRT->GetTime (&BeginTime, NULL); + if (tRT->GetTime (&BeginTime, NULL) !=3D EFI_SUCCESS) + BeginTime =3D Epoch; for (Index =3D 0; Index < 1;) { Status =3D SimpleNetwork->Transmit ( SimpleNetwork, @@ -1161,7 +1167,8 @@ Returns: } } =20 - tRT->GetTime (&BeginTime, NULL); + if (tRT->GetTime (&BeginTime, NULL) !=3D EFI_SUCCESS) + BeginTime =3D Epoch; =20 for (Index =3D 1; Index < TransmitPattern2Number;) { Status =3D SimpleNetwork->Transmit ( @@ -1199,7 +1206,8 @@ Returns: } =20 End: - tRT->GetTime (&EndTime, NULL); + if (tRT->GetTime (&EndTime, NULL) !=3D EFI_SUCCESS) + EndTime =3D Epoch; =20 *TransmitPattern1Status =3D Status; =20 @@ -1326,7 +1334,8 @@ Returns: } } =20 - tRT->GetTime (&BeginTime, NULL); + if (tRT->GetTime (&BeginTime, NULL) !=3D EFI_SUCCESS) + BeginTime =3D Epoch; =20 for (Index =3D 1; Index < ReceivePattern1Number;) { *ReceivePattern1BufferSize =3D BufferSizeOrg; @@ -1346,7 +1355,8 @@ Returns: } } =20 - tRT->GetTime (&EndTime, NULL); + if (tRT->GetTime (&EndTime, NULL) !=3D EFI_SUCCESS) + EndTime =3D Epoch; =20 *ReceivePattern1Status =3D Status; =20 diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootService= s/BlackBoxTest/MiscBootServicesBBTestFunction.c b/uefi-sct/SctPkg/TestCase/= UEFI/EFI/BootServices/MiscBootServices/BlackBoxTest/MiscBootServicesBBTestF= unction.c index 1d231d8c..3a530282 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/Black= BoxTest/MiscBootServicesBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/Black= BoxTest/MiscBootServicesBBTestFunction.c @@ -27,6 +27,8 @@ Abstract: #include "SctLib.h" #include "MiscBootServicesBBTestMain.h" =20 +static EFI_TIME Epoch =3D { .Year =3D 1970, .Month =3D 1, .Day =3D 1 }; + /** * Entrypoint for gtBS->SetWatchdogTimer() Interface Test. * @param This a pointer of EFI_BB_TEST_PROTOCOL. @@ -821,13 +823,15 @@ BBTestStallInterfaceTest ( // // 4.2.2.1 Stall must succeed. // - gtRT->GetTime (&StartTime, NULL); + if (gtRT->GetTime (&StartTime, NULL) !=3D EFI_SUCCESS) + StartTime =3D Epoch; OldTpl =3D gtBS->RaiseTPL (TplArray[Index]); Status =3D gtBS->Stall ( 10000000 ); gtBS->RestoreTPL (OldTpl); - gtRT->GetTime (&EndTime, NULL); + if (gtRT->GetTime (&EndTime, NULL) !=3D EFI_SUCCESS) + EndTime =3D Epoch; if (Status =3D=3D EFI_SUCCESS) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/DriverBinding/Black= BoxTest/DriverBindingBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/P= rotocol/DriverBinding/BlackBoxTest/DriverBindingBBTestFunction.c index bf675feb..4ab52dcd 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/DriverBinding/BlackBoxTest= /DriverBindingBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/DriverBinding/BlackBoxTest= /DriverBindingBBTestFunction.c @@ -36,6 +36,8 @@ static const UINTN MonthLengths[2][12] =3D { { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; =20 +static EFI_TIME Epoch =3D { .Year =3D 1970, .Month =3D 1, .Day =3D 1 }; + #define MINS_PER_HOUR 60 #define HOURS_PER_DAY 24 #define SECS_PER_MIN 60 @@ -1052,7 +1054,8 @@ EndLogging ( WriteLogFile (Private, DashLine, SYSTEMLOG); WriteLogFile (Private, DashLine, CASELOG); =20 - gtRT->GetTime (&CurrentTime, NULL); + if (gtRT->GetTime (&CurrentTime, NULL) !=3D EFI_SUCCESS) + CurrentTime =3D Epoch; DBSPrint (Buffer, EFI_MAX_PRINT_BUFFER, L"Test Finished: %t\n", &Current= Time); =20 WriteLogFile (Private, Buffer, SYSTEMLOG); diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/St= andardTest.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/= StandardTest.c index 84025457..836f072a 100644 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardT= est.c +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardT= est.c @@ -30,6 +30,8 @@ Abstract: #include "StandardTest.h" #include =20 +static EFI_TIME Epoch =3D { .Year =3D 1970, .Month =3D 1, .Day =3D 1 }; + // // Prototypes // @@ -1081,7 +1083,8 @@ Returns: StslWriteLogFile (Private, Buffer); =20 CurrentTime =3D &Private->StartTime; - tRT->GetTime (CurrentTime, NULL); + if (tRT->GetTime (CurrentTime, NULL) !=3D EFI_SUCCESS) + *CurrentTime =3D Epoch; =20 } else { StslWriteLogFile (Private, DashLine); @@ -1118,7 +1121,8 @@ Returns: =20 StslWriteLogFileName (Private); CurrentTime =3D &Private->StartTime; - tRT->GetTime (CurrentTime, NULL); + if (tRT->GetTime (CurrentTime, NULL) !=3D EFI_SUCCESS) + *CurrentTime =3D Epoch; SctSPrint (Buffer, EFI_MAX_PRINT_BUFFER, L"Test Started: %t\n", Curren= tTime); StslWriteLogFile (Private, Buffer); =20 @@ -1238,7 +1242,8 @@ Returns: =20 StslWriteLogFileName (Private); =20 - tRT->GetTime (&CurrentTime, NULL); + if (tRT->GetTime (&CurrentTime, NULL) !=3D EFI_SUCCESS) + CurrentTime =3D Epoch; =20 SecondsElapsed =3D SecondsElapsedFromBaseYear ( Private->StartTime.Year, diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispa= tcher/Core/Eas.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/Ea= sDispatcher/Core/Eas.c index 28f5ed4a..60b1c4dc 100644 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/C= ore/Eas.c +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/C= ore/Eas.c @@ -23,9 +23,12 @@ Abstract: --*/ =20 =20 +#include "Sct.h" #include "Sct.h" #include EFI_TEST_PROTOCOL_DEFINITION (EntsMonitorProtocol) =20 +static EFI_TIME Epoch =3D { .Year =3D 1970, .Month =3D 1, .Day =3D 1 }; + STATIC EFI_STATUS AgentTestMain ( @@ -310,7 +313,8 @@ DelaySctAgentCmdPost ( } SctAgentCmdDelayedPost->CmdReturn =3D CmdReturn; SctAgentCmdDelayedPost->Cmd.ComdResult =3D CmdResult; - tRT->GetTime (&SctAgentCmdDelayedPost->StartTime, NULL); + if (tRT->GetTime (&SctAgentCmdDelayedPost->StartTime, NULL) !=3D EFI_SUC= CESS) + SctAgentCmdDelayedPost->StartTime =3D Epoch; =20 return Status; } @@ -327,7 +331,8 @@ PostSctAgentDelayedCmd ( return EFI_SUCCESS; } =20 - tRT->GetTime (&SctAgentCmdDelayedPost->EndTime, NULL); + if (tRT->GetTime (&SctAgentCmdDelayedPost->EndTime, NULL) !=3D EFI_SUCCE= SS) + SctAgentCmdDelayedPost->EndTime =3D Epoch; =20 Status =3D RecordMessage ( &SctAgentCmdDelayedPost->Cmd.ComdRuntimeInfo, diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispa= tcher/Exec/EasCmdDisp.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/= ENTS/EasDispatcher/Exec/EasCmdDisp.c index 1ff6d569..cb6f08cf 100644 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/E= xec/EasCmdDisp.c +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/E= xec/EasCmdDisp.c @@ -50,6 +50,8 @@ Abstract: =20 EFI_CPU_ARCH_PROTOCOL *Cpu =3D NULL; =20 +static EFI_TIME Epoch =3D { .Year =3D 1970, .Month =3D 1, .Day =3D 1 }; + // // Local Function Definition // @@ -132,9 +134,11 @@ Returns: // // Perform EFTP operation. // - tRT->GetTime (&StartTime, NULL); + if (tRT->GetTime (&StartTime, NULL) !=3D EFI_SUCCESS) + StartTime =3D Epoch; Status =3D EftpDispatchFileTransferComd (FileCmdType); - tRT->GetTime (&EndTime, NULL); + if (tRT->GetTime (&EndTime, NULL) !=3D EFI_SUCCESS) + EndTime =3D Epoch; =20 if (Status =3D=3D EFI_OUT_OF_RESOURCES) { return EFI_OUT_OF_RESOURCES; @@ -365,9 +369,11 @@ Returns: // // Execute Shell Command // - tRT->GetTime (&StartTime, NULL); + if (tRT->GetTime (&StartTime, NULL) !=3D EFI_SUCCESS) + StartTime =3D Epoch; Status =3D SctShellExecute (&mImageHandle, (gEasFT->Cmd)->ComdArg, FALSE= , NULL, NULL);; - tRT->GetTime (&EndTime, NULL); + if (tRT->GetTime (&EndTime, NULL) !=3D EFI_SUCCESS) + EndTime =3D Epoch; EFI_ENTS_DEBUG ((EFI_ENTS_D_TRACE, L"dispatch:(%s)", (gEasFT->Cmd)->Comd= Arg)); SctPrint (L"dispatch:(%s) - %r\n", (gEasFT->Cmd)->ComdArg, Status); if (Status =3D=3D EFI_OUT_OF_RESOURCES) { @@ -1483,9 +1489,11 @@ Returns: // // Resume SCT execution by executing "sct -c" in sct passive mode. // - tRT->GetTime (&StartTime, NULL); + if (tRT->GetTime (&StartTime, NULL) !=3D EFI_SUCCESS) + StartTime =3D Epoch; Status =3D SctShellExecute (&mImageHandle, (gEasFT->Cmd)->ComdArg, FALSE= , NULL, NULL);; - tRT->GetTime (&EndTime, NULL); + if (tRT->GetTime (&EndTime, NULL) !=3D EFI_SUCCESS) + EndTime =3D Epoch; EFI_ENTS_DEBUG ((EFI_ENTS_D_TRACE, L"dispatch:(%s)", (gEasFT->Cmd)->Comd= Arg)); SctPrint (L"dispatch:(%s) - %r\n", (gEasFT->Cmd)->ComdArg, Status); if (Status =3D=3D EFI_OUT_OF_RESOURCES) { --=20 2.20.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#63588): https://edk2.groups.io/g/devel/message/63588 Mute This Topic: https://groups.io/mt/75912028/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-