Esempio n. 1
0
 def test_up_old_style(self, labmon_cni_K8s_Params_get_annotations,
                       labmon_cni_K8s_Params_get_k8s_params):
     k8s_params = MOCKED_K8S_PARAMS
     k8s_params['CNI_COMMAND'] = 'ADD'
     labmon_cni_K8s_Params_get_k8s_params.return_value = k8s_params
     labmon_cni_K8s_Params_get_annotations.return_value = OLD_ANNOTATIONS
     K8 = labmon_cni.K8s_CNI()
     K8.entrypoint()
Esempio n. 2
0
 def test_down_new_style_with_mtu(self,
                                  labmon_cni_K8s_Params_get_annotations,
                                  labmon_cni_K8s_Params_get_k8s_params):
     k8s_params = MOCKED_K8S_PARAMS
     k8s_params['CNI_COMMAND'] = 'DEL'
     labmon_cni_K8s_Params_get_k8s_params.return_value = k8s_params
     labmon_cni_K8s_Params_get_annotations.return_value = MTU_ANNOTATIONS
     K8 = labmon_cni.K8s_CNI()
     K8.entrypoint()
Esempio n. 3
0
    def test_up_null_annotations(self, labmon_cni_K8s_Params_get_annotations,
                                 labmon_cni_K8s_Params_get_k8s_params):
        NULL_IP_ANNOTATIONS = {
            'cisco.epfl/interface_maps':
            '[{"interface":"net1","vlan":519,"ip": null,"netmask": null},{"interface":"net2","vlan":529,"ip":"2.2.2.2","netmask":"16"}]'
        }

        k8s_params = MOCKED_K8S_PARAMS
        k8s_params['CNI_COMMAND'] = 'ADD'
        labmon_cni_K8s_Params_get_k8s_params.return_value = k8s_params
        labmon_cni_K8s_Params_get_annotations.return_value = NULL_IP_ANNOTATIONS
        K8 = labmon_cni.K8s_CNI()
        K8.entrypoint()