aboutsummaryrefslogtreecommitdiffstats
path: root/prog/test_util.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-09-15 09:05:13 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2022-09-27 13:07:37 +0200
commit1856cdc9b3652a082c5bfa0e08a9f883baece8ec (patch)
treeb929711cc5e8da196a11dd85141f7d374b132eff /prog/test_util.go
parent87840e0023f7adfb7ff928a8a5057932ea9aeab9 (diff)
executor: move syz_mount_image's sanity checks to syz-fuzzer
It will simplify the C code and let us extract the raw images in a more convenient way.
Diffstat (limited to 'prog/test_util.go')
-rw-r--r--prog/test_util.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/prog/test_util.go b/prog/test_util.go
index 07f24141a..71a52c809 100644
--- a/prog/test_util.go
+++ b/prog/test_util.go
@@ -66,9 +66,14 @@ func TestDeserializeHelper(t *testing.T, OS, arch string, transform func(*Target
transform(target, p)
}
output := strings.TrimSpace(string(p.Serialize()))
+ outputVerbose := strings.TrimSpace(string(p.SerializeVerbose()))
want := strings.TrimSpace(test.Out)
- if want != output {
- t.Fatalf("wrong serialized data:\n%s\nexpect:\n%s\n", output, want)
+ // We want to compare both verbose & non verbose mode.
+ // Otherwise we cannot have just In: field for the calls where
+ // the verbose and non-verbose output don't match -- the strict parsing
+ // mode does not accept the non-verbose output as input.
+ if want != output && want != outputVerbose {
+ t.Fatalf("wrong serialized data:\n%s\nexpect:\n%s\n", outputVerbose, want)
}
p.SerializeForExec(buf)
}