1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-23 15:37:01 +00:00

test: Update fuzz tests to use the built-in infrastructure

Go 1.18 supports fuzzing natively, so this patch migrates our fuzzing
tests to make use of it.
This commit is contained in:
Alberto Bertogli
2023-02-05 12:30:25 +00:00
parent a54d81f406
commit efefee9fbb
88 changed files with 246 additions and 470 deletions

View File

@@ -3,6 +3,7 @@ package smtpsrv
import (
"bufio"
"net"
"os"
"strings"
"testing"
@@ -15,7 +16,12 @@ import (
func TestSecLevel(t *testing.T) {
// We can't simulate this externally because of the SPF record
// requirement, so do a narrow test on Conn.secLevelCheck.
dir := testlib.MustTempDir(t)
// Create the directory by hand because we don't want to automatically
// chdir into it (it affects the fuzzing infrastructure).
dir, err := os.MkdirTemp("", "testlib_")
if err != nil {
t.Fatalf("Failed to create temp dir: %v\n", dir)
}
defer testlib.RemoveIfOk(t, dir)
dinfo, err := domaininfo.New(dir)