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 2a1db7b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions slices/dotnet-host-9.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
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!");
21 changes: 21 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,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

0 comments on commit 2a1db7b

Please sign in to comment.