aboutsummaryrefslogtreecommitdiffstats
path: root/src/kube2msb
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2018-03-08 15:11:58 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2018-03-08 15:11:58 +0800
commit1b240633a23aa215872762b1ab0561c70d7f5d43 (patch)
tree5e9aaaebaea12b103422bd3a6b16b302dd6ed89b /src/kube2msb
parentd653f9feea831724457ae0812850a69977ff949c (diff)
add ut for init kubeClient
cover 63.1% Issue-ID: MSB-168 Change-Id: Ibea46f67584156ea12fd3514baabd957c0161068 Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'src/kube2msb')
-rw-r--r--src/kube2msb/kube2msb_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/kube2msb/kube2msb_test.go b/src/kube2msb/kube2msb_test.go
index 63efd8e..a71c035 100644
--- a/src/kube2msb/kube2msb_test.go
+++ b/src/kube2msb/kube2msb_test.go
@@ -205,3 +205,18 @@ func TestRunBookKeeper(t *testing.T) {
}
}
}
+
+func TestNewKubeClient(t *testing.T) {
+ url := "http://192.168.1.2"
+ argKubeMasterUrl = &url
+ _, err := newKubeClient()
+ if err != nil {
+ t.Errorf("newKubeClient() error")
+ }
+
+ os.Setenv("AUTH_TOKEN", "autoToken1")
+ _, err2 := newKubeClient()
+ if err2 != nil {
+ t.Errorf("newKubeClient() error")
+ }
+}