This is an automated email from the ASF dual-hosted git repository. starsz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new 3236c08 test: use 'UpstreamIp' to replace magic words in backend e2e
test (#2047)
3236c08 is described below
commit 3236c082f2f7ca1c3028d668ad6a2a81b8011262
Author: Shuyang Wu <[email protected]>
AuthorDate: Sun Aug 8 21:45:32 2021 -0400
test: use 'UpstreamIp' to replace magic words in backend e2e test (#2047)
Signed-off-by: yiyiyimu <[email protected]>
---
api/test/e2e/balancer_test.go | 18 ++--
api/test/e2e/base.go | 1 +
api/test/e2e/consumer_test.go | 4 +-
api/test/e2e/global_rule_test.go | 4 +-
api/test/e2e/go.mod | 6 +-
api/test/e2e/go.sum | 26 ------
api/test/e2e/id_compatible_test.go | 10 +--
api/test/e2e/json_schema_validate_test.go | 2 +-
api/test/e2e/label_test.go | 4 +-
api/test/e2e/route_export_test.go | 98 +++++++++++-----------
api/test/e2e/route_import_test.go | 8 +-
api/test/e2e/route_remote_addr_test.go | 6 +-
api/test/e2e/route_test.go | 24 +++---
.../e2e/skywalking/route_with_trace_plugin_test.go | 4 +-
api/test/e2enew/go.sum | 2 +-
.../e2enew/route/route_with_plugin_cors_test.go | 6 +-
.../route/route_with_plugin_http_logger_test.go | 2 +-
.../route/route_with_valid_remote_addr_test.go | 7 +-
api/test/e2enew/upstream/upstream_test.go | 4 +-
19 files changed, 108 insertions(+), 128 deletions(-)
diff --git a/api/test/e2e/balancer_test.go b/api/test/e2e/balancer_test.go
index ecd68a8..b0692d7 100644
--- a/api/test/e2e/balancer_test.go
+++ b/api/test/e2e/balancer_test.go
@@ -33,17 +33,17 @@ func TestBalancer_roundrobin_with_weight(t *testing.T) {
Path: "/apisix/admin/upstreams/1",
Body: `{
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
},
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1981,
"weight": 1
},
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1982,
"weight": 1
}],
@@ -89,17 +89,17 @@ func TestBalancer_roundrobin_with_weight(t *testing.T) {
Path: "/apisix/admin/upstreams/1",
Body: `{
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
},
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1981,
"weight": 2
},
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1982,
"weight": 3
}],
@@ -130,12 +130,12 @@ func TestBalancer_roundrobin_with_weight(t *testing.T) {
Path: "/apisix/admin/upstreams/1",
Body: `{
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
},
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1981,
"weight": 0
}],
@@ -164,7 +164,7 @@ func TestBalancer_roundrobin_with_weight(t *testing.T) {
Path: "/apisix/admin/upstreams/1",
Body: `{
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}],
diff --git a/api/test/e2e/base.go b/api/test/e2e/base.go
index dd9d901..822212a 100644
--- a/api/test/e2e/base.go
+++ b/api/test/e2e/base.go
@@ -39,6 +39,7 @@ var (
token string
Token string
+ UpstreamIp = "172.16.238.20"
APISIXHost = "http://127.0.0.1:9080"
APISIXInternalUrl = "http://172.16.238.30:9080"
APISIXSingleWorkerHost = "http://127.0.0.1:9081"
diff --git a/api/test/e2e/consumer_test.go b/api/test/e2e/consumer_test.go
index 4e5bfd4..32c72f0 100644
--- a/api/test/e2e/consumer_test.go
+++ b/api/test/e2e/consumer_test.go
@@ -221,7 +221,7 @@ func TestConsumer_with_key_auth(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
@@ -401,7 +401,7 @@ func TestConsumer_add_consumer_with_labels(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
diff --git a/api/test/e2e/global_rule_test.go b/api/test/e2e/global_rule_test.go
index e5b4e17..41dbbb7 100644
--- a/api/test/e2e/global_rule_test.go
+++ b/api/test/e2e/global_rule_test.go
@@ -47,7 +47,7 @@ func TestGlobalRule(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1981,
"weight": 1
}]
@@ -114,7 +114,7 @@ func TestGlobalRule(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1981,
"weight": 1
}]
diff --git a/api/test/e2e/go.mod b/api/test/e2e/go.mod
index 8e6d702..06e51b9 100644
--- a/api/test/e2e/go.mod
+++ b/api/test/e2e/go.mod
@@ -3,8 +3,12 @@ module e2e
go 1.15
require (
+ github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gavv/httpexpect/v2 v2.1.0
- github.com/gin-gonic/gin v1.6.3
+ github.com/golang/protobuf v1.3.3 // indirect
+ github.com/mattn/go-isatty v0.0.12 // indirect
github.com/stretchr/testify v1.4.0
github.com/tidwall/gjson v1.6.1
+ golang.org/x/text v0.3.2 // indirect
+ gopkg.in/yaml.v2 v2.2.8 // indirect
)
diff --git a/api/test/e2e/go.sum b/api/test/e2e/go.sum
index 7e5ce36..6f0efec 100644
--- a/api/test/e2e/go.sum
+++ b/api/test/e2e/go.sum
@@ -11,49 +11,28 @@ github.com/fsnotify/fsnotify v1.4.7
h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV
github.com/fsnotify/fsnotify v1.4.7/go.mod
h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gavv/httpexpect/v2 v2.1.0
h1:Q7xnFuKqBY2si4DsqxdbWBt9rfrbVTT2/9YSomc9tEw=
github.com/gavv/httpexpect/v2 v2.1.0/go.mod
h1:lnd0TqJLrP+wkJk3SFwtrpSlOAZQ7HaaIFuOYbgqgUM=
-github.com/gin-contrib/sse v0.1.0
h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
-github.com/gin-contrib/sse v0.1.0/go.mod
h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
-github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
-github.com/gin-gonic/gin v1.6.3/go.mod
h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
-github.com/go-playground/assert/v2 v2.0.1
h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
-github.com/go-playground/assert/v2 v2.0.1/go.mod
h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
-github.com/go-playground/locales v0.13.0
h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
-github.com/go-playground/locales v0.13.0/go.mod
h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
-github.com/go-playground/universal-translator v0.17.0
h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
-github.com/go-playground/universal-translator v0.17.0/go.mod
h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
-github.com/go-playground/validator/v10 v10.2.0
h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
-github.com/go-playground/validator/v10 v10.2.0/go.mod
h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/golang/protobuf v1.2.0/go.mod
h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3
h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
github.com/golang/protobuf v1.3.3/go.mod
h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/google/go-querystring v1.0.0
h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod
h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
-github.com/google/gofuzz v1.0.0/go.mod
h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.0.0
h1:J/mA+d2LqcDKjAEhQjXDHt9/e7Cnm+oBUwgHp5C6XDg=
github.com/gorilla/websocket v1.0.0/go.mod
h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod
h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/imkira/go-interpol v1.0.0
h1:HrmLyvOLJyjR0YofMw8QGdCIuYOs4TJUBDNU5sJC09E=
github.com/imkira/go-interpol v1.0.0/go.mod
h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
-github.com/json-iterator/go v1.1.9
h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
-github.com/json-iterator/go v1.1.9/go.mod
h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88
h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM=
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod
h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
github.com/klauspost/compress v1.8.2
h1:Bx0qjetmNjdFXASH02NSAREKpiaDwkO1DRZ3dV2KCcs=
github.com/klauspost/compress v1.8.2/go.mod
h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/cpuid v1.2.1
h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w=
github.com/klauspost/cpuid v1.2.1/go.mod
h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
-github.com/leodido/go-urn v1.2.0
h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
-github.com/leodido/go-urn v1.2.0/go.mod
h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/mattn/go-colorable v0.1.2
h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod
h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8/go.mod
h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.12
h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod
h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
-github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
-github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod
h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod
h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/onsi/ginkgo v1.6.0/go.mod
h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo=
github.com/onsi/ginkgo v1.10.1/go.mod
h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
@@ -65,7 +44,6 @@ github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f
h1:PgA+Olipyj258EIE
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f/go.mod
h1:lHhJedqxCoHN+zMtwGNTXWmF0u9Jt363FYRhV6g0CdY=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod
h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
-github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod
h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod
h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0
h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
@@ -76,10 +54,6 @@ github.com/tidwall/match v1.0.1
h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
github.com/tidwall/match v1.0.1/go.mod
h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
github.com/tidwall/pretty v1.0.2
h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
github.com/tidwall/pretty v1.0.2/go.mod
h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
-github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
-github.com/ugorji/go v1.1.7/go.mod
h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
-github.com/ugorji/go/codec v1.1.7
h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
-github.com/ugorji/go/codec v1.1.7/go.mod
h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/valyala/bytebufferpool v1.0.0
h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod
h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.9.0
h1:hNpmUdy/+ZXYpGy0OBfm7K0UQTzb73W0T0U4iJIVrMw=
diff --git a/api/test/e2e/id_compatible_test.go
b/api/test/e2e/id_compatible_test.go
index d5e0ad0..a7d6113 100644
--- a/api/test/e2e/id_compatible_test.go
+++ b/api/test/e2e/id_compatible_test.go
@@ -36,7 +36,7 @@ func TestID_Using_Int(t *testing.T) {
Body: `{
"id": 1,
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}],
@@ -171,7 +171,7 @@ func TestID_Using_String(t *testing.T) {
Body: `{
"id": "2",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}],
@@ -254,7 +254,7 @@ func TestID_Crossing(t *testing.T) {
Body: `{
"id": 3,
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}],
@@ -368,7 +368,7 @@ func TestID_Not_In_Body(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
}
}
}`,
@@ -421,7 +421,7 @@ func TestID_Not_In_Body(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
}
}
}`,
diff --git a/api/test/e2e/json_schema_validate_test.go
b/api/test/e2e/json_schema_validate_test.go
index 9648253..df46742 100644
--- a/api/test/e2e/json_schema_validate_test.go
+++ b/api/test/e2e/json_schema_validate_test.go
@@ -35,7 +35,7 @@ func TestSchema_not_exist_field(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
diff --git a/api/test/e2e/label_test.go b/api/test/e2e/label_test.go
index ab43777..4b15b0a 100644
--- a/api/test/e2e/label_test.go
+++ b/api/test/e2e/label_test.go
@@ -40,7 +40,7 @@ func TestLabel(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp
+ `",
"port": 1980,
"weight": 1
}]
@@ -78,7 +78,7 @@ func TestLabel(t *testing.T) {
Path: "/apisix/admin/upstreams/u1",
Body: `{
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}],
diff --git a/api/test/e2e/route_export_test.go
b/api/test/e2e/route_export_test.go
index 0c873e1..e4e3ae0 100644
--- a/api/test/e2e/route_export_test.go
+++ b/api/test/e2e/route_export_test.go
@@ -77,7 +77,7 @@ func TestRoute_Export(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -110,7 +110,7 @@ func TestRoute_Export(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -154,7 +154,7 @@ func TestRoute_Export(t *testing.T) {
"methods": ["GET", "POST"],
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -207,7 +207,7 @@ func TestRoute_Export(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -240,7 +240,7 @@ func TestRoute_Export(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -284,7 +284,7 @@ func TestRoute_Export(t *testing.T) {
"methods": ["GET", "POST"],
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -373,7 +373,7 @@ func TestRoute_Export(t *testing.T) {
"desc": "testservice_desc",
"upstream": {
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}],
@@ -431,7 +431,7 @@ func TestRoute_Export(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp
+ `",
"port": 1980,
"weight": 1
}],
@@ -472,7 +472,7 @@ func TestRoute_Export(t *testing.T) {
"create_time":1602883670,
"update_time":1602893670,
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
@@ -554,7 +554,7 @@ func TestRoute_Export(t *testing.T) {
"desc": "testservice_desc",
"upstream": {
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}],
@@ -615,7 +615,7 @@ func TestRoute_Export(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp
+ `",
"port": 1980,
"weight": 1
}],
@@ -656,7 +656,7 @@ func TestRoute_Export(t *testing.T) {
"create_time":1602883670,
"update_time":1602893670,
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
@@ -692,7 +692,7 @@ func TestRoute_Export(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
@@ -804,7 +804,7 @@ func TestRoute_Export(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp
+ `",
"port": 1981,
"weight": 1
}],
@@ -825,7 +825,7 @@ func TestRoute_Export(t *testing.T) {
Body: `{
"nodes": [
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}
@@ -890,7 +890,7 @@ func TestRoute_Export(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1981,
"weight": 1
}]
@@ -988,7 +988,7 @@ func TestRoute_Export(t *testing.T) {
Body: `{
"nodes": [
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}
@@ -1112,7 +1112,7 @@ func TestRoute_Export(t *testing.T) {
Body: `{
"nodes": [
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}
@@ -1131,7 +1131,7 @@ func TestRoute_Export(t *testing.T) {
"name": "upstream5",
"nodes": [
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1981,
"weight": 1
}
@@ -1304,7 +1304,7 @@ func TestRoute_Export(t *testing.T) {
Body: `{
"nodes": [
{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}
@@ -1442,7 +1442,7 @@ func TestExportRoute_With_Jwt_Plugin(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
@@ -1646,7 +1646,7 @@ func TestExportRoute_With_Jwt_Plugin(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
@@ -1755,7 +1755,7 @@ func TestExportRoute_With_Auth_Plugin(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
@@ -2329,7 +2329,7 @@ func TestRoute_Export_Equal_URI(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2351,7 +2351,7 @@ func TestRoute_Export_Equal_URI(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2373,7 +2373,7 @@ func TestRoute_Export_Equal_URI(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1981": 1
+ "` + UpstreamIp +
`:1981": 1
},
"type": "roundrobin"
}
@@ -2398,7 +2398,7 @@ func TestRoute_Export_Equal_URI(t *testing.T) {
"status": 1,
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2421,7 +2421,7 @@ func TestRoute_Export_Equal_URI(t *testing.T) {
"status": 1,
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2444,7 +2444,7 @@ func TestRoute_Export_Equal_URI(t *testing.T) {
"status": 1,
"upstream": {
"nodes": {
- "172.16.238.20:1981": 1
+ "` + UpstreamIp +
`:1981": 1
},
"type": "roundrobin"
}
@@ -2528,7 +2528,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2548,7 +2548,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2568,7 +2568,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2588,7 +2588,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2608,7 +2608,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2628,7 +2628,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2648,7 +2648,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2668,7 +2668,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2688,7 +2688,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2713,7 +2713,7 @@ func TestRoute_Export_Methods_Feild_Empty(t *testing.T) {
"status": 1,
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2779,7 +2779,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2798,7 +2798,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2817,7 +2817,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2836,7 +2836,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2855,7 +2855,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2874,7 +2874,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2893,7 +2893,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2912,7 +2912,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2931,7 +2931,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"x-apisix-status": 1,
"x-apisix-upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -2954,7 +2954,7 @@ func TestRoute_Export_Methods_Feild_Nil(t *testing.T) {
"status": 1,
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
diff --git a/api/test/e2e/route_import_test.go
b/api/test/e2e/route_import_test.go
index e313c20..bb70562 100644
--- a/api/test/e2e/route_import_test.go
+++ b/api/test/e2e/route_import_test.go
@@ -402,7 +402,7 @@ func TestRoute_export_import(t *testing.T) {
"status": 1,
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -425,7 +425,7 @@ func TestRoute_export_import(t *testing.T) {
"status": 1,
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -448,7 +448,7 @@ func TestRoute_export_import(t *testing.T) {
"status": 1,
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp +
`:1980": 1
},
"type": "roundrobin"
}
@@ -552,7 +552,7 @@ func TestRoute_export_import(t *testing.T) {
ExpectBody: []string{`"methods":["GET"]`,
`"desc":"所有`,
`"hosts":["test.com"]`,
-
`"upstream":{"nodes":[{"host":"172.16.238.20","port":1980,"weight":1}],"type":"roundrobin"}`,
+ `"upstream":{"nodes":[{"host":"` + UpstreamIp +
`","port":1980,"weight":1}],"type":"roundrobin"}`,
},
Sleep: sleepTime,
}
diff --git a/api/test/e2e/route_remote_addr_test.go
b/api/test/e2e/route_remote_addr_test.go
index b7b2402..6047aa6 100644
--- a/api/test/e2e/route_remote_addr_test.go
+++ b/api/test/e2e/route_remote_addr_test.go
@@ -35,7 +35,7 @@ func TestRoute_add_with_invalid_remote_addr(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp
+ `",
"port": 1980,
"weight": 1
}]
@@ -66,7 +66,7 @@ func TestRoute_add_with_invalid_remote_addr(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp
+ `",
"port": 1980,
"weight": 1
}]
@@ -97,7 +97,7 @@ func TestRoute_add_with_invalid_remote_addr(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp
+ `",
"port": 1980,
"weight": 1
}]
diff --git a/api/test/e2e/route_test.go b/api/test/e2e/route_test.go
index d99f7a2..a0cc072 100644
--- a/api/test/e2e/route_test.go
+++ b/api/test/e2e/route_test.go
@@ -34,7 +34,7 @@ func TestRoute_Invalid_Host(t *testing.T) {
"host": "$%$foo.com",
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -53,7 +53,7 @@ func TestRoute_Invalid_Host(t *testing.T) {
"hosts": ["$%$foo.com", "*.bar.com"],
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -73,7 +73,7 @@ func TestRoute_Invalid_Host(t *testing.T) {
"hosts": ["foo.com", "*.bar.com"],
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -128,7 +128,7 @@ func TestRoute_Create_With_Hosts(t *testing.T) {
"hosts": ["foo.com", "*.bar.com"],
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -226,7 +226,7 @@ func TestRoute_Update_Routes_With_Hosts(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + UpstreamIp + `",
"port": 1980,
"weight": 1
}]
@@ -256,7 +256,7 @@ func TestRoute_Update_Routes_With_Hosts(t *testing.T) {
"hosts": ["bar.com"],
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -329,7 +329,7 @@ func TestRoute_Patch(t *testing.T) {
"uri": "/hello",
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -423,7 +423,7 @@ func TestRoute_With_Empty_Array(t *testing.T) {
"host": "test.com",
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -452,7 +452,7 @@ func TestRoute_With_Empty_Array(t *testing.T) {
"hosts": [],
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -480,7 +480,7 @@ func TestRoute_With_Empty_Array(t *testing.T) {
"uris": [],
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -501,7 +501,7 @@ func TestRoute_With_Empty_Array(t *testing.T) {
"remote_addr": "0.0.0.0",
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
@@ -548,7 +548,7 @@ func TestRoute_Create_via_POST(t *testing.T) {
"hosts": ["foo.com", "*.bar.com"],
"upstream": {
"nodes": {
- "172.16.238.20:1980": 1
+ "` + UpstreamIp + `:1980": 1
},
"type": "roundrobin"
}
diff --git a/api/test/e2e/skywalking/route_with_trace_plugin_test.go
b/api/test/e2e/skywalking/route_with_trace_plugin_test.go
index 0694021..1735707 100644
--- a/api/test/e2e/skywalking/route_with_trace_plugin_test.go
+++ b/api/test/e2e/skywalking/route_with_trace_plugin_test.go
@@ -54,7 +54,7 @@ func TestRoute_With_Plugin_Skywalking(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + e2e.UpstreamIp +
`",
"port": 1981,
"weight": 1
}]
@@ -105,7 +105,7 @@ func TestRoute_With_Plugin_Skywalking(t *testing.T) {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + e2e.UpstreamIp +
`",
"port": 1981,
"weight": 1
}]
diff --git a/api/test/e2enew/go.sum b/api/test/e2enew/go.sum
index 6848688..011074c 100644
--- a/api/test/e2enew/go.sum
+++ b/api/test/e2enew/go.sum
@@ -3,7 +3,7 @@ github.com/ajg/form v1.5.1/go.mod
h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY
github.com/davecgh/go-spew v1.1.0/go.mod
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1
h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/fasthttp/websocket v1.4.2
h1:hTnl0DRQ9Tj4uVc4QcZCGp+mgF5mVKnijR1eNyn2waY=
+github.com/fasthttp/websocket v1.4.2
h1:AU/zSiIIAuJjBMf5o+vO0syGOnEfvZRu40xIhW/3RuM=
github.com/fasthttp/websocket v1.4.2/go.mod
h1:smsv/h4PBEBaU0XDTY5UwJTpZv69fQ0FfcLJr21mA6Y=
github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU=
github.com/fatih/structs v1.0.0/go.mod
h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
diff --git a/api/test/e2enew/route/route_with_plugin_cors_test.go
b/api/test/e2enew/route/route_with_plugin_cors_test.go
index 2fc6320..dce72f7 100644
--- a/api/test/e2enew/route/route_with_plugin_cors_test.go
+++ b/api/test/e2enew/route/route_with_plugin_cors_test.go
@@ -50,7 +50,7 @@ var _ = ginkgo.Describe("route with plugin cors", func() {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + base.UpstreamIp +
`",
"port": 1981,
"weight": 1
}]
@@ -91,7 +91,7 @@ var _ = ginkgo.Describe("route with plugin cors", func() {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` +
base.UpstreamIp + `",
"port": 1981,
"weight": 1
}]
@@ -172,7 +172,7 @@ var _ = ginkgo.Describe("route with plugin cors", func() {
"upstream": {
"type": "roundrobin",
"nodes": [{
- "host": "172.16.238.20",
+ "host": "` + base.UpstreamIp +
`",
"port": 1981,
"weight": 1
}]
diff --git a/api/test/e2enew/route/route_with_plugin_http_logger_test.go
b/api/test/e2enew/route/route_with_plugin_http_logger_test.go
index faddf1b..8535295 100644
--- a/api/test/e2enew/route/route_with_plugin_http_logger_test.go
+++ b/api/test/e2enew/route/route_with_plugin_http_logger_test.go
@@ -52,7 +52,7 @@ var _ = ginkgo.Describe("route with plugin http logger",
func() {
"uri": "/hello_",
"plugins": {
"http-logger": {
- "uri":
"http://172.16.238.20:1982/hello",
+ "uri": "http://` +
base.UpstreamIp + `:1982/hello",
"batch_max_size": 1,
"max_retry_count": 1,
"retry_delay": 2,
diff --git a/api/test/e2enew/route/route_with_valid_remote_addr_test.go
b/api/test/e2enew/route/route_with_valid_remote_addr_test.go
index 4ae2a34..7bae238 100644
--- a/api/test/e2enew/route/route_with_valid_remote_addr_test.go
+++ b/api/test/e2enew/route/route_with_valid_remote_addr_test.go
@@ -26,6 +26,7 @@ import (
)
var _ = ginkgo.Describe("route with valid remote_addr remote_addrs", func() {
+ remote_addr := "172.16.238.1"
table.DescribeTable("test route with valid remote_addr remote_addrs",
func(tc base.HttpTestCase) {
base.RunTestCase(tc)
@@ -37,7 +38,7 @@ var _ = ginkgo.Describe("route with valid remote_addr
remote_addrs", func() {
Body: `{
"name": "route1",
"uri": "/hello",
- "remote_addr": "172.16.238.1",
+ "remote_addr": "` + remote_addr + `",
"upstream": {
"type": "roundrobin",
"nodes": {
@@ -64,7 +65,7 @@ var _ = ginkgo.Describe("route with valid remote_addr
remote_addrs", func() {
Body: `{
"name": "route1",
"uri": "/hello",
- "remote_addr": "172.16.238.1/24",
+ "remote_addr": "` + remote_addr + `/24",
"upstream": {
"type": "roundrobin",
"nodes": {
@@ -91,7 +92,7 @@ var _ = ginkgo.Describe("route with valid remote_addr
remote_addrs", func() {
Body: `{
"name": "route1",
"uri": "/hello",
- "remote_addrs":
["172.16.238.1","192.168.0.2/24"],
+ "remote_addrs": ["` + remote_addr +
`","192.168.0.2/24"],
"upstream": {
"type": "roundrobin",
"nodes": {
diff --git a/api/test/e2enew/upstream/upstream_test.go
b/api/test/e2enew/upstream/upstream_test.go
index 224791f..f0ff938 100644
--- a/api/test/e2enew/upstream/upstream_test.go
+++ b/api/test/e2enew/upstream/upstream_test.go
@@ -830,7 +830,7 @@ var _ = ginkgo.Describe("test upstream delete (route is in
use)", func() {
Headers: map[string]string{"Authorization":
base.GetToken()},
Body: `{
"nodes": {
- "172.16.238.20:1980": 1
+ "` + base.UpstreamIp + `:1980":
1
},
"type": "roundrobin"
}`,
@@ -909,7 +909,7 @@ var _ = ginkgo.Describe("test upstream delete (service is
in use)", func() {
Headers: map[string]string{"Authorization":
base.GetToken()},
Body: `{
"nodes": {
- "172.16.238.20:1980": 1
+ "` + base.UpstreamIp + `:1980":
1
},
"type": "roundrobin"
}`,
