Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion .github/scripts/build_ubuntu_defconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ echo "build_name $(git describe --tags ${kernel_base_sha})" | tee -a ${f}
build_name=$(git describe --tags ${kernel_base_sha})

# Build the kernel that will run LTP
export CI_TRIPLE="riscv64-linux-gnu"
export CI_TRIPLE="riscv64-unknown-linux-gnu"
# Use a CFI-enabled toolchain
export PATH=/build/INSTALL_Sept24/bin:$PATH
cp $d/series/kconfigs/ubuntu_defconfig arch/riscv/configs/
$d/series/kernel_builder.sh rv64 testsuites plain gcc | tee -a ${f}

Expand Down
40 changes: 40 additions & 0 deletions .github/scripts/isolated_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
# SPDX-FileCopyrightText: 2025 Rivos Inc.
#
# SPDX-License-Identifier: Apache-2.0

set -euox pipefail
d=$(dirname "${BASH_SOURCE[0]}")
. $d/series/utils.sh

logs=$(get_logs_dir)
f=${logs}/isolated-tests.log

KERNEL_PATH=$(find "$1" -name '*vmlinuz*')
mv $KERNEL_PATH $KERNEL_PATH.gz
gunzip $KERNEL_PATH.gz

ROOTFS_PATH=$(find /rootfs/ -name 'rootfs_rv64_ubuntu*.ext4')
# Resize the fs
truncate -s +4G $ROOTFS_PATH
resize2fs $ROOTFS_PATH

build_name=$(cat "$1/kernel_version")

# The Docker image comes with a prebuilt python environment with all tuxrun
# dependencies
source /build/.env/bin/activate

isolated_tests=( "cfi" )

mkdir -p /build/squad_json/
parallel_log=$(mktemp -p ${ci_root})

for test in ${isolated_tests[@]}; do
/build/tuxrun/run --runtime null --device qemu-riscv64 --kernel $KERNEL_PATH --tests ${test} --results /build/squad_json/${test}.json --log-file-text /build/squad_json/${test}.log --timeouts ${test}=480 --overlay /build/isolated-${test}.tar.xz --rootfs $ROOTFS_PATH --boot-args "rw" || true
# Convert JSON to squad datamodel
python3 /build/my-linux/.github/scripts/series/tuxrun_to_squad_json.py --result-path /build/squad_json/${test}.json --testsuite ${test}
python3 /build/my-linux/.github/scripts/series/generate_metadata.py --logs-path /build/squad_json/ --job-url ${GITHUB_JOB_URL} --branch ${GITHUB_BRANCH_NAME}

curl --header "Authorization: token $SQUAD_TOKEN" --form tests=@/build/squad_json/${test}.squad.json --form log=@/build/squad_json/${test}.log --form metadata=@/build/squad_json/metadata.json https://mazarinen.tail1c623.ts.net/api/submit/riscv-linux/linux-all/${build_name}/qemu
done
3 changes: 2 additions & 1 deletion .github/scripts/series/kconfigs/ubuntu_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5158,7 +5158,7 @@ CONFIG_XFS_RT=y
CONFIG_GFS2_FS=m
CONFIG_GFS2_FS_LOCKING_DLM=y
CONFIG_OCFS2_FS=m
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_NILFS2_FS=m
CONFIG_F2FS_FS=y
Expand Down Expand Up @@ -5483,6 +5483,7 @@ CONFIG_RELOCATABLE=y
CONFIG_RANDOMIZE_BASE=y
CONFIG_ERRATA_THEAD_MAE=y
CONFIG_ERRATA_THEAD=y
CONFIG_RISCV_USER_CFI=y
# DEBUG configs
CONFIG_DEBUG_ATOMIC_SLEEP=y
CONFIG_DEBUG_SPINLOCK=y
Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/xfstests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ mv $KERNEL_PATH $KERNEL_PATH.gz
gunzip $KERNEL_PATH.gz

ROOTFS_PATH=$(find /rootfs/ -name 'rootfs_rv64_ubuntu*.ext4')
# Resize the fs
truncate -s +20G $ROOTFS_PATH
resize2fs $ROOTFS_PATH

build_name=$(cat "$1/kernel_version")

Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/testsuites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,41 @@ jobs:
path: |
/build/logs/*
/build/squad_json/*

run-isolated-tests:
needs: build-kernel
if: ${{ endsWith(github.head_ref, '_manual') }}
runs-on: self-hosted
timeout-minutes: 50400 # 35 days
container:
image: ghcr.io/linux-riscv/linaro-tuxrun-dispatcher-riscv64:latest
volumes:
- /home/github/ccache:/build/ccache
- /home/github/gitref:/build/gitref
- /tmp:/tmp
steps:
- name: Download pre-built kernel
uses: actions/download-artifact@v4
with:
name: test-kernel
path: /build/test-kernel
- name: Download CI files
uses: actions/download-artifact@v4
with:
name: ci-files
path: /build/my-linux/.github
- name: Run checks
env:
SQUAD_TOKEN: ${{ secrets.SQUAD_TOKEN }}
GITHUB_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GITHUB_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
mkdir -p /build/logs/
cd /build/my-linux && bash .github/scripts/isolated_tests.sh /build/test-kernel | tee -i /build/logs/all.log
- name: Collect logs and json squad
uses: actions/upload-artifact@v4
with:
name: test-logs-isolated-tests
path: |
/build/logs/*
/build/squad_json/*