aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2018-03-07 11:23:26 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2018-03-07 11:23:26 +0800
commit8267baa0b2d7ae54ac04cab60fb813a0d8f71999 (patch)
treef62c02d13a693f95829b699fd9a06fffb571ca46
parenta8b7adbe4c7da68ec12eff8242bbf707bc3dd5f6 (diff)
add ut for getKubeMasterUrl
add unit test for URL parser which can get k8s URL from start variable Issue-ID: MSB-169 Change-Id: Ifb9e43b5a3a1a16c24ce22b122d23223616e0e7a Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
-rw-r--r--src/kube2msb/kube2msb_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/kube2msb/kube2msb_test.go b/src/kube2msb/kube2msb_test.go
index 3a4e3d9..435fb3f 100644
--- a/src/kube2msb/kube2msb_test.go
+++ b/src/kube2msb/kube2msb_test.go
@@ -48,7 +48,7 @@ func urlFormateValidate(t *testing.T, method string) {
if method == "getMSBUrl" {
argMSBUrl = &c.in
got, _ = getMSBUrl()
- } else {
+ } else if method == "getKubeMasterUrl" {
argKubeMasterUrl = &c.in
got, _ = getKubeMasterUrl()
}
@@ -58,6 +58,11 @@ func urlFormateValidate(t *testing.T, method string) {
}
}
}
+
func TestGetMSBUrl(t *testing.T) {
urlFormateValidate(t, "getMSBUrl")
}
+
+func TestGetKubeMasterUrl(t *testing.T) {
+ urlFormateValidate(t, "getKubeMasterUrl")
+}