-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate Cross Platform Linux Packaging Tester (#4466)
- Loading branch information
Showing
5 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#! /bin/bash | ||
|
||
if [[ $(id -u) -ne 0 ]]; | ||
then | ||
#Beware of how you compose the command | ||
echo "This script must be run as root. Running the script with sudo..." | ||
printf -v cmd_str '%q ' "$0" "$@" | ||
exec sudo su -c "$cmd_str" | ||
exit $? | ||
fi | ||
|
||
cd /main | ||
. /etc/os-release | ||
OS=$(echo $ID | xargs) | ||
VERSION=$(echo $VERSION_ID | xargs) | ||
|
||
echo "${OS} ${VERSION} is detected." | ||
|
||
install_dependencies_apt() | ||
{ | ||
apt-get update | ||
if ! [ -f /usr/bin/dotnet ]; then | ||
apt-get install -y wget gzip tar | ||
fi | ||
apt-get install -y ./artifacts/libmsquic_*.deb | ||
} | ||
|
||
install_dependencies_rpm() | ||
{ | ||
yum update -y | ||
if ! [ -f /usr/bin/dotnet ]; then | ||
yum install -y wget gzip tar # .NET installing requirements | ||
yum install -y libicu # .NET dependencies | ||
fi | ||
find -name "libmsquic*.rpm" -exec yum localinstall -y {} \; | ||
} | ||
|
||
install_dependencies_opensuse() | ||
{ | ||
zypper ref | ||
if ! [ -f /usr/bin/dotnet ]; then | ||
zypper install -y wget gzip | ||
fi | ||
find -name "libmsquic*.rpm" -exec zypper install --allow-unsigned-rpm -y {} \; | ||
} | ||
|
||
# .NET is installed already on Azure Linux and Mariner images | ||
install_libmsquic_azure_linux() | ||
{ | ||
if ! [ -f /usr/bin/dotnet ]; then | ||
tdnf install -y wget gzip tar | ||
fi | ||
tdnf update | ||
find -name "libmsquic*.rpm" -exec tdnf install -y {} \; | ||
} | ||
|
||
if [[ "$OS" == "ubuntu" ]] || [[ "$OS" == "debian" ]]; then | ||
install_dependencies_apt | ||
elif [[ "$OS" == "centos" ]] || [[ "$OS" == "almalinux" ]] || [[ "$OS" == "rhel" ]] || [[ "$OS" == "fedora" ]]; then | ||
install_dependencies_rpm | ||
elif [[ "$OS" == 'opensuse-leap' ]]; then | ||
install_dependencies_opensuse | ||
elif [[ "$OS" == 'azurelinux' ]] || [[ "$OS" == 'mariner' ]]; then | ||
install_libmsquic_azure_linux | ||
else | ||
echo "Unsupported OS: ${OS}" | ||
exit 1 | ||
fi | ||
|
||
set -e | ||
chmod +x artifacts/bin/linux/${1}_${2}_${3}/msquictest | ||
artifacts/bin/linux/${1}_${2}_${3}/msquictest --gtest_filter=ParameterValidation.ValidateApi | ||
|
||
# Install .NET if it is not installed | ||
if ! [ -f /usr/bin/dotnet ]; then | ||
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh | ||
chmod +x dotnet-install.sh | ||
./dotnet-install.sh --channel $4 --shared-runtime | ||
|
||
export PATH=$PATH:$HOME/.dotnet | ||
export DOTNET_ROOT=$HOME/.dotnet | ||
fi | ||
|
||
dotnet /main/src/cs/QuicSimpleTest/artifacts/net$4/QuicHello.net$4.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using System.Net.Quic; | ||
|
||
#pragma warning disable CA1416 | ||
|
||
Console.WriteLine($"QuicConnection.IsSupported = {QuicConnection.IsSupported}"); | ||
return QuicConnection.IsSupported ? 0 : 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<EnablePreviewFeatures>true</EnablePreviewFeatures> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<EnablePreviewFeatures>true</EnablePreviewFeatures> | ||
</PropertyGroup> | ||
</Project> |