Loading run_tests_locally.sh +30 −30 Original line number Diff line number Diff line Loading @@ -19,46 +19,46 @@ cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PRO # kubectl --namespace tf-dev expose deployment contextservice --port=6379 --type=NodePort --name=redis-tests #echo "Waiting 10 seconds for Redis to start..." #sleep 10 export REDIS_SERVICE_HOST=$(kubectl get node kubernetes-master -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace tf-dev -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') #export REDIS_SERVICE_HOST=$(kubectl get node kubernetes-master -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') #export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace tf-dev -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') # First destroy old coverage file rm -f $COVERAGEFILE coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ common/orm/tests/test_unitary.py \ common/message_broker/tests/test_unitary.py \ common/rpc_method_wrapper/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # common/orm/tests/test_unitary.py \ # common/message_broker/tests/test_unitary.py \ # common/rpc_method_wrapper/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ centralizedattackdetector/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # centralizedattackdetector/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ context/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # context/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ device/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ l3_centralizedattackdetector/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ # l3_centralizedattackdetector/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ l3_distributedattackdetector/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ # l3_distributedattackdetector/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ l3_attackmitigator/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ # l3_attackmitigator/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ opticalcentralizedattackdetector/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # opticalcentralizedattackdetector/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ dbscanserving/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # dbscanserving/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ opticalattackmitigator/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # opticalattackmitigator/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ service/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # service/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ compute/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # compute/tests/test_unitary.py src/device/service/drivers/openconfig/OpenConfigDriver.py +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ class OpenConfigDriver(_Driver): chk_string(str_resource_name + '.key', resource_key, allow_empty=False) str_config_message = compose_config(resource_key, resource_value) if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) #LOGGER.info('str_config_message = {:s}'.format(str(str_config_message))) LOGGER.info('AAAAAstr_config_message = {:s}'.format(str(str_config_message))) self.__netconf_manager.edit_config(str_config_message, target='running') results.append(True) except Exception as e: # pylint: disable=broad-except Loading src/device/service/drivers/openconfig/templates/NetworkInstances.py +1 −3 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ XPATH_NETWORK_INSTANCES = "//ocni:network-instances/ocni:network-instance" def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: response = [] for xml_network_instance in xml_data.xpath(XPATH_NETWORK_INSTANCES, namespaces=NAMESPACES): #LOGGER.info('xml_network_instance = {:s}'.format(str(ET.tostring(xml_network_instance)))) LOGGER.info('AQUIIIIIIIIII = {:s}'.format(str(ET.tostring(xml_network_instance)))) network_instance = {} Loading @@ -27,8 +27,6 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: ni_route_dist = xml_network_instance.find('ocni:config/ocni:route-distinguisher', namespaces=NAMESPACES) add_value_from_tag(network_instance, 'route_distinguisher', ni_route_dist) ni_address_families = [] add_value_from_collection(network_instance, 'address_families', ni_address_families) if len(network_instance) == 0: continue response.append(('network_instance[{:s}]'.format(network_instance['name']), network_instance)) Loading src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,11 @@ <index>{{index}}</index> </config> {% endif %} <vlan xmlns="http://openconfig.net/yang/vlan"> <config> <vlan-id>{{index}}</vlan-id> </config> </vlan> </subinterface> </subinterfaces> </interface> Loading src/device/service/drivers/openconfig/templates/network_instance/edit_config.xml +10 −3 Original line number Diff line number Diff line Loading @@ -5,12 +5,19 @@ <config> <name>{{name}}</name> <type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:{{type}}</type> {% for address_family in address_families %} <enabled-address-families xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:{{address_family}}</enabled-address-families> {% endfor %} <description>PhiTst_1</description> <router-id>{{router_id}}</router-id> <route-distinguisher>{{route_distinguisher}}</route-distinguisher> <enabled>true</enabled> </config> <encapsulation> <config> <encapsulation-type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:MPLS</encapsulation-type> </config> </encapsulation> {% endif %} </network-instance> </network-instances> Loading
run_tests_locally.sh +30 −30 Original line number Diff line number Diff line Loading @@ -19,46 +19,46 @@ cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PRO # kubectl --namespace tf-dev expose deployment contextservice --port=6379 --type=NodePort --name=redis-tests #echo "Waiting 10 seconds for Redis to start..." #sleep 10 export REDIS_SERVICE_HOST=$(kubectl get node kubernetes-master -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace tf-dev -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') #export REDIS_SERVICE_HOST=$(kubectl get node kubernetes-master -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') #export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace tf-dev -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') # First destroy old coverage file rm -f $COVERAGEFILE coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ common/orm/tests/test_unitary.py \ common/message_broker/tests/test_unitary.py \ common/rpc_method_wrapper/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # common/orm/tests/test_unitary.py \ # common/message_broker/tests/test_unitary.py \ # common/rpc_method_wrapper/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ centralizedattackdetector/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # centralizedattackdetector/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ context/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # context/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ device/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ l3_centralizedattackdetector/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ # l3_centralizedattackdetector/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ l3_distributedattackdetector/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ # l3_distributedattackdetector/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ l3_attackmitigator/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ # l3_attackmitigator/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ opticalcentralizedattackdetector/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # opticalcentralizedattackdetector/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ dbscanserving/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # dbscanserving/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ opticalattackmitigator/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # opticalattackmitigator/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ service/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # service/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ compute/tests/test_unitary.py #coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ # compute/tests/test_unitary.py
src/device/service/drivers/openconfig/OpenConfigDriver.py +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ class OpenConfigDriver(_Driver): chk_string(str_resource_name + '.key', resource_key, allow_empty=False) str_config_message = compose_config(resource_key, resource_value) if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) #LOGGER.info('str_config_message = {:s}'.format(str(str_config_message))) LOGGER.info('AAAAAstr_config_message = {:s}'.format(str(str_config_message))) self.__netconf_manager.edit_config(str_config_message, target='running') results.append(True) except Exception as e: # pylint: disable=broad-except Loading
src/device/service/drivers/openconfig/templates/NetworkInstances.py +1 −3 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ XPATH_NETWORK_INSTANCES = "//ocni:network-instances/ocni:network-instance" def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: response = [] for xml_network_instance in xml_data.xpath(XPATH_NETWORK_INSTANCES, namespaces=NAMESPACES): #LOGGER.info('xml_network_instance = {:s}'.format(str(ET.tostring(xml_network_instance)))) LOGGER.info('AQUIIIIIIIIII = {:s}'.format(str(ET.tostring(xml_network_instance)))) network_instance = {} Loading @@ -27,8 +27,6 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: ni_route_dist = xml_network_instance.find('ocni:config/ocni:route-distinguisher', namespaces=NAMESPACES) add_value_from_tag(network_instance, 'route_distinguisher', ni_route_dist) ni_address_families = [] add_value_from_collection(network_instance, 'address_families', ni_address_families) if len(network_instance) == 0: continue response.append(('network_instance[{:s}]'.format(network_instance['name']), network_instance)) Loading
src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,11 @@ <index>{{index}}</index> </config> {% endif %} <vlan xmlns="http://openconfig.net/yang/vlan"> <config> <vlan-id>{{index}}</vlan-id> </config> </vlan> </subinterface> </subinterfaces> </interface> Loading
src/device/service/drivers/openconfig/templates/network_instance/edit_config.xml +10 −3 Original line number Diff line number Diff line Loading @@ -5,12 +5,19 @@ <config> <name>{{name}}</name> <type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:{{type}}</type> {% for address_family in address_families %} <enabled-address-families xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:{{address_family}}</enabled-address-families> {% endfor %} <description>PhiTst_1</description> <router-id>{{router_id}}</router-id> <route-distinguisher>{{route_distinguisher}}</route-distinguisher> <enabled>true</enabled> </config> <encapsulation> <config> <encapsulation-type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:MPLS</encapsulation-type> </config> </encapsulation> {% endif %} </network-instance> </network-instances>