mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 01:08:31 +02:00
implement godoxy-agent
This commit is contained in:
@@ -258,16 +258,16 @@ func TestPublicIPLocalhost(t *testing.T) {
|
||||
c := &types.Container{Names: dummyNames, State: "running"}
|
||||
r, ok := makeRoutes(c)["a"]
|
||||
ExpectTrue(t, ok)
|
||||
ExpectEqual(t, r.Container.PublicIP, "127.0.0.1")
|
||||
ExpectEqual(t, r.Host, r.Container.PublicIP)
|
||||
ExpectEqual(t, r.Container.PublicHostname, "127.0.0.1")
|
||||
ExpectEqual(t, r.Host, r.Container.PublicHostname)
|
||||
}
|
||||
|
||||
func TestPublicIPRemote(t *testing.T) {
|
||||
c := &types.Container{Names: dummyNames, State: "running"}
|
||||
raw, ok := makeRoutes(c, testIP)["a"]
|
||||
ExpectTrue(t, ok)
|
||||
ExpectEqual(t, raw.Container.PublicIP, testIP)
|
||||
ExpectEqual(t, raw.Host, raw.Container.PublicIP)
|
||||
ExpectEqual(t, raw.Container.PublicHostname, testIP)
|
||||
ExpectEqual(t, raw.Host, raw.Container.PublicHostname)
|
||||
}
|
||||
|
||||
func TestPrivateIPLocalhost(t *testing.T) {
|
||||
@@ -283,8 +283,8 @@ func TestPrivateIPLocalhost(t *testing.T) {
|
||||
}
|
||||
r, ok := makeRoutes(c)["a"]
|
||||
ExpectTrue(t, ok)
|
||||
ExpectEqual(t, r.Container.PrivateIP, testDockerIP)
|
||||
ExpectEqual(t, r.Host, r.Container.PrivateIP)
|
||||
ExpectEqual(t, r.Container.PrivateHostname, testDockerIP)
|
||||
ExpectEqual(t, r.Host, r.Container.PrivateHostname)
|
||||
}
|
||||
|
||||
func TestPrivateIPRemote(t *testing.T) {
|
||||
@@ -301,9 +301,9 @@ func TestPrivateIPRemote(t *testing.T) {
|
||||
}
|
||||
r, ok := makeRoutes(c, testIP)["a"]
|
||||
ExpectTrue(t, ok)
|
||||
ExpectEqual(t, r.Container.PrivateIP, "")
|
||||
ExpectEqual(t, r.Container.PublicIP, testIP)
|
||||
ExpectEqual(t, r.Host, r.Container.PublicIP)
|
||||
ExpectEqual(t, r.Container.PrivateHostname, "")
|
||||
ExpectEqual(t, r.Container.PublicHostname, testIP)
|
||||
ExpectEqual(t, r.Host, r.Container.PublicHostname)
|
||||
}
|
||||
|
||||
func TestStreamDefaultValues(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user