-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
186 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: fuzz-tests | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
go-test: | ||
outputs: | ||
COVERAGE: ${{ steps.unit.outputs.coverage }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Install project dependencies | ||
run: | | ||
go mod download | ||
- name: Run E2E Fuzz Tests | ||
run: | | ||
make e2e-fuzz-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package e2e_test | ||
|
||
import ( | ||
"github.com/stretchr/testify/assert" | ||
|
||
"testing" | ||
"unicode" | ||
|
||
"github.com/Layr-Labs/eigenda-proxy/client" | ||
"github.com/Layr-Labs/eigenda-proxy/e2e" | ||
) | ||
|
||
// FuzzProxyClientServerIntegrationAndOpClientKeccak256MalformedInputs will fuzz the proxy client server integration | ||
// and op client keccak256 with malformed inputs. This is never meant to be fuzzed with EigenDA. | ||
func FuzzProxyClientServerIntegration(f *testing.F) { | ||
if !runFuzzTests { | ||
f.Skip("Skipping test as FUZZ env var not set") | ||
} | ||
|
||
tsConfig := e2e.TestSuiteConfig(e2e.TestConfig(useMemory())) | ||
ts, kill := e2e.CreateTestSuite(tsConfig) | ||
|
||
for r := rune(0); r <= unicode.MaxRune; r++ { | ||
if unicode.IsPrint(r) { | ||
f.Add([]byte(string(r))) // Add each printable Unicode character as a seed | ||
} | ||
} | ||
|
||
cfg := &client.Config{ | ||
URL: ts.Address(), | ||
} | ||
|
||
daClient := client.New(cfg) | ||
|
||
// seed and data are expected. `seed` value is seed: {rune} and data is the one with the random byte(s) | ||
f.Fuzz(func(t *testing.T, data []byte) { | ||
_, err := daClient.SetData(ts.Ctx, data) | ||
assert.NoError(t, err) | ||
if err != nil { | ||
t.Errorf("Failed to set data: %v", err) | ||
} | ||
}) | ||
|
||
f.Cleanup(kill) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters