Skip to content

Commit a114a71

Browse files
author
anupsv
committed
combining tests
1 parent 0752a6b commit a114a71

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

e2e/server_fuzz_test.go

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ func addUnicodeTestCases(f *testing.F) {
2020
}
2121
}
2222

23-
func FuzzProxyClientServerIntegration(f *testing.F) {
23+
// FuzzProxyClientServerIntegrationAndOpClientKeccak256MalformedInputs will fuzz the proxy client server integration
24+
// and op client keccak256 with malformed inputs
25+
func FuzzProxyClientServerIntegrationAndOpClientKeccak256MalformedInputs(f *testing.F) {
2426
if !runFuzzTests {
2527
f.Skip("Skipping test as FUZZ env var not set")
2628
}
@@ -31,37 +33,21 @@ func FuzzProxyClientServerIntegration(f *testing.F) {
3133
ts, kill := e2e.CreateTestSuite(f, tsConfig)
3234
defer kill()
3335

36+
// Add each printable Unicode character as a seed
3437
addUnicodeTestCases(f)
3538

3639
cfg := &client.Config{
3740
URL: ts.Address(),
3841
}
3942
daClient := client.New(cfg)
43+
daClientPcFalse := op_plasma.NewDAClient(ts.Address(), false, false)
4044

41-
// Add each printable Unicode character as a seed including ascii
4245
f.Fuzz(func(t *testing.T, _ string, data []byte) {
4346
_, err := daClient.SetData(ts.Ctx, data)
4447
require.NoError(t, err)
4548
})
46-
}
47-
48-
func FuzzOpClientKeccak256MalformedInputs(f *testing.F) {
4949

50-
if !runFuzzTests {
51-
f.Skip("Skipping test as FUZZ env var not set")
52-
}
53-
54-
testCfg := e2e.TestConfig(useMemory())
55-
testCfg.UseKeccak256ModeS3 = true
56-
tsConfig := e2e.TestSuiteConfig(f, testCfg)
57-
ts, kill := e2e.CreateTestSuite(f, tsConfig)
58-
defer kill()
59-
addUnicodeTestCases(f)
60-
61-
daClientPcFalse := op_plasma.NewDAClient(ts.Address(), false, false)
62-
63-
// Fuzz the SetInput function with random data
64-
// seed and data are expected. `seed` value is seed: {i} and data is the one with the random string
50+
// seed and data are expected. `seed` value is seed: {rune} and data is the one with the random byte/s
6551
f.Fuzz(func(t *testing.T, _ string, data []byte) {
6652

6753
_, err := daClientPcFalse.SetInput(ts.Ctx, data)
@@ -71,5 +57,4 @@ func FuzzOpClientKeccak256MalformedInputs(f *testing.F) {
7157
}
7258

7359
})
74-
7560
}

0 commit comments

Comments
 (0)