Skip to content

git mv fuzz_seed_corpus fuzz_corpora #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Conversation

maflcko
Copy link
Contributor

@maflcko maflcko commented Sep 3, 2024

Fixes #200

@maflcko
Copy link
Contributor Author

maflcko commented Sep 3, 2024

Needs to be reviewed locally. For example, by calling

git mv fuzz_seed_corpus fuzz_corpora  # Recreate the move
git diff f8138af6b7c0b53a9e926112d211d9a6780531e1  # Show the remaining changes

@murchandamus
Copy link
Contributor

ACK f8138af

I recreated this PR locally, and moved the corpora. I got the same result for the corpora, plus the renaming of qa-assets/fuzz_seed_corpus to qa-assets/fuzz_corpora in a number of scripts.
I then checked out f8138af and verified that no instances of qa-assets/fuzz_seed_corpus remained in the scripts and all of its instances now appeared as qa-assets/fuzz_corpora.

@maflcko
Copy link
Contributor Author

maflcko commented Sep 3, 2024

CI needs to be re-run after bitcoin/bitcoin#30804 is merged

@brunoerg
Copy link
Contributor

brunoerg commented Sep 3, 2024

ACK f8138af

I tested as described in #205 (comment). The diff returned only the following:

-    - mv ./{.git,fuzz_corpora} ./bitcoin-core/ci/scratch/qa-assets/
+    - mv ./{.git,fuzz_seed_corpus} ./bitcoin-core/ci/scratch/qa-assets/
   ci_script:
     - cd ./bitcoin-core
     - ./ci/test_run_all.sh
diff --git a/README.md b/README.md
index 1983a58dec3..ff1b159ca38 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Bitcoin Core related blobs used for quality assurance.
 
 ## Fuzz inputs
 
-`qa-assets/fuzz_corpora` contains one input corpus per fuzz target (one
+`qa-assets/fuzz_seed_corpus` contains one input corpus per fuzz target (one
 folder per target named the same as each target).
 
 ### Contributing inputs
diff --git a/contrib/touched-files-check/src/main.rs b/contrib/touched-files-check/src/main.rs
index 761fc204cf2..42221d6912c 100644
--- a/contrib/touched-files-check/src/main.rs
+++ b/contrib/touched-files-check/src/main.rs
@@ -6,16 +6,16 @@ fn check(touched_files: &str) -> Result<(), String> {
             (l.next().unwrap(), l.next().unwrap())
         };
         println!("Touched file: {status} {file}");
-        let fuzz_corpora_dir = "fuzz_corpora/";
+        let fuzz_seed_corpora_dir = "fuzz_seed_corpus/";
         if only_inputs.is_none() {
-            only_inputs = Some(file.starts_with(fuzz_corpora_dir));
+            only_inputs = Some(file.starts_with(fuzz_seed_corpora_dir));
         }
-        if only_inputs.unwrap() != file.starts_with(fuzz_corpora_dir) {
+        if only_inputs.unwrap() != file.starts_with(fuzz_seed_corpora_dir) {
             return Err(format!(
-                "All files in this pull request should either be fuzz inputs in the directory {fuzz_corpora_dir} or only files outside that dir."
+                "All files in this pull request should either be fuzz inputs in the directory {fuzz_seed_corpora_dir} or only files outside that dir."
             ));
         }
-        if file.starts_with(fuzz_corpora_dir) && status != "A" {
+        if file.starts_with(fuzz_seed_corpora_dir) && status != "A" {
             return Err(format!(
                 "File status for fuzz input is not 'A' (for add): '{status}' '{file}'"
             ));
@@ -41,15 +41,15 @@ fn main() {
 fn test_check() {
     assert_eq!(check("M README.md"), Ok(()));
     assert_eq!(
-        check("B fuzz_corpora/foo/bar").unwrap_err(),
-        "File status for fuzz input is not 'A' (for add): 'B' 'fuzz_corpora/foo/bar'",
+        check("B fuzz_seed_corpus/foo/bar").unwrap_err(),
+        "File status for fuzz input is not 'A' (for add): 'B' 'fuzz_seed_corpus/foo/bar'",
     );
     assert_eq!(
-        check("A fuzz_corpora/foo/bar1\nA fuzz_corpora/foo/bar2"),
+        check("A fuzz_seed_corpus/foo/bar1\nA fuzz_seed_corpus/foo/bar2"),
         Ok(()),
     );
     assert_eq!(
-        check("M README.md\nA fuzz_corpora/foo/bar3").unwrap_err(),
-        "All files in this pull request should either be fuzz inputs in the directory fuzz_corpora/ or only files outside that dir.",
+        check("M README.md\nA fuzz_seed_corpus/foo/bar3").unwrap_err(),
+        "All files in this pull request should either be fuzz inputs in the directory fuzz_seed_corpus/ or only files outside that dir.",
     );
 }
diff --git a/download_oss_fuzz_inputs.py b/download_oss_fuzz_inputs.py
index 7bed5c9bb5a..e054d561a82 100755
--- a/download_oss_fuzz_inputs.py
+++ b/download_oss_fuzz_inputs.py
@@ -5,7 +5,7 @@ import os
 import subprocess
 
 
-FUZZ_INPUTS_DIR = "fuzz_corpora"
+FUZZ_INPUTS_DIR = "fuzz_seed_corpus"
 ZIP_NAME = "public.zip"
 BOLD = ("\033[0m", "\033[1m")

Moving back to fuzz_seed_corpus and running the diff again now shows all the moves.

@fanquake
Copy link
Member

fanquake commented Sep 4, 2024

CI needs to be re-run after bitcoin/bitcoin#30804 is merged

Kicked.

@maflcko maflcko merged commit bd3b5a8 into bitcoin-core:main Sep 4, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename fuzz_seed_corpus?
4 participants