Skip to content
Merged
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
159 changes: 159 additions & 0 deletions .github/workflows/fuzz_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.


name: Fuzz Test

on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- "core/src/**"
- "!core/src/docs/**"
- "!core/src/services/**"
- "core/src/services/fs/**"
- "core/src/services/memory/**"
- "core/src/services/s3/**"
- ".github/workflows/fuzz_test.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
fuzz-test-build-target:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- name: Install cargo fuzz
shell: bash
run: rustup install nightly && cargo +nightly install cargo-fuzz
- name: Build Fuzz Targets
shell: bash
working-directory: core/fuzz
run: cargo +nightly fuzz build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: fuzz_targets
path: ./target/x86_64-unknown-linux-gnu/release/fuzz_*
fuzz-test-run-s3:
runs-on: ubuntu-latest
needs: fuzz-test-build-target
services:
minio:
image: wktk/minio-server
ports:
- 9000:9000
env:
MINIO_ACCESS_KEY: "minioadmin"
MINIO_SECRET_KEY: "minioadmin"
strategy:
fail-fast: true
matrix:
fuzz-targets: [ fuzz_reader, fuzz_range_reader, fuzz_writer ]
steps:
- name: Setup Test Bucket
env:
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"
AWS_EC2_METADATA_DISABLED: "true"
run: aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test
- name: Download Fuzz Targets
uses: actions/download-artifact@v3
with:
name: fuzz_targets
path: ./target
- name: Grant Execute Permissions
shell: bash
run: chmod +x ./target/${{ matrix.fuzz-targets }}
- name: Run Fuzz Test
shell: bash
run: ./target/${{ matrix.fuzz-targets }} -max_total_time=120
env:
OPENDAL_S3_TEST: on
OPENDAL_S3_BUCKET: test
OPENDAL_S3_ENDPOINT: "http://127.0.0.1:9000"
OPENDAL_S3_ACCESS_KEY_ID: minioadmin
OPENDAL_S3_SECRET_ACCESS_KEY: minioadmin
- name: Upload Crash Files
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: crash_s3_${{ matrix.fuzz-targets }}_${{ github.event_name }}_${{ github.run_attempt }}_${{ github.sha }}
path: ./crash*
fuzz-test-run-fs:
runs-on: ubuntu-latest
needs: fuzz-test-build-target
strategy:
fail-fast: true
matrix:
fuzz-targets: [ fuzz_reader, fuzz_range_reader, fuzz_writer ]
steps:
- name: Download Fuzz Targets
uses: actions/download-artifact@v3
with:
name: fuzz_targets
path: ./target
- name: Grant Execute Permissions
shell: bash
run: chmod +x ./target/${{ matrix.fuzz-targets }}
- name: Run Fuzz Test
shell: bash
run: ./target/${{ matrix.fuzz-targets }} -max_total_time=120
env:
OPENDAL_FS_TEST: on
OPENDAL_FS_ROOT: ${{ runner.temp }}/
- name: Upload Crash Files
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: crash_fs_${{ matrix.fuzz-targets }}_${{ github.event_name }}_${{ github.run_attempt }}_${{ github.sha }}
path: ./crash*
fuzz-test-run-memory:
runs-on: ubuntu-latest
needs: fuzz-test-build-target
strategy:
fail-fast: true
matrix:
fuzz-targets: [ fuzz_reader, fuzz_range_reader, fuzz_writer ]
steps:
- name: Download Fuzz Targets
uses: actions/download-artifact@v3
with:
name: fuzz_targets
path: ./target
- name: Grant Execute Permissions
shell: bash
run: chmod +x ./target/${{ matrix.fuzz-targets }}
- name: Run Fuzz Test
shell: bash
run: ./target/${{ matrix.fuzz-targets }} -max_total_time=120
env:
OPENDAL_MEMORY_TEST: on
- name: Upload Crash Files
Comment thread
dqhl76 marked this conversation as resolved.
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: crash_memory_${{ matrix.fuzz-targets }}_${{ github.event_name }}_${{ github.run_attempt }}_${{ github.sha }}
path: ./crash*
1 change: 1 addition & 0 deletions core/fuzz/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ pub fn init_services() -> Vec<(&'static str, Option<Operator>)> {
vec![
("fs", service::<services::Fs>()),
("memory", service::<services::Memory>()),
("s3", service::<services::S3>()),
]
}