Browse Source

debugging progress 9

flashmob 5 years ago
parent
commit
6dba6725d4
4 changed files with 10 additions and 10 deletions
  1. 1 1
      backends/p_redis_test.go
  2. 1 1
      chunk/chunk_test.go
  3. 1 1
      mail/envelope_test.go
  4. 7 7
      server_test.go

+ 1 - 1
backends/p_redis_test.go

@@ -11,7 +11,7 @@ import (
 
 func TestRedisGeneric(t *testing.T) {
 
-	e := mail.NewEnvelope("127.0.0.1", 1)
+	e := mail.NewEnvelope("127.0.0.1", 1, "127.0.0.1:2525")
 	e.RcptTo = append(e.RcptTo, mail.Address{User: "test", Host: "grr.la"})
 
 	l, _ := log.GetLogger("./test_redis.log", "debug")

+ 1 - 1
chunk/chunk_test.go

@@ -608,7 +608,7 @@ func TestChunkSaverWrite(t *testing.T) {
 
 func initTestStream(transform bool) (*StoreMemory, *backends.StreamDecorator, *backends.StreamDecorator, backends.StreamProcessor) {
 	// place the parse result in an envelope
-	e := mail.NewEnvelope("127.0.0.1", 1)
+	e := mail.NewEnvelope("127.0.0.1", 1, "127.0.0.1:25")
 	to, _ := mail.NewAddress("[email protected]")
 	e.RcptTo = append(e.RcptTo, *to)
 	from, _ := mail.NewAddress("[email protected]")

+ 1 - 1
mail/envelope_test.go

@@ -97,7 +97,7 @@ func TestAddressWithIP(t *testing.T) {
 }
 
 func TestEnvelope(t *testing.T) {
-	e := NewEnvelope("127.0.0.1", 22)
+	e := NewEnvelope("127.0.0.1", 22, "127.0.0.1:25")
 
 	e.QueuedId = "abc123"
 	e.Helo = "helo.example.com"

+ 7 - 7
server_test.go

@@ -284,7 +284,7 @@ func TestHandleClient(t *testing.T) {
 	}
 	conn, server := getMockServerConn(sc, t)
 	// call the serve.handleClient() func in a goroutine.
-	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5))
+	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5), sc.ListenInterface)
 	var wg sync.WaitGroup
 	wg.Add(1)
 	go func() {
@@ -328,7 +328,7 @@ func TestGithubIssue197(t *testing.T) {
 	// [2001:DB8::FF00:42:8329] is an address literal
 	server.setAllowedHosts([]string{"1.1.1.1", "[2001:DB8::FF00:42:8329]"})
 
-	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5))
+	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5), sc.ListenInterface)
 	var wg sync.WaitGroup
 	wg.Add(1)
 	go func() {
@@ -444,7 +444,7 @@ func TestGithubIssue198(t *testing.T) {
 
 	server.setAllowedHosts([]string{"1.1.1.1", "[2001:DB8::FF00:42:8329]"})
 
-	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5))
+	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5), sc.ListenInterface)
 	client.RemoteIP = "127.0.0.1"
 
 	var wg sync.WaitGroup
@@ -568,7 +568,7 @@ func TestGithubIssue199(t *testing.T) {
 
 	server.setAllowedHosts([]string{"grr.la", "fake.com", "[1.1.1.1]", "[2001:db8::8a2e:370:7334]", "saggydimes.test.com"})
 
-	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5))
+	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5), sc.ListenInterface)
 	var wg sync.WaitGroup
 	wg.Add(1)
 	go func() {
@@ -746,7 +746,7 @@ func TestGithubIssue200(t *testing.T) {
 	server.backend().Start()
 	server.setAllowedHosts([]string{"1.1.1.1", "[2001:DB8::FF00:42:8329]"})
 
-	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5))
+	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5), sc.ListenInterface)
 	var wg sync.WaitGroup
 	wg.Add(1)
 	go func() {
@@ -800,7 +800,7 @@ func TestGithubIssue201(t *testing.T) {
 	// it will be used for rcpt to:<postmaster> which does not specify a host
 	server.setAllowedHosts([]string{"a.com", "saggydimes.test.com"})
 
-	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5))
+	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5), sc.ListenInterface)
 	var wg sync.WaitGroup
 	wg.Add(1)
 	go func() {
@@ -884,7 +884,7 @@ func TestXClient(t *testing.T) {
 	}
 	conn, server := getMockServerConn(sc, t)
 	// call the serve.handleClient() func in a goroutine.
-	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5))
+	client := NewClient(conn.Server, 1, mainlog, mail.NewPool(5), sc.ListenInterface)
 	var wg sync.WaitGroup
 	wg.Add(1)
 	go func() {