summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/kube2msb/msb_work_test.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/kube2msb/msb_work_test.go b/src/kube2msb/msb_work_test.go
index 9f5a823..b5ba681 100644
--- a/src/kube2msb/msb_work_test.go
+++ b/src/kube2msb/msb_work_test.go
@@ -24,7 +24,7 @@ import (
"testing"
)
-func TestAddServiceMsb(t *testing.T) {
+func addServiceOrPodTest(t *testing.T, addType string) {
handler := func(res http.ResponseWriter, req *http.Request) {
if req.Method != "POST" {
t.Errorf("Register() request method should be 'Post' not %s", req.Method)
@@ -69,7 +69,19 @@ func TestAddServiceMsb(t *testing.T) {
"enable_ssl":true
}]`
- client.AddService("192.168.1.10", serviceInfo)
+ if addType == "Service" {
+ client.AddService("192.168.1.10", serviceInfo)
+ } else {
+ client.AddPod("192.168.1.10", serviceInfo)
+ }
+}
+
+func TestAddServiceMsb(t *testing.T) {
+ addServiceOrPodTest(t, "Service")
+}
+
+func TestAddPodMsb(t *testing.T) {
+ addServiceOrPodTest(t, "Pod")
}
func TestMergeIP(t *testing.T) {