From f49ccfaf16b228eb2fac8e07779a5ba34f76c310 Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Mon, 16 Dec 2024 15:23:50 +0100 Subject: [PATCH 01/11] feat(24.10): add .NET9 slices * Conflicts expected with .NET8 slices --- slices/aspnetcore-runtime-9.0.yaml | 22 ++++++++++++++++++++++ slices/dotnet-host-9.0.yaml | 18 ++++++++++++++++++ slices/dotnet-hostfxr-9.0.yaml | 18 ++++++++++++++++++ slices/dotnet-runtime-9.0.yaml | 24 ++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 slices/aspnetcore-runtime-9.0.yaml create mode 100644 slices/dotnet-host-9.0.yaml create mode 100644 slices/dotnet-hostfxr-9.0.yaml create mode 100644 slices/dotnet-runtime-9.0.yaml diff --git a/slices/aspnetcore-runtime-9.0.yaml b/slices/aspnetcore-runtime-9.0.yaml new file mode 100644 index 00000000..3e1b9810 --- /dev/null +++ b/slices/aspnetcore-runtime-9.0.yaml @@ -0,0 +1,22 @@ +package: aspnetcore-runtime-9.0 + +essential: + - aspnetcore-runtime-9.0_copyright + +slices: + libs: + essential: + - dotnet-runtime-9.0_libs + contents: + /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/.version: + /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/**.dll: + /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/**.json: + + notice: + contents: + /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0.0/THIRD-PARTY-NOTICES.txt: + /usr/share/doc/aspnetcore-runtime-9.0/NOTICE.txt.gz: + + copyright: + contents: + /usr/share/doc/aspnetcore-runtime-9.0/copyright: diff --git a/slices/dotnet-host-9.0.yaml b/slices/dotnet-host-9.0.yaml new file mode 100644 index 00000000..576fd542 --- /dev/null +++ b/slices/dotnet-host-9.0.yaml @@ -0,0 +1,18 @@ +package: dotnet-host-9.0 + +essential: + - dotnet-host-9.0_copyright + +slices: + bins: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + contents: + /usr/bin/dotnet: + /usr/lib/dotnet/dotnet: + + copyright: + contents: + /usr/share/doc/dotnet-host-9.0/copyright: diff --git a/slices/dotnet-hostfxr-9.0.yaml b/slices/dotnet-hostfxr-9.0.yaml new file mode 100644 index 00000000..b7eccc5c --- /dev/null +++ b/slices/dotnet-hostfxr-9.0.yaml @@ -0,0 +1,18 @@ +package: dotnet-hostfxr-9.0 + +essential: + - dotnet-hostfxr-9.0_copyright + +slices: + libs: + essential: + - dotnet-host-9.0_bins + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + contents: + /usr/lib/dotnet/host/fxr/9.0*/libhostfxr.so: + + copyright: + contents: + /usr/share/doc/dotnet-hostfxr-9.0/copyright: diff --git a/slices/dotnet-runtime-9.0.yaml b/slices/dotnet-runtime-9.0.yaml new file mode 100644 index 00000000..2c01b67b --- /dev/null +++ b/slices/dotnet-runtime-9.0.yaml @@ -0,0 +1,24 @@ +package: dotnet-runtime-9.0 + +essential: + - dotnet-runtime-9.0_copyright + +slices: + libs: + essential: + - dotnet-hostfxr-9.0_libs + - libbrotli1_libs + - libc6_libs + - libgcc-s1_libs + - libicu74_libs + - liblttng-ust1t64_libs + - libssl3t64_libs + - libstdc++6_libs + - libunwind8_libs + - zlib1g_libs + contents: + /usr/lib/dotnet/shared/Microsoft.NETCore.App/9.0*/**: + + copyright: + contents: + /usr/share/doc/dotnet-runtime-9.0/copyright: From 37bbf75ed70b444b7095590f6f73972254dc8062 Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Mon, 16 Dec 2024 15:31:34 +0100 Subject: [PATCH 02/11] chore(24.10): fix yaml linting --- slices/aspnetcore-runtime-9.0.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slices/aspnetcore-runtime-9.0.yaml b/slices/aspnetcore-runtime-9.0.yaml index 3e1b9810..5e237b04 100644 --- a/slices/aspnetcore-runtime-9.0.yaml +++ b/slices/aspnetcore-runtime-9.0.yaml @@ -8,9 +8,9 @@ slices: essential: - dotnet-runtime-9.0_libs contents: - /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/.version: /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/**.dll: /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/**.json: + /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/.version: notice: contents: From aa5edf6131b124014badc6681595cccb99cfbc0f Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Mon, 16 Dec 2024 17:53:42 +0100 Subject: [PATCH 03/11] chore(24.10): use dotnet9 to avoid conflict with dotnet in .NET8 --- slices/dotnet-host-9.0.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/slices/dotnet-host-9.0.yaml b/slices/dotnet-host-9.0.yaml index 576fd542..2ac1f2d6 100644 --- a/slices/dotnet-host-9.0.yaml +++ b/slices/dotnet-host-9.0.yaml @@ -10,8 +10,12 @@ slices: - libgcc-s1_libs - libstdc++6_libs contents: - /usr/bin/dotnet: - /usr/lib/dotnet/dotnet: + # This copy is done to avoid Chisel's current handling of conflicts, as + # it flags a conflict between this slice and .NET8's, even if the two + # are not being installed at the same time. + # TODO: once Chisel can cope with duplicate contents within the same + # release, this copy can be suppressed + /usr/lib/dotnet/dotnet9: {copy: /usr/lib/dotnet/dotnet} copyright: contents: From 3042f1d74b07085559269a40885d6caaf0937c3d Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Tue, 17 Dec 2024 17:14:26 +0100 Subject: [PATCH 04/11] test(24.10): add test for dotnet-runtime-9.0 --- .../app_helloworld/Hello.csproj | 10 +++++++++ .../app_helloworld/Program.cs | 1 + .../integration/dotnet-runtime-9.0/task.yaml | 21 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Hello.csproj create mode 100644 tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Program.cs create mode 100644 tests/spread/integration/dotnet-runtime-9.0/task.yaml diff --git a/tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Hello.csproj b/tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Hello.csproj new file mode 100644 index 00000000..694035b3 --- /dev/null +++ b/tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Hello.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Program.cs b/tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Program.cs new file mode 100644 index 00000000..b0d81242 --- /dev/null +++ b/tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Program.cs @@ -0,0 +1 @@ +Console.WriteLine("Hello, World!"); diff --git a/tests/spread/integration/dotnet-runtime-9.0/task.yaml b/tests/spread/integration/dotnet-runtime-9.0/task.yaml new file mode 100644 index 00000000..93887e43 --- /dev/null +++ b/tests/spread/integration/dotnet-runtime-9.0/task.yaml @@ -0,0 +1,21 @@ +summary: Integration tests for .NET 9 Runtime + +execute: | + # install slices + rootfs="$(install-slices dotnet-runtime-9.0_libs base-files_base bash_bins coreutils_directory-listing)" + mv $rootfs/usr/lib/dotnet/dotnet9 $rootfs/usr/lib/dotnet/dotnet + ln -s ../lib/dotnet/dotnet $rootfs/usr/bin/dotnet + + # smoking test the .NET runtime + chroot "$rootfs" /usr/bin/dotnet --info + + # preparing the test data + apt update && apt install -y dotnet-sdk-9.0 + cp -r app_helloworld $rootfs/app_helloworld + dotnet publish $rootfs/app_helloworld/Hello.csproj --no-self-contained + + mkdir -p "${rootfs}"/proc + mount --bind /proc "${rootfs}"/proc + + # test the helloworld app + chroot "$rootfs" dotnet /app_helloworld/bin/Release/net9.0/Hello.dll From ad531eb6c13a25c5effa04ff1a7e84a4951e1ddf Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Tue, 17 Dec 2024 17:14:50 +0100 Subject: [PATCH 05/11] chore(24.10): add comments to override dotnet9 in sdf --- slices/dotnet-host-9.0.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/slices/dotnet-host-9.0.yaml b/slices/dotnet-host-9.0.yaml index 2ac1f2d6..c03147d2 100644 --- a/slices/dotnet-host-9.0.yaml +++ b/slices/dotnet-host-9.0.yaml @@ -13,6 +13,11 @@ slices: # This copy is done to avoid Chisel's current handling of conflicts, as # it flags a conflict between this slice and .NET8's, even if the two # are not being installed at the same time. + # Override the installed slice using the following commands: + # ``` + # mv ${rootfs}/usr/lib/dotnet/dotnet9 ${rootfs}/usr/lib/dotnet/dotnet + # ln -s ../lib/dotnet/dotnet ${rootfs}/usr/bin/dotnet + # ``` # TODO: once Chisel can cope with duplicate contents within the same # release, this copy can be suppressed /usr/lib/dotnet/dotnet9: {copy: /usr/lib/dotnet/dotnet} From 983e793fd3ee0e257ea292d92111bae18ed8e639 Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Wed, 18 Dec 2024 00:19:31 +0100 Subject: [PATCH 06/11] chore(24.10): aspnetcore-runtime-9.0 --- .../aspnetcore-runtime-9.0/task.yaml | 25 +++++++++++++++++ .../web_helloworld/Hello.csproj | 9 ++++++ .../web_helloworld/Program.cs | 6 ++++ .../Properties/launchSettings.json | 28 +++++++++++++++++++ .../appsettings.Development.json | 8 ++++++ .../web_helloworld/appsettings.json | 9 ++++++ 6 files changed, 85 insertions(+) create mode 100644 tests/spread/integration/aspnetcore-runtime-9.0/task.yaml create mode 100644 tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Hello.csproj create mode 100644 tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Program.cs create mode 100644 tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Properties/launchSettings.json create mode 100644 tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.Development.json create mode 100644 tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.json diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml new file mode 100644 index 00000000..5226db0b --- /dev/null +++ b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml @@ -0,0 +1,25 @@ +summary: Integration tests for .NET 9 Runtime + +execute: | + # install slices + rootfs="$(install-slices aspnetcore-runtime-9.0_libs base-files_base bash_bins coreutils_directory-listing)" + mv $rootfs/usr/lib/dotnet/dotnet9 $rootfs/usr/lib/dotnet/dotnet + ln -s ../lib/dotnet/dotnet $rootfs/usr/bin/dotnet + + # smoking test the .NET runtime + chroot "$rootfs" /usr/bin/dotnet --info + + # preparing the test data + apt update && apt install -y dotnet-sdk-9.0 + cp -r web_helloworld $rootfs/web_helloworld + dotnet publish $rootfs/web_helloworld/Hello.csproj --no-self-contained + + mkdir -p "${rootfs}"/proc + mount --bind /proc "${rootfs}"/proc + + # test the helloworld web app + chroot "$rootfs" dotnet /app_helloworld/bin/Release/net9.0/Hello.dll --urls="http://0.0.0.0:5108" & + sleep 5 + # Send a request to the web app and verify the result + ret=0 + curl http://localhost:5108/ | grep "Hello World!" || ret=1 diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Hello.csproj b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Hello.csproj new file mode 100644 index 00000000..6568b3dc --- /dev/null +++ b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Hello.csproj @@ -0,0 +1,9 @@ + + + + net9.0 + enable + enable + + + diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Program.cs b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Program.cs new file mode 100644 index 00000000..1760df1d --- /dev/null +++ b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Program.cs @@ -0,0 +1,6 @@ +var builder = WebApplication.CreateBuilder(args); +var app = builder.Build(); + +app.MapGet("/", () => "Hello World!"); + +app.Run(); diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Properties/launchSettings.json b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Properties/launchSettings.json new file mode 100644 index 00000000..0bf46a5e --- /dev/null +++ b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:65090", + "sslPort": 44311 + } + }, + "profiles": { + "Hello": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7158;http://localhost:5108", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.Development.json b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.Development.json new file mode 100644 index 00000000..a34cd70c --- /dev/null +++ b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.json b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.json new file mode 100644 index 00000000..23160a4d --- /dev/null +++ b/tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} From 5b479d478d3ec6819c8796f9a005803a5019c341 Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Wed, 18 Dec 2024 00:33:03 +0100 Subject: [PATCH 07/11] chore(24.10): refactor rootfs mentions in tests --- .../integration/aspnetcore-runtime-9.0/task.yaml | 12 ++++++------ .../spread/integration/dotnet-runtime-9.0/task.yaml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml index 5226db0b..2191bc13 100644 --- a/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml +++ b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml @@ -3,22 +3,22 @@ summary: Integration tests for .NET 9 Runtime execute: | # install slices rootfs="$(install-slices aspnetcore-runtime-9.0_libs base-files_base bash_bins coreutils_directory-listing)" - mv $rootfs/usr/lib/dotnet/dotnet9 $rootfs/usr/lib/dotnet/dotnet - ln -s ../lib/dotnet/dotnet $rootfs/usr/bin/dotnet + mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet + ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet # smoking test the .NET runtime - chroot "$rootfs" /usr/bin/dotnet --info + chroot "${rootfs}" /usr/bin/dotnet --info # preparing the test data apt update && apt install -y dotnet-sdk-9.0 - cp -r web_helloworld $rootfs/web_helloworld - dotnet publish $rootfs/web_helloworld/Hello.csproj --no-self-contained + cp -r web_helloworld "${rootfs}"/web_helloworld + dotnet publish "${rootfs}"/web_helloworld/Hello.csproj --no-self-contained mkdir -p "${rootfs}"/proc mount --bind /proc "${rootfs}"/proc # test the helloworld web app - chroot "$rootfs" dotnet /app_helloworld/bin/Release/net9.0/Hello.dll --urls="http://0.0.0.0:5108" & + chroot "${rootfs}" dotnet /app_helloworld/bin/Release/net9.0/Hello.dll --urls="http://0.0.0.0:5108" & sleep 5 # Send a request to the web app and verify the result ret=0 diff --git a/tests/spread/integration/dotnet-runtime-9.0/task.yaml b/tests/spread/integration/dotnet-runtime-9.0/task.yaml index 93887e43..356d186a 100644 --- a/tests/spread/integration/dotnet-runtime-9.0/task.yaml +++ b/tests/spread/integration/dotnet-runtime-9.0/task.yaml @@ -3,19 +3,19 @@ summary: Integration tests for .NET 9 Runtime execute: | # install slices rootfs="$(install-slices dotnet-runtime-9.0_libs base-files_base bash_bins coreutils_directory-listing)" - mv $rootfs/usr/lib/dotnet/dotnet9 $rootfs/usr/lib/dotnet/dotnet - ln -s ../lib/dotnet/dotnet $rootfs/usr/bin/dotnet + mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet + ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet # smoking test the .NET runtime - chroot "$rootfs" /usr/bin/dotnet --info + chroot "${rootfs}" /usr/bin/dotnet --info # preparing the test data apt update && apt install -y dotnet-sdk-9.0 - cp -r app_helloworld $rootfs/app_helloworld - dotnet publish $rootfs/app_helloworld/Hello.csproj --no-self-contained + cp -r app_helloworld "${rootfs}"/app_helloworld + dotnet publish "${rootfs}"/app_helloworld/Hello.csproj --no-self-contained mkdir -p "${rootfs}"/proc mount --bind /proc "${rootfs}"/proc # test the helloworld app - chroot "$rootfs" dotnet /app_helloworld/bin/Release/net9.0/Hello.dll + chroot "${rootfs}" dotnet /app_helloworld/bin/Release/net9.0/Hello.dll From e625eb817dd2fa7e3b7597e51ac0059991b483b9 Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Wed, 18 Dec 2024 13:02:56 +0100 Subject: [PATCH 08/11] test(24.10): add test for dotnet-host-9.0 --- tests/spread/integration/dotnet-host-9.0/task.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/spread/integration/dotnet-host-9.0/task.yaml diff --git a/tests/spread/integration/dotnet-host-9.0/task.yaml b/tests/spread/integration/dotnet-host-9.0/task.yaml new file mode 100644 index 00000000..b67585f1 --- /dev/null +++ b/tests/spread/integration/dotnet-host-9.0/task.yaml @@ -0,0 +1,10 @@ +summary: Integration tests for .NET 9 Host + +execute: | + # install slices + rootfs="$(install-slices dotnet-host-9.0_bins dotnet-hostfxr-9.0_libs base-files_base)" + mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet + ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet + + # smoking test the .NET host + chroot "${rootfs}" /usr/bin/dotnet --info From 95cdd50f47619f7ae94da63f15ed688cea205780 Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Wed, 18 Dec 2024 13:06:49 +0100 Subject: [PATCH 09/11] chore(24.10): remove unused slices from test and rename test --- tests/spread/integration/aspnetcore-runtime-9.0/task.yaml | 4 ++-- tests/spread/integration/dotnet-runtime-9.0/task.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml index 2191bc13..02144809 100644 --- a/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml +++ b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml @@ -1,8 +1,8 @@ -summary: Integration tests for .NET 9 Runtime +summary: Integration tests for ASP.NET 9 Runtime execute: | # install slices - rootfs="$(install-slices aspnetcore-runtime-9.0_libs base-files_base bash_bins coreutils_directory-listing)" + rootfs="$(install-slices aspnetcore-runtime-9.0_libs base-files_base)" mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet diff --git a/tests/spread/integration/dotnet-runtime-9.0/task.yaml b/tests/spread/integration/dotnet-runtime-9.0/task.yaml index 356d186a..60f0bffd 100644 --- a/tests/spread/integration/dotnet-runtime-9.0/task.yaml +++ b/tests/spread/integration/dotnet-runtime-9.0/task.yaml @@ -2,7 +2,7 @@ summary: Integration tests for .NET 9 Runtime execute: | # install slices - rootfs="$(install-slices dotnet-runtime-9.0_libs base-files_base bash_bins coreutils_directory-listing)" + rootfs="$(install-slices dotnet-runtime-9.0_libs base-files_base)" mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet From 0bc0497d135e9ce0c942753de887fdb875a86c6a Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Fri, 20 Dec 2024 12:28:21 +0100 Subject: [PATCH 10/11] test(24.10): remove repeated test cases --- tests/spread/integration/aspnetcore-runtime-9.0/task.yaml | 3 --- tests/spread/integration/dotnet-runtime-9.0/task.yaml | 3 --- 2 files changed, 6 deletions(-) diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml index 02144809..18502824 100644 --- a/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml +++ b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml @@ -6,9 +6,6 @@ execute: | mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet - # smoking test the .NET runtime - chroot "${rootfs}" /usr/bin/dotnet --info - # preparing the test data apt update && apt install -y dotnet-sdk-9.0 cp -r web_helloworld "${rootfs}"/web_helloworld diff --git a/tests/spread/integration/dotnet-runtime-9.0/task.yaml b/tests/spread/integration/dotnet-runtime-9.0/task.yaml index 60f0bffd..43078e84 100644 --- a/tests/spread/integration/dotnet-runtime-9.0/task.yaml +++ b/tests/spread/integration/dotnet-runtime-9.0/task.yaml @@ -6,9 +6,6 @@ execute: | mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet - # smoking test the .NET runtime - chroot "${rootfs}" /usr/bin/dotnet --info - # preparing the test data apt update && apt install -y dotnet-sdk-9.0 cp -r app_helloworld "${rootfs}"/app_helloworld From c2450c568ac5b740c3c8c8497f6eb664c8f37da8 Mon Sep 17 00:00:00 2001 From: Zhijie Yang Date: Fri, 20 Dec 2024 14:12:53 +0100 Subject: [PATCH 11/11] test(24.10): fix aspnetcore test case --- .../aspnetcore-runtime-9.0/task.yaml | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml index 18502824..cfcdda76 100644 --- a/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml +++ b/tests/spread/integration/aspnetcore-runtime-9.0/task.yaml @@ -13,10 +13,28 @@ execute: | mkdir -p "${rootfs}"/proc mount --bind /proc "${rootfs}"/proc + mkdir -p "${rootfs}"/dev + head -c 500 /dev/urandom > "${rootfs}"/dev/random + head -c 500 /dev/urandom > "${rootfs}"/dev/urandom # test the helloworld web app - chroot "${rootfs}" dotnet /app_helloworld/bin/Release/net9.0/Hello.dll --urls="http://0.0.0.0:5108" & - sleep 5 + chroot "${rootfs}" dotnet /web_helloworld/bin/Release/net9.0/Hello.dll --urls="http://0.0.0.0:5108" & + app_pid=$! + + # Wait for the web app to start + while ! fuser 5108/tcp > /dev/null 2>&1; do + if ! test -d /proc/$app_pid; then + echo "dotnet exited quickly" + exit 1 + fi + sleep 1 + done + # Send a request to the web app and verify the result ret=0 curl http://localhost:5108/ | grep "Hello World!" || ret=1 + + + # Cleanup + kill $app_pid + exit $ret