Skip to content

Commit

Permalink
chore(24.10): aspnetcore-runtime-9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijie-yang committed Dec 17, 2024
1 parent ad531eb commit 983e793
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/spread/integration/aspnetcore-runtime-9.0/task.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello World!");

app.Run();
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

0 comments on commit 983e793

Please sign in to comment.