@@ -61,24 +61,6 @@ func TestConfigDecider(t *testing.T) {
6161 }
6262 ConfigDecider (api , nsobj , input )
6363}
64- func TestGenerateNextPodAddr (t * testing.T ) {
65- nextIP := GenerateNextPodAddr ("10.10.10.10" )
66- if nextIP != "10.10.10.11" {
67- t .Error ("Expected 10.10.10.11, got " , nextIP )
68- }
69- nextIP = GenerateNextPodAddr ("10.10.10.244" )
70- if nextIP != "10.10.10.245" {
71- t .Error ("Expected 10.10.10.245, got " , nextIP )
72- }
73- nextIP = GenerateNextPodAddr ("0.0.0.0" )
74- if nextIP != "0.0.0.1" {
75- t .Error ("Expected 0.0.0.1, got " , nextIP )
76- }
77- nextIP = GenerateNextPodAddr ("10.10.10.300" )
78- if nextIP != "Error" {
79- t .Error ("Expected Error, got " , nextIP )
80- }
81- }
8264func TestHandleConfigMapAddEvent (t * testing.T ) {
8365 input , obj , api := getClientAndDeviceInfo ()
8466 HandleConfigMapAddEvent (api , obj , obj , input )
@@ -103,16 +85,3 @@ func TestHandleConfigMapUpdateEvent(t *testing.T) {
10385 configobj , _ := api .Client .CoreV1 ().ConfigMaps ("citrix" ).Get ("citrix-node-controller" , metav1.GetOptions {})
10486 HandleConfigMapUpdateEvent (api , configobj , configobj , obj , input )
10587}
106- func TestParseNodeEvents (t * testing.T ) {
107- input , nitro , api := getClientAndDeviceInfo ()
108- api .Client .CoreV1 ().ConfigMaps ("citrix" ).Create (& v1.ConfigMap {
109- ObjectMeta : metav1.ObjectMeta {Name : "citrix-node-controller" },
110- Data : map [string ]string {"Operation" : "ADD" },
111- })
112- node := api .CreateDummyNode (input )
113- ParseNodeEvents (api , node , nitro , input )
114- node .Spec .PodCIDR = ""
115- node .Labels ["com.citrix.nodetype" ] = "citrix"
116- ParseNodeEvents (api , node , nitro , input )
117- api .Client .CoreV1 ().ConfigMaps ("citrix" ).Get ("citrix-node-controller" , metav1.GetOptions {})
118- }
0 commit comments