Skip to content

Commit

Permalink
Enable verifier fuzzer in github CI/CD (#1163)
Browse files Browse the repository at this point in the history
* Enable verifier fuzzer in github CI/CD

This is another piece split out from PR #1153

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Add -artifact_prefix=Artifacts\

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
  • Loading branch information
dthaler and Alan-Jowett committed Jun 14, 2022
1 parent 8bf0c2b commit 670fd7d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/cicd.yml
Expand Up @@ -179,6 +179,20 @@ jobs:
code_coverage: false
gather_dumps: true

# Run the verifier fuzzer.
verifier_fuzzer:
needs: libfuzzer
# Always run this job.
if: github.event_name == 'schedule' || github.event_name == 'pull_request'
uses: ./.github/workflows/reusable-test.yml
with:
name: verifier_fuzzer
test_command: verifier_fuzzer.exe verifier_corpus -use_value_profile=1 -max_total_time=1800 -artifact_prefix=Artifacts\
build_artifact: Build-x64-fuzzer
environment: windows-2019
code_coverage: false
gather_dumps: true

core_helper_fuzzer:
needs: libfuzzer
# Always run this job.
Expand Down
13 changes: 13 additions & 0 deletions scripts/create_verifier_corpus.bat
@@ -0,0 +1,13 @@
@echo off
rem Copyright (c) Microsoft Corporation
rem SPDX-License-Identifier: MIT
rem
rem Usage: create_verifier_corpus.bat <solution_path> <output_directory>

set SOLUTIONPATH=%1
set OUTPUTPATH=%2
xcopy /d /i /y "%SOLUTIONPATH%\external\ebpf-verifier\ebpf-samples\build" "%OUTPUTPATH%"
xcopy /d /i /y "%SOLUTIONPATH%\external\ebpf-verifier\ebpf-samples\invalid" "%OUTPUTPATH%"
xcopy /d /i /y "%SOLUTIONPATH%\external\ebpf-verifier\ebpf-samples\linux" "%OUTPUTPATH%"
xcopy /d /i /y "%SOLUTIONPATH%\external\ebpf-verifier\ebpf-samples\prototype-kernel" "%OUTPUTPATH%"
xcopy /d /i /y "%SOLUTIONPATH%\external\ebpf-verifier\ebpf-samples\suricata" "%OUTPUTPATH%"
9 changes: 9 additions & 0 deletions tests/libfuzzer/verifier/verifier_fuzzer.vcxproj
Expand Up @@ -110,6 +110,15 @@
<Project>{3617528a-cb85-418b-82c1-e9cfc16755f6}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\..\scripts\create_verifier_corpus.bat">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)scripts\create_verifier_corpus.bat $(SolutionDir) $(OutDir)verifier_corpus</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)scripts\create_verifier_corpus.bat $(SolutionDir) $(OutDir)verifier_corpus</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)verifier_corpus\twomaps.o</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)verifier_corpus\twomaps.o</Outputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
5 changes: 5 additions & 0 deletions tests/libfuzzer/verifier/verifier_fuzzer.vcxproj.filters
Expand Up @@ -40,4 +40,9 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\..\scripts\create_verifier_corpus.bat">
<Filter>Source Files</Filter>
</CustomBuild>
</ItemGroup>
</Project>

0 comments on commit 670fd7d

Please sign in to comment.