Skip to content

Commit

Permalink
test(24.10): add test for dotnet-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 98f59e5 commit e9a885f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

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

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Console.WriteLine("Hello, World!");
30 changes: 30 additions & 0 deletions tests/spread/integration/dotnet-runtime-9.0/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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
cp -r app_helloworld $rootfs/app_helloworld-self-contained
# chroot "$rootfs" dotnet publish /dotnet/tests/app_helloworld/src/Hello.csproj --no-self-contained
# chroot "$rootfs" dotnet publish /dotnet/tests/app_helloworld-self-contained/src/Hello.csproj --self-contained
dotnet publish $rootfs/app_helloworld/Hello.csproj --no-self-contained
dotnet publish $rootfs/app_helloworld-self-contained/Hello.csproj --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
# test the helloworld self-contained app
for dll in $(ls /app_helloworld-self-contained/bin/Release/net9.0/linux-*/Hello.dll); do
chroot "$rootfs" dotnet $dll
done

0 comments on commit e9a885f

Please sign in to comment.