Skip to content
Snippets Groups Projects
Verified Commit 0d3bdc7c authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: ci pipeline

parent d3015400
No related branches found
No related tags found
No related merge requests found
package jobqueue
const (
DOCKER_TEST_HOST_IP = "172.17.0.1"
)
......@@ -33,6 +33,9 @@ func startTestSMTPDockerImageAndContainer(t *testing.T, port string, ctx context
_ = reader
host, _, _ := net.SplitHostPort(cli.DaemonHost())
if host == "" || host == "unix" {
host = DOCKER_TEST_HOST_IP
}
hostConfig := &container.HostConfig{
PortBindings: nat.PortMap{
......@@ -109,9 +112,7 @@ func TestMailRunner(t *testing.T) {
time.Sleep(1 * time.Second)
})
host := "172.17.0.1"
listener, err := net.Listen("tcp", host+":0")
listener, err := net.Listen("tcp", DOCKER_TEST_HOST_IP+":0")
if err != nil {
t.Errorf("Unexpected error: %v", err)
return
......@@ -133,7 +134,7 @@ func TestMailRunner(t *testing.T) {
waitCtx, waitCancel := context.WithTimeout(ctx, 60*time.Second)
defer waitCancel()
for {
conn, err := net.DialTimeout("tcp", net.JoinHostPort(host, portAsString), 1*time.Second)
conn, err := net.DialTimeout("tcp", net.JoinHostPort(DOCKER_TEST_HOST_IP, portAsString), 1*time.Second)
if err == nil {
err = conn.Close()
assert.Nil(t, err)
......@@ -156,7 +157,7 @@ func TestMailRunner(t *testing.T) {
From: "from@example.com",
Subject: "this is a test",
Body: "this is the body",
Server: host,
Server: DOCKER_TEST_HOST_IP,
Port: portAsString,
Username: "",
Password: "",
......
......@@ -34,6 +34,9 @@ func startSFTPTestDockerImageAndContainer(t *testing.T, port string, volume stri
_ = reader
host, _, _ := net.SplitHostPort(cli.DaemonHost())
if host == "" || host == "unix" {
host = DOCKER_TEST_HOST_IP
}
hostConfig := &container.HostConfig{
PortBindings: nat.PortMap{
......@@ -109,9 +112,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) {
time.Sleep(1 * time.Second)
})
host := "172.17.0.1"
listener, err := net.Listen("tcp", host+":0")
listener, err := net.Listen("tcp", DOCKER_TEST_HOST_IP+":0")
if err != nil {
t.Errorf("Unexpected error: %v", err)
return
......@@ -133,7 +134,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) {
waitCtx, waitCancel := context.WithTimeout(ctx, 60*time.Second)
defer waitCancel()
for {
conn, err := net.DialTimeout("tcp", net.JoinHostPort(host, portAsString), 1*time.Second)
conn, err := net.DialTimeout("tcp", net.JoinHostPort(DOCKER_TEST_HOST_IP, portAsString), 1*time.Second)
if err == nil {
err = conn.Close()
assert.Nil(t, err)
......@@ -162,7 +163,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) {
}
sftpRunnable := &SFTPRunnable{
Host: host,
Host: DOCKER_TEST_HOST_IP,
Port: portAsInt,
User: "demo",
Insecure: true,
......@@ -204,9 +205,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) {
time.Sleep(1 * time.Second)
})
host := "127.0.0.1"
listener, err := net.Listen("tcp", host+":0")
listener, err := net.Listen("tcp", DOCKER_TEST_HOST_IP+":0")
if err != nil {
t.Errorf("Unexpected error: %v", err)
return
......@@ -238,7 +237,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) {
waitCtx, waitCancel := context.WithTimeout(ctx, 60*time.Second)
defer waitCancel()
for {
conn, err := net.DialTimeout("tcp", net.JoinHostPort(host, portAsString), 1*time.Second)
conn, err := net.DialTimeout("tcp", net.JoinHostPort(DOCKER_TEST_HOST_IP, portAsString), 1*time.Second)
if err == nil {
err = conn.Close()
assert.Nil(t, err)
......@@ -259,7 +258,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) {
tempDir := t.TempDir()
sftpRunnable := &SFTPRunnable{
Host: host,
Host: DOCKER_TEST_HOST_IP,
Port: portAsInt,
User: "demo",
Insecure: true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment