You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/12 01:56:00 UTC

[GitHub] [apisix-dashboard] nic-chen commented on a diff in pull request #2421: fix: create upstream error when pass host is node and nodes without port

nic-chen commented on code in PR #2421:
URL: https://github.com/apache/apisix-dashboard/pull/2421#discussion_r847873820


##########
api/test/e2enew/upstream/upstream_test.go:
##########
@@ -88,6 +88,24 @@ var _ = ginkgo.Describe("Upstream", func() {
 			ExpectStatus: http.StatusOK,
 		})
 	})
+	ginkgo.It("create upstream3 success when pass host is 'node' and nodes without port", func() {
+		createUpstreamBody := make(map[string]interface{})
+		createUpstreamBody["name"] = "upstream3"
+		createUpstreamBody["nodes"] = map[string]float64{base.UpstreamIp: 100}
+		createUpstreamBody["type"] = "roundrobin"
+		createUpstreamBody["pass_host"] = "node"
+
+		_createUpstreamBody, err := json.Marshal(createUpstreamBody)
+		gomega.Expect(err).To(gomega.BeNil())
+		base.RunTestCase(base.HttpTestCase{
+			Object:       base.ManagerApiExpect(),
+			Method:       http.MethodPut,
+			Path:         "/apisix/admin/upstreams/3",
+			Body:         string(_createUpstreamBody),
+			Headers:      map[string]string{"Authorization": base.GetToken()},
+			ExpectStatus: http.StatusOK,
+		})
+	})

Review Comment:
   need a test case for DP



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org