Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Alpine support
  • Loading branch information
ayakael committed Mar 19, 2022
commit 5027c536bcd72db116f529385b2230db111ff450
2 changes: 1 addition & 1 deletion apphost-framework-lookup/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [ -f /etc/profile ]; then
source /etc/profile
Expand Down
2 changes: 1 addition & 1 deletion aspnet-same-runtime-version-2x/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion aspnet-same-runtime-version/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion aspnetpatch-21/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail
set -x
Expand Down
6 changes: 3 additions & 3 deletions assemblies-valid/AssembliesValid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class AssembliesValid
public void ValidateAssemblies()
{
string dotnetPath = null;
int exitCode = RunProcessAndGetOutput(new string[] { "command", "-v", "dotnet" }, out dotnetPath);
int exitCode = RunProcessAndGetOutput(new string[] { "bash", "-c", "\"command", "-v", "dotnet\"" }, out dotnetPath);
if (exitCode != 0)
{
Console.Error.WriteLine("'dotnet' command not found");
Expand Down Expand Up @@ -91,8 +91,8 @@ public void ValidateAssemblies()
if (hasMethods && !hasAot)
{
#if NET6_0_OR_GREATER
// s390x doesn't have aot support, and that's okay for now
if (architecture != Architecture.S390x)
// s390x (and arm) doesn't have aot support, and that's okay for now
if (architecture != Architecture.S390x && architecture != Architecture.Arm)
{
#endif
valid = false;
Expand Down
2 changes: 1 addition & 1 deletion bash-completion/get-completions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

get_completion_function_name_from_complete_output()
{
Expand Down
2 changes: 1 addition & 1 deletion bash-completion/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bundled-libunwind/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
8 changes: 7 additions & 1 deletion cgroup-limit/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand All @@ -13,6 +13,12 @@ if [[ "$(stat -f -c "%T" /sys/fs/cgroup)" == "cgroup2fs" ]] && [[ $(dotnet --ver
exit 0
fi


if [ -z "$(command -v systemctl)" ]; then
echo "Environment does not use systemd"
exit 0
fi

dotnet publish

SYSTEMD_RUN="systemd-run"
Expand Down
2 changes: 1 addition & 1 deletion commit-ids-in-binaries/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# .NET Core native binaries (coreclr.so, System.Native.so) contain a
# commit id as text somewhere in the binary. For example
Expand Down
2 changes: 1 addition & 1 deletion createdump-aspnet/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Enable "unofficial bash strict mode"
set -euo pipefail
Expand Down
2 changes: 1 addition & 1 deletion curl-certificate-store/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion debugging-sos-lldb-via-core-2x/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Check whether coredumps produced by .NET Core can be used by sos
# successfully. This test uses the built-in CoreCLR sos support, not
Expand Down
2 changes: 1 addition & 1 deletion debugging-sos-lldb-via-core/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Check whether coredumps produced by .NET Core can be used by sos
# successfully. This test uses the `dotnet sos` global tool.
Expand Down
5 changes: 4 additions & 1 deletion distribution-packages/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand All @@ -8,6 +8,9 @@ runtime_id=$(../runtime-id)
# This might be the final/only netstandard version from now on
netstandard_version=2.1

# disabled for alpine
[ -z "${runtime_id##alpine*}" ] && { echo Disabled for Alpine; exit 0; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally add the RID to ignoredRIDs element in the test.json file. That said, I am not sure our test runner knows about linux-musl- yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I figured, which is what prompted this. Eventually we should test using apk, like was done with other tests (like man-page, but alas I don't have the time for that, and I'd need to brush up on python.


./test-standard-packages \
"${runtime_id}" \
"${runtime_version}" "${runtime_version}" \
Expand Down
2 changes: 1 addition & 1 deletion dotnet-info-commit-ids/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# unofficial bash strict mode
set -euo pipefail
Expand Down
2 changes: 1 addition & 1 deletion extract-bundle-dir/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# The profile file sets DOTNET_BUNDLE_EXTRACT_BASE_DIR to avoid multi-user issues.
# see: https://bugzilla.redhat.com/show_bug.cgi?id=1752350.
Expand Down
4 changes: 2 additions & 2 deletions fdd-no-nuget/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set +x

Expand All @@ -21,4 +21,4 @@ if [ $? -eq 1 ]; then
exit 1
fi

echo "PASS: successfully published FDD without nuget.org access"
echo "PASS: successfully published FDD without nuget.org access"
2 changes: 1 addition & 1 deletion file-permissions/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\n\t'
Expand Down
4 changes: 2 additions & 2 deletions hardened-binaries/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\n\t'
Expand All @@ -8,7 +8,7 @@ echo ".NET Core base directory: $root"

# TODO handle more architectures can just x86-64

file_list=$(find "$root/" -type f -exec file {} \; | grep -E 'ELF 64-bit [LM]SB' | cut -d: -f 1 | sort -u)
file_list=$(find "$root/" -type f -exec file {} \; | grep -E 'ELF [[:digit:]][[:digit:]]-bit [LM]SB' | cut -d: -f 1 | sort -u)
mapfile -t binaries <<< "$file_list"
for binary in "${binaries[@]}"; do
echo "$binary"
Expand Down
2 changes: 1 addition & 1 deletion helloworld/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion install-location/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\n\t'
Expand Down
31 changes: 26 additions & 5 deletions liblttng-ust_sys-sdt.h/test.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail
set -x

RUNTIME_ID=$(../runtime-id)
set +e # disable abort-on-error so we can have the pipeline below fail
packageName=$(rpm -qa | grep 'dotnet.*lttng-ust')
case $RUNTIME_ID in
alpine*)packageName=$(apk list dotnet*lttng-ust);;
*)packageName=$(rpm -qa | grep 'dotnet.*lttng-ust');;
esac
set -e
# If a dotnet-specific lttng package doesn't exist, we must be using
# the normal system-wide lttng package.
if [[ -z "$packageName" ]]; then
packageName=$(rpm -qa | grep 'lttng-ust')
case $RUNTIME_ID in
alpine*)
packageName="lttng-ust"
;;
*)
packageName=$(rpm -qa | grep 'lttng-ust')
;;
esac
fi

filePath=$(rpm -ql "$packageName" | grep -E 'liblttng-ust.so.[01]$')
# If a dotnet-specific lttng package doesn't exist, we must be using
# the normal system-wide lttng package.
case $RUNTIME_ID in
alpine*)
filePath="/$(apk info -L "$packageName" | grep -E 'liblttng-ust.so.[01]$')"
;;
*)
filePath=$(rpm -ql "$packageName" | grep -E 'liblttng-ust.so.[01]$')
;;
esac

readelf -n "$filePath" | grep -F 'NT_STAPSDT (SystemTap probe descriptors)'

if [[ $? -eq 1 ]]; then
echo "NO NT_STAPSDT were found in lttng-ust: FAL"
echo "NO NT_STAPSDT were found in lttng-ust: FAIL"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion libuv-kestrel-sample-app-2x/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
7 changes: 5 additions & 2 deletions lttng/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down Expand Up @@ -49,8 +49,11 @@ wait $DOTNET_PID
echo "== Ending lttng session"
end_session

CMD="$(command -v babeltrace || true)"
[ -z "${CMD}" ] && CMD="$(command -v babeltrace2)"

# Retrieve trace
LTTNG_TRACE=$(babeltrace "$TRACE_FOLDER/ust/uid/$(id -u)/64-bit" | grep "vpid = $DOTNET_PID")
LTTNG_TRACE=$($CMD "$TRACE_FOLDER/ust/uid/$(id -u)/64-bit" | grep "vpid = $DOTNET_PID")

# Clean up
remove_test_folder
Expand Down
9 changes: 7 additions & 2 deletions man-pages/test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

helpPages=$(dotnet --help | grep -A 999 'SDK commands' | grep -E -B 999 'Common options|Additional commands' | awk 'NR>1 {print $1}' | head -n-2)
manPages=$(rpm -qd $(rpm -qa | grep 'dotnet') | grep 'man1/dotnet-')

RUNTIME_ID=$(../runtime-id)
case $RUNTIME_ID in
alpine*)manPages=$(apk info -L dotnet-doc);;
*)manPages=$(rpm -qd $(rpm -qa | grep 'dotnet') | grep 'man1/dotnet-');;
esac

failed=0
for page in $helpPages; do
Expand Down
2 changes: 1 addition & 1 deletion managed-symbols-available/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Check that managed symbol files are available

Expand Down
5 changes: 4 additions & 1 deletion omnisharp/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\n\t'
Expand All @@ -11,6 +11,9 @@ pushd workdir

runtime_id="$(../../runtime-id --portable)"

# disabled for alpine
[ -z "${runtime_id##*musl*}" ] && { echo No musl release of omnisharp, disabled; exit 0; }

wget --no-verbose "https://github.com/OmniSharp/omnisharp-roslyn/releases/latest/download/omnisharp-${runtime_id}.tar.gz"

mkdir omnisharp
Expand Down
2 changes: 1 addition & 1 deletion openssl-alpn/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Make sure .NET Core has linked to SSL_*_alpn_* functions from OpenSSL

Expand Down
2 changes: 1 addition & 1 deletion publish-ready-to-run-linux/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -euo pipefail
set -x
Expand Down
2 changes: 1 addition & 1 deletion publish-ready-to-run/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -euo pipefail
set -x
Expand Down
2 changes: 1 addition & 1 deletion restore-with-rid/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -euo pipefail
set -x
Expand Down
7 changes: 5 additions & 2 deletions runtime-id
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ while [[ $# -gt 0 ]]; do
done

if [[ ${portable_rid} == 1 ]]; then
echo "linux-${arch}"
case "${ID}" in
alpine)echo "linux-musl-${arch}" ;;
*) echo "linux-${arch}" ;;
esac
else
case "${ID}" in
# Remove the RHEL minor version
rhel) rid_version=${VERSION_ID%.*} ;;
rhel|alpine|rocky) rid_version=${VERSION_ID%.*} ;;

*) rid_version=${VERSION_ID} ;;
esac
Expand Down
2 changes: 1 addition & 1 deletion sdks-are-available/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\n\t'
Expand Down
2 changes: 1 addition & 1 deletion system-libcurl/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion system-libunwind/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion system-openssl/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Make sure .NET has ldd-visible links to OpenSSL. We prefer that over
# using OpenSSL via dlopen (which is more likely to fail at runtime).
Expand Down
2 changes: 1 addition & 1 deletion targeting-packs-bad-files/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion telemetry-is-off-by-default/test-telemetry-tcpdump.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# This test is *NOT* executed by default.

Expand Down
2 changes: 1 addition & 1 deletion telemetry-is-off-by-default/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# This test ensures telemetry is not being sent for (some) commands by
# checking that no network connections are being made when not
Expand Down
2 changes: 1 addition & 1 deletion template-test/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# this file tests templates created by
# dotnet new <template>
Expand Down
2 changes: 1 addition & 1 deletion tool-dev-certs/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [ -f /etc/profile ]; then
source /etc/profile
Expand Down
2 changes: 1 addition & 1 deletion use-apphost-from-sdk/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\n\t'
Expand Down
Loading