VPP fixes + refactored for libicnet + trailing spaces 23/6423/2
authorMarcel Enguehard <[email protected]>
Tue, 25 Apr 2017 14:41:36 +0000 (16:41 +0200)
committerMarcel Enguehard <[email protected]>
Tue, 25 Apr 2017 14:50:35 +0000 (14:50 +0000)
Change-Id: Ib31d27c4d26eececa991327f2994cf60370b86d9
Signed-off-by: Marcel Enguehard <[email protected]>
vicn/resource/icn/ccnx_consumer_producer_test.py
vicn/resource/icn/face.py
vicn/resource/icn/icn_tools.py
vicn/resource/vpp/vpp_commands.py

index f682657..76e4979 100644 (file)
@@ -32,17 +32,17 @@ class CcnxConsumerTest(Consumer):
     Test consumer exchanging dummy data.
     """
 
-    __package_names__ = ["libconsumer-producer-ccnx"]
+    __package_names__ = ["libicnet"]
 
-    prefixes = Attribute(String, 
+    prefixes = Attribute(String,
             description = "Name served by the producer server test",
             default = lambda self: self.default_name(),
             mandatory = False,
             multiplicity = Multiplicity.OneToMany)
     node = Attribute(Node,
             requirements=[
-                Requirement("forwarder", 
-                    capabilities = set(['ICN_SUITE_CCNX_1_0']), 
+                Requirement("forwarder",
+                    capabilities = set(['ICN_SUITE_CCNX_1_0']),
                     properties = {"protocol_suites" : ICN_SUITE_CCNX_1_0})
             ])
 
@@ -77,11 +77,11 @@ class CcnxProducerTest(Producer):
     Test producer exchanging dummy data.
     """
 
-    __package_names__ = ["libconsumer-producer-ccnx"]
+    __package_names__ = ["libicnet"]
 
     node = Attribute(Node,
-        requirements = [Requirement("forwarder", 
-            capabilities = set(['ICN_SUITE_CCNX_1_0']), 
+        requirements = [Requirement("forwarder",
+            capabilities = set(['ICN_SUITE_CCNX_1_0']),
             properties = {"protocol_suites" : ICN_SUITE_CCNX_1_0})])
 
     #--------------------------------------------------------------------------
index db72730..641d10e 100644 (file)
@@ -54,24 +54,24 @@ class Face(Resource):
             requirements = [
                 Requirement('forwarder')
             ])
-    protocol = Attribute(String, 
-            description = 'Face underlying protocol', 
+    protocol = Attribute(String,
+            description = 'Face underlying protocol',
             mandatory = True)
     id = Attribute(String, description = 'Local face ID',
             ro = True)
 
     # Cisco's extensions
-    wldr = Attribute(Bool, description = 'flag: WLDR enabled', 
+    wldr = Attribute(Bool, description = 'flag: WLDR enabled',
             default = False)
-    x2 = Attribute(Bool, description = 'flag: X2 face', 
+    x2 = Attribute(Bool, description = 'flag: X2 face',
             default = False)
 
     # NFD extensions
-    permanent = Attribute(Bool, description = 'flag: permanent face', 
+    permanent = Attribute(Bool, description = 'flag: permanent face',
             default = True)
     nfd_uri = Attribute(String, description = 'Face uri',
             func = lambda self : self._lambda_nfd_uri())
-    nfdc_flags = Attribute(String, 
+    nfdc_flags = Attribute(String,
             description = 'Flags for face creation with NFDC',
             func = lambda self : self._lambda_nfdc_flags())
 
@@ -83,7 +83,7 @@ class Face(Resource):
             flags += 'wldr '
         if self.x2:
             flags += 'x2 '
-        sibling_face_name = self.data.get('sibling_face', None)
+        sibling_face_name = self._internal_data.get('sibling_face', None)
         sibling_face = self._state.manager.by_name(sibling_face_name) \
                 if sibling_face_name else None
         dst_node = sibling_face.node.name if sibling_face else None
@@ -111,12 +111,12 @@ class Face(Resource):
 
 class L2Face(Face):
 
-    src_nic = Attribute(Interface, 
+    src_nic = Attribute(Interface,
             description = "Name of the network interface linked to the face",
             mandatory=True)
-    dst_mac = Attribute(String, description = "destination MAC address", 
+    dst_mac = Attribute(String, description = "destination MAC address",
             mandatory=True)
-    ether_proto = Attribute(String, 
+    ether_proto = Attribute(String,
             description = "Ethernet protocol number used by the face",
             default=DEFAULT_ETHER_PROTO)
 
@@ -128,12 +128,12 @@ class L2Face(Face):
 class L4Face(Face):
 
     ip_version = Attribute(Integer, description = "IPv4 or IPv6", default = 4)
-    src_ip = Attribute(String, description = "local IP address", 
+    src_ip = Attribute(String, description = "local IP address",
             mandatory = True)
     src_port = Attribute(Integer, description = "local TCP/UDP port")
-    dst_ip = Attribute(String, descrition = "remote IP address", 
+    dst_ip = Attribute(String, descrition = "remote IP address",
             mandatory=True)
-    dst_port = Attribute(Integer, description = "remote TCP/UDP port", 
+    dst_port = Attribute(Integer, description = "remote TCP/UDP port",
             mandatory=True)
 
     def _lambda_nfd_uri(self):
index 5482371..5c4624c 100644 (file)
@@ -23,4 +23,4 @@ class ICNTools(ICNApplication):
     Resource: ICNTools
     """
 
-    __package_names__ = ['libconsumer-producer-ccnx']
+    __package_names__ = ['libicnet']
index 8ee64bf..63c7480 100644 (file)
@@ -37,5 +37,5 @@ CMD_VPP_CICN_GET = "timeout 1 vppctl cicn show" #We timeout if vpp is not starte
 CMD_VPP_ADD_ICN_ROUTE = 'vppctl cicn cfg fib add prefix {route.prefix} face {route.face.id}'
 CMD_VPP_ADD_ICN_FACE = 'vppctl cicn cfg face add local {face.src_ip}:{face.src_port} remote {face.dst_ip}:{face.dst_port}'
 
-CMD_VPP_CICN_GET_CACHE_SIZE = 'vppctl cicn show | grep "CS entries" | grep -E "[0-9]+"'
+CMD_VPP_CICN_GET_CACHE_SIZE = 'vppctl cicn show | grep "CS entries" | grep -Eo "[0-9]+"'
 CMD_VPP_CICN_SET_CACHE_SIZE = 'vppctl cicn control param cs size {self.cache_size}'