make test: ipsec test cleanup 38/11838/2
authorKlement Sekera <ksekera@cisco.com>
Tue, 17 Apr 2018 09:36:55 +0000 (11:36 +0200)
committerDamjan Marion <dmarion.lists@gmail.com>
Tue, 17 Apr 2018 17:09:28 +0000 (17:09 +0000)
Change-Id: If813346b665468b25aaf5d95629bcad87212aa3e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
test/test_ipsec_ah.py
test/test_ipsec_esp.py

index e1259de..042bb88 100644 (file)
@@ -1,13 +1,11 @@
 import socket
+import unittest
 
 from scapy.layers.inet import IP, ICMP
-from scapy.layers.l2 import Ether
-from scapy.layers.ipsec import *
+from scapy.layers.l2 import Ether, Raw
+from scapy.layers.ipsec import SecurityAssociation, AH
 
-from framework import VppTestCase
-from vpp_ip_route import VppIpRoute
-
-from util import ppp
+from framework import VppTestCase, VppTestRunner
 
 
 class TestIpsecAh(VppTestCase):
@@ -265,7 +263,7 @@ class TestIpsecAh(VppTestCase):
             for Pkts in recv_pkts:
                 Pkts[AH].padding = Pkts[AH].icv[12:]
                 Pkts[AH].icv = Pkts[AH].icv[:12]
-                decrypt_pkt = self.local_tra_sa.decrypt(Pkts[IP])
+                self.local_tra_sa.decrypt(Pkts[IP])
         finally:
             self.logger.info(self.vapi.ppcli("show error"))
             self.logger.info(self.vapi.ppcli("show ipsec"))
index 78f5150..f678274 100644 (file)
@@ -1,13 +1,11 @@
 import socket
+import unittest
 
 from scapy.layers.inet import IP, ICMP
 from scapy.layers.l2 import Ether
-from scapy.layers.ipsec import *
+from scapy.layers.ipsec import SecurityAssociation, ESP
 
-from framework import VppTestCase
-from vpp_ip_route import VppIpRoute
-
-from util import ppp
+from framework import VppTestCase, VppTestRunner
 
 
 class TestIpsecEsp(VppTestCase):
@@ -283,7 +281,7 @@ class TestIpsecEsp(VppTestCase):
                 self.pg2, send_pkts, self.pg2, count=count)
             # ESP TRA VPP encryption/decryption verification
             for Pkts in recv_pkts:
-                decrypt_pkt = self.local_tra_sa.decrypt(Pkts[IP])
+                self.local_tra_sa.decrypt(Pkts[IP])
         finally:
             self.logger.info(self.vapi.ppcli("show error"))
             self.logger.info(self.vapi.ppcli("show ipsec"))