Skip to content

[KERNEL] Fix compile for 6.11+ #15

[KERNEL] Fix compile for 6.11+

[KERNEL] Fix compile for 6.11+ #15

Workflow file for this run

name: test fuse cow
on: push
env:
ASAN_OPTIONS: leak_check_at_exit=false
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x.x'
- name: Install dnbd3 dependencies
working-directory: ${{ github.workspace }}
run: |
for i in 1 2 3 4; do sudo apt-get update -y -qq && break; sleep 5; done
for i in 1 2 3 4; do sudo apt-get install -y -qq make \
clang-format \
linux-headers-generic \
libfuse-dev \
libjansson-dev \
libcurl4-openssl-dev && break; sleep 5; done
- name: Configure dnbd3 build
run: |
cmake -B ${{ github.workspace }}/build \
-S ${{ github.workspace }} \
-D CMAKE_BUILD_TYPE=${{ matrix.config.build-type }} \
-D CMAKE_C_FLAGS=-fsanitize=address \
-D DNBD3_KERNEL_MODULE=OFF \
-D DNBD3_BENCHMARK=OFF \
-D DNBD3_CLIENT_FUSE=ON \
-D DNBD3_CLIENT_FUSE_COW_TEST=ON \
-D DNBD3_SERVER=ON \
-D DNBD3_SERVER_FUSE=OFF \
-D DNBD3_SERVER_AFL=OFF \
-D DNBD3_SERVER_DEBUG_LOCKS=OFF \
-D DNBD3_SERVER_DEBUG_THREADS=OFF \
-D DNBD3_RELEASE_HARDEN=OFF \
-D DNBD3_PACKAGE_DOCKER=OFF
- name: Build dnbd3 artifacts
working-directory: ${{ github.workspace }}/build
run: make
- name: Get cow_merger_service
working-directory: ${{ github.workspace }}
run: git clone --depth 1 --branch "master" "https://github.com/z0Kng/cow_merger_service.git" "../cow_server"
- name: Build cow_merger_service
working-directory: ${{ github.workspace }}/../cow_server/cow_merger_service
run: dotnet publish -c Release -o publish -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishReadyToRunShowWarnings=true --self-contained true --runtime linux-x64
- name: Setup cow_merger_service
working-directory: ${{ github.workspace }}/../cow_server/
run: |
sudo mkdir -m 777 /mnt/work
mkdir /mnt/work/WorkingDirectory
mkdir /mnt/work/OriginalImageDirectory
mkdir /mnt/work/Output
sed -i 's/^ "WorkingDirectory":.*/ "WorkingDirectory": "\/mnt\/work\/WorkingDirectory",/g' cow_merger_service/publish/appsettings.json
sed -i 's/^ "OriginalImageDirectory":.*/ "OriginalImageDirectory": "\/mnt\/work\/OriginalImageDirectory",/g' cow_merger_service/publish/appsettings.json
sed -i 's/^ "DestinationDirectory":.*/ "DestinationDirectory": "\/mnt\/work\/Output",/g' cow_merger_service/publish/appsettings.json
while read line; do echo $line; done < cow_merger_service/publish/appsettings.json
cd cow_merger_service/publish/
FILENAME=cow_merger_service
FILESIZE=$(stat -c%s "$FILENAME")
echo "Size of $FILENAME = $FILESIZE bytes."
./cow_merger_service &> log.out &
- name: Generate test file
working-directory: ${{ github.workspace }}/build/src/cowtest
run: ./dnbd3-fuse-cow-test -c /mnt/work/OriginalImageDirectory/test.r1
- name: Setup dnbd3 server
working-directory: ${{ github.workspace }}
run: |
mkdir /mnt/work/dnbd3-server-config/
cp pkg/config/server.conf /mnt/work/dnbd3-server-config/
sed -i "s/^basePath=.*/basePath=\/mnt\/work\/OriginalImageDirectory/g" /mnt/work/dnbd3-server-config/server.conf
cd build/src/server
./dnbd3-server --config /mnt/work/dnbd3-server-config/
sleep 5
- name: Run standard test
working-directory: ${{ github.workspace }}/build/src
run: |
mkdir /mnt/work/mount
mkdir /mnt/work/tmp
mkdir /mnt/work/logs
./fuse/dnbd3-fuse "/mnt/work/mount" -f -h localhost -i test -c "/mnt/work/tmp" -C localhost:5000 --cow-stats-stdout --cow-stats-file &> /mnt/work/logs/standardLog1.out &
PID=$!
sleep 5
echo PID: $PID
./cowtest/dnbd3-fuse-cow-test -t "/mnt/work/mount/img"
echo unmounting: $PID
sudo umount /mnt/work/mount
wait $PID
echo unmounted
./fuse/dnbd3-fuse "/mnt/work/mount" -f -h localhost -i test -L "/mnt/work/tmp" -C localhost:5000 --merge --cow-stats-stdout --cow-stats-file &> /mnt/work/logs/standardLog2.out &
PID=$!
sleep 5
echo PID: $PID
./cowtest/dnbd3-fuse-cow-test -v "/mnt/work/mount/img"
echo unmounting: $PID
sudo umount /mnt/work/mount
wait $PID
echo unmounted
sleep 30
echo Output: $(ls /mnt/work/Output)
./cowtest/dnbd3-fuse-cow-test -v /mnt/work/Output/test.r2
rm /mnt/work/Output/test.r2
rm -rf /mnt/work/tmp
- name: Run random test
working-directory: ${{ github.workspace }}/build/src
run: |
cp /mnt/work/OriginalImageDirectory/test.r1 /mnt/work/
mkdir /mnt/work/tmp
./fuse/dnbd3-fuse "/mnt/work/mount" -f -h localhost -i test -c "/mnt/work/tmp" -C localhost:5000 --cow-stats-stdout --cow-stats-file &> /mnt/work/logs/randomLog1.out &
PIDFUSE=$!
sleep 5
echo PIDFUSE : $PIDFUSE
./cowtest/dnbd3-fuse-cow-test --randomTest "/mnt/work/mount/img" "/mnt/work/test.r1" &> /mnt/work/logs/randomTestLog1.out &
PIDTEST=$!
sleep 60
echo "stopping test"
kill -INT $PIDTEST
wait $PIDTEST
echo "testStopped"
echo unmounting: $PIDFUSE
sudo umount /mnt/work/mount
echo unmounted
wait $PIDFUSE
./fuse/dnbd3-fuse "/mnt/work/mount" -f -h localhost -i test -L "/mnt/work/tmp" -C localhost:5000 --merge --cow-stats-stdout --cow-stats-file &> /mnt/work/logs/randomLog2.out &
PIDFUSE=$!
sleep 5
echo PIDFUSE : $PIDFUSE
./cowtest/dnbd3-fuse-cow-test --compare "/mnt/work/mount/img" "/mnt/work/test.r1"
echo unmounting: $PIDFUSE
sudo umount /mnt/work/mount
echo unmounted
wait $PIDFUSE
sleep 30
echo Output: $(ls /mnt/work/Output)
./cowtest/dnbd3-fuse-cow-test --compare "/mnt/work/Output/test.r2" "/mnt/work/test.r1"
- name: Print logs
if: always()
run: |
tail -n+0 \
/mnt/work/logs/standardLog1.out \
/mnt/work/logs/standardLog2.out \
/mnt/work/logs/randomLog1.out \
/mnt/work/logs/randomTestLog1.out \
/mnt/work/logs/randomLog2.out \
/mnt/work/tmp/status \
${{ github.workspace }}/build/src/server/dnbd3.log \
${{ github.workspace }}/../cow_server/cow_merger_service/publish/log.out