From 0f3a505e5cf9d12475892312a9edcef4bcd4cd68 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Thu, 17 Nov 2022 15:11:59 -0500 Subject: [PATCH] Fix up bc-java-wycheproof and enable build (#8983) --- infra/ci/build.py | 2 ++ infra/tools/wycheproof/launcher.py | 5 ++--- infra/tools/wycheproof/run.py | 2 +- projects/bc-java-wycheproof/build.sh | 3 +++ projects/bc-java-wycheproof/project.yaml | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/infra/ci/build.py b/infra/ci/build.py index c252d9819..0ec64c7d5 100755 --- a/infra/ci/build.py +++ b/infra/ci/build.py @@ -112,6 +112,8 @@ def should_build_coverage(project_yaml): '"fuzzing_engines" if "none" is specified.') assert len(engines) == 1, assert_message return False + if 'wycheproof' in engines: + return False language = project_yaml.get('language') if language not in constants.LANGUAGES_WITH_COVERAGE_SUPPORT: diff --git a/infra/tools/wycheproof/launcher.py b/infra/tools/wycheproof/launcher.py index 2b73c3ef3..8ca8435d1 100644 --- a/infra/tools/wycheproof/launcher.py +++ b/infra/tools/wycheproof/launcher.py @@ -22,13 +22,12 @@ import subprocess def main(): - """Runs whycheproof.""" + """Runs wycheproof.""" if len(sys.argv) < 3: logging.error('Usage: %s .', sys.argv[0]) return 1 - test_app = sys.argv[1] - return subprocess.run([test_app], check=False).returncode + return subprocess.run(sys.argv[1:], check=False).returncode if __name__ == '__main__': diff --git a/infra/tools/wycheproof/run.py b/infra/tools/wycheproof/run.py index e14fc27c3..8ca11ef3e 100644 --- a/infra/tools/wycheproof/run.py +++ b/infra/tools/wycheproof/run.py @@ -40,7 +40,7 @@ def main(): args = get_args() if not os.path.exists(args.output_dir): os.mkdir(args.output_dir) - testcase = os.path.join(args.output_dir, 'testcase') + testcase = os.path.join(args.output_dir, 'fuzz-0') with open(testcase, 'w') as file_handle: file_handle.write(' ') return 0 diff --git a/projects/bc-java-wycheproof/build.sh b/projects/bc-java-wycheproof/build.sh index ac28057a6..342b7bc31 100644 --- a/projects/bc-java-wycheproof/build.sh +++ b/projects/bc-java-wycheproof/build.sh @@ -17,3 +17,6 @@ bazel build BouncyCastleAllTests rsync -aLkR bazel-bin/* $OUT +# Add dummy fuzzer to fool bad build check. +printf "#!/bin/bash\n./bazel-bin/BouncyCastleAllTests" > $OUT/WycheproofTarget.bash +chmod +x $OUT/WycheproofTarget.bash diff --git a/projects/bc-java-wycheproof/project.yaml b/projects/bc-java-wycheproof/project.yaml index f24443df5..009e33446 100644 --- a/projects/bc-java-wycheproof/project.yaml +++ b/projects/bc-java-wycheproof/project.yaml @@ -7,4 +7,4 @@ fuzzing_engines: sanitizers: - "none" file_github_issue: false -disabled: true +blackbox: true