[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/5] automation: Add the expect script with test case for FVP


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Fri, 8 Dec 2023 03:01:23 +0000
  • Accept-language: zh-CN, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BTx6Q4ju/NXdgOmxt75JmWE+3kGSbKJGfCmVxbR9Bew=; b=PsmvWT+8pGWTbzjEMlwbsHiu5vgiRVeNm/D8Cfngc3uqbnqN6niyoOHJHNeSE6z8FfAMnfd5vFl5dURk6AtZlqPGsejMm+Bx9CtRII9jvnz/hmlXTENbVv5n1cTzjGQzZrurw5JxnoZzd6vm3FWP1qTOzhGeQF9mB1QIoqVbPV1jir41+/z05TqWXmKPNNXWsHWq+9IFpVNHR7i6VuwkBPHHUX9VLGeIDfbdGuzgBXmI2ryf6YhrHoA8LNfOjRsyvIHq+O85NceyYYaf0O3gz3acaniD3shSovePMbQrRtuRdkDsYAYIN72C0cdFMVmG6cxGJrpYILtHXWwnuaJF7w==
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BTx6Q4ju/NXdgOmxt75JmWE+3kGSbKJGfCmVxbR9Bew=; b=FpmU/rQ7srmMbehCf7fpFEmi5z5hm8C9QHqRcMIYwlNgGVHnQmiMRzaUPsgXxNKcVpNG+lpEieJ8kVaTUowxjHCCt32ZCzbVtraCci2cP4wQuaXAFkBvVDqNjZ8VmjBQyUI8kxC5t22nWrV32kFw77Sh49Mip+OVbD15lF9YnCyq43X0xCXrDE9wINDQcKfUHdcrpSVT+SJDzOxExk/4D24Ap0l5J25spPaR3O/SMxbIaBNDiE9kr3ge7vgA0cQtXeE0Pgm0IAn+y9Dv5u1h7odczcjg574p9xppURkWK15N4DM5oTmee7ISx8dL9yT50Uqg8ytnDfFsCuOSZgUjQA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=m2fucHFLoBeYhOnB+RHr5dqbFxMoFPVB7+zZscqfLPpjhPkEF9yX+jYdsOM3NLeAqrINF35lupx+nF0MKEvXWnkEXlfBDAL5L4mKAVdH6EA56mQVM5648XL6NopsLO5tS9MFXceC+hHkxhPyLNVf8oop0Uq1Np7MMQjp2HCpamXyfKVovTRTmQR/zmXCPJdBgdwMrrfbWCKeIRPKuEIpJE51hPZ9htCszbz07poQvamGJiFffgP58u63OqBmPxhOKol7p3pnO5LO4xH6067Y4w4dNmHjmANyXoNYdHggsHVD7oaBaacpXmino6PXENCQuI8A64bw6eJkdG4vIUcmCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ms3Jf823zk/hrMY7dXqV0wj3Z0t+JE7MKYCi4W84oExRrNhkNR2HNmumI/73ntJSCGci7nCPlJqabYTUjuV7a0LiLGFVjR0fXlVn/VGHRAEGQQL19zHY9Yy//8ys5KF20U18l4rvuGTY6LFMtobvcp03Xs+ZFaWA3Z6ZlU8DENMgnORtQJsfabLIAtcw9iZ8Zcpv4HL4BPv+RSymlasRnMzqxWCH6BqMzZZpScz4o7LeHZahDNZefX3DhUgkuvjhnIwek3plkTW6aJ/yJdAPATOX0bF9gDDw7LyOTlhWgMZ9/UDWb+uAA6pKvFZXVV1QA4R0rjJLIfVS2om17F0Fgw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>
  • Delivery-date: Fri, 08 Dec 2023 03:02:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHaKRTRSAbthQjm9k2SM6wWsGqHurCenEEAgAAHDICAABAgAA==
  • Thread-topic: [PATCH 3/5] automation: Add the expect script with test case for FVP

Hi Stefano,

> On Dec 8, 2023, at 10:03, Henry Wang <Henry.Wang@xxxxxxx> wrote:
> 
> Hi Stefano,
> 
>> On Dec 8, 2023, at 09:38, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
>>> +set host_ip $expect_out(0,string)
>>> +
>>> +# Start the FVP and run the test
>>> +spawn bash -c "$runcmd"
>>> +
>>> +test_boot 2000 "$host_ip"
>>> +
>>> +send_user "\nExecution with SUCCESS\n"
>> 
>> Won't this always return SUCCESS even in case of failure?
> 
> IMHO, if things fails, we have various exit code (1-5) for each failure case. 
> For example,
> if the FVP port somehow cannot be found, we exit with error code 5. This will 
> basically lead
> us to the only case where the failure is caused by the script fails to wait 
> for the expected
> string/regexp, and this case we have the timeout failure triggered by my 
> above-mentioned
> expect_after block.

I did a test to see if I break the expect script by adding below hunk:
```
--- a/automation/scripts/expect/fvp-base-smoke-dom0-arm64.exp
+++ b/automation/scripts/expect/fvp-base-smoke-dom0-arm64.exp
@@ -51,6 +51,7 @@ proc test_boot {{maxline} {host_ip}} {
     send -s "setenv serverip $host_ip; setenv ipaddr $host_ip; tftpb 
0x80200000 boot.scr; source 0x80200000\r"

     # Initial Xen boot
+    expect -re "this is a hack to break the build"
     expect -re "\(XEN\).*Freed .* init memory."

     # Dom0 and DomU
```
The timeout did happen in the expect script after the set timeout, see [1]

However the job still passes, and I believe this is caused by the shell script:
```
./automation/scripts/expect/fvp-base-smoke-dom0-arm64.exp \
    
"/FVP/FVP_Base_RevC-2xAEMvA/Base_RevC_AEMvA_pkg/models/Linux64_armv8l_GCC-9.3/FVP_Base_RevC-2xAEMvA
 \
    -C bp.vis.disable_visualisation=1 \
    -C bp.ve_sysregs.exit_on_shutdown=1 \
    -C bp.secure_memory=0 \
    -C cache_state_modelled=0 \
    -C cluster0.has_arm_v8-4=1 \
    -C cluster1.has_arm_v8-4=1 \
    ${TERM0_CFG} ${TERM1_CFG} ${TERM2_CFG} ${TERM3_CFG} \
    ${VIRTIO_USER_NETWORK_CFG} \
    -C bp.secureflashloader.fname=$(pwd)/binaries/bl1.bin \
    -C bp.flashloader0.fname=$(pwd)/binaries/fip.bin" |& \
        tee smoke.serial

exit 0
```

The “|& tee smoke.serial” hides the error propagated by the expect script. I 
will send a v2 to fix it.

[1] 
https://gitlab.com/xen-project/people/henryw/xen/-/jobs/5708263782/artifacts/file/smoke.serial

Kind regards,
Henry

> 
> Kind regards,
> Henry
> 
>>> +exit 0
>>> -- 
>>> 2.25.1
>>> 
> 


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.