- for engine in engines:
- self.vapi.cli("set crypto handler all %s" % engine)
- #
- # loop through each of the algorithms
- #
- for algo in algos:
- # with self.subTest(algo=algo['scapy']):
- for flag in flags:
- #
- # setup up the config paramters
- #
- self.ipv4_params = IPsecIPv4Params()
- self.ipv6_params = IPsecIPv6Params()
-
- self.params = {self.ipv4_params.addr_type:
- self.ipv4_params,
- self.ipv6_params.addr_type:
- self.ipv6_params}
-
- for _, p in self.params.items():
- p.auth_algo_vpp_id = algo['vpp-integ']
- p.crypt_algo_vpp_id = algo['vpp-crypto']
- p.crypt_algo = algo['scapy-crypto']
- p.auth_algo = algo['scapy-integ']
- p.crypt_key = algo['key']
- p.crypt_salt = algo['salt']
- p.flags = p.flags | flag
-
- #
- # configure the SPDs. SAs, etc
- #
- self.config_network(self.params.values())
-
- #
- # run some traffic.
- # An exhautsive 4o6, 6o4 is not necessary
- # for each algo
- #
- self.verify_tra_basic6(count=17)
- self.verify_tra_basic4(count=17)
- self.verify_tun_66(self.params[socket.AF_INET6], 17)
- self.verify_tun_44(self.params[socket.AF_INET], 17)
-
- #
- # remove the SPDs, SAs, etc
- #
- self.unconfig_network()
+ self.config_network(self.params.values())
+ self.verify_tra_anti_replay()
+ self.unconfig_network()
+
+#
+# To generate test classes, do:
+# grep '# GEN' test_ipsec_esp.py | sed -e 's/# GEN //g' | bash
+#
+# GEN for ENG in ia32 ipsecmb openssl; do \
+# GEN for FLG in noESN ESN; do for ALG in AES-GCM-128/NONE \
+# GEN AES-GCM-192/NONE AES-GCM-256/NONE AES-CBC-128/MD5-96 \
+# GEN AES-CBC-192/SHA1-96 AES-CBC-256/SHA1-96 \
+# GEN 3DES-CBC/SHA1-96 NONE/SHA1-96 \
+# GEN AES-CTR-128/SHA1-96 AES-CTR-192/SHA1-96 AES-CTR-256/SHA1-96; do \
+# GEN [[ ${FLG} == "ESN" && ${ALG} == *"NONE" ]] && continue
+# GEN echo -e "\n\nclass Test_${ENG}_${FLG}_${ALG}(RunTestIpsecEspAll):" |
+# GEN sed -e 's/-/_/g' -e 's#/#_#g' ; \
+# GEN echo ' """'$ENG $FLG $ALG IPSec test'"""' ;
+# GEN echo " def test_ipsec(self):";
+# GEN echo " self.run_test()";
+# GEN done; done; done
+
+
+class Test_ia32_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
+ """ia32 noESN AES-GCM-128/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
+ """ia32 noESN AES-GCM-192/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
+ """ia32 noESN AES-GCM-256/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
+ """ia32 noESN AES-CBC-128/MD5-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
+ """ia32 noESN AES-CBC-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
+ """ia32 noESN AES-CBC-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
+ """ia32 noESN 3DES-CBC/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_NONE_SHA1_96(RunTestIpsecEspAll):
+ """ia32 noESN NONE/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
+ """ia32 noESN AES-CTR-128/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
+ """ia32 noESN AES-CTR-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_noESN_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
+ """ia32 noESN AES-CTR-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
+ """ia32 ESN AES-CBC-128/MD5-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
+ """ia32 ESN AES-CBC-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
+ """ia32 ESN AES-CBC-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
+ """ia32 ESN 3DES-CBC/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_ESN_NONE_SHA1_96(RunTestIpsecEspAll):
+ """ia32 ESN NONE/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_ESN_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
+ """ia32 ESN AES-CTR-128/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_ESN_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
+ """ia32 ESN AES-CTR-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ia32_ESN_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
+ """ia32 ESN AES-CTR-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
+ """ipsecmb noESN AES-GCM-128/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
+ """ipsecmb noESN AES-GCM-192/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
+ """ipsecmb noESN AES-GCM-256/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
+ """ipsecmb noESN AES-CBC-128/MD5-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb noESN AES-CBC-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb noESN AES-CBC-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb noESN 3DES-CBC/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_NONE_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb noESN NONE/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb noESN AES-CTR-128/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb noESN AES-CTR-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_noESN_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb noESN AES-CTR-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
+ """ipsecmb ESN AES-CBC-128/MD5-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb ESN AES-CBC-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb ESN AES-CBC-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb ESN 3DES-CBC/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_NONE_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb ESN NONE/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb ESN AES-CTR-128/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb ESN AES-CTR-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
+ """ipsecmb ESN AES-CTR-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
+ """openssl noESN AES-GCM-128/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
+ """openssl noESN AES-GCM-192/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
+ """openssl noESN AES-GCM-256/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
+ """openssl noESN AES-CBC-128/MD5-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
+ """openssl noESN AES-CBC-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
+ """openssl noESN AES-CBC-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
+ """openssl noESN 3DES-CBC/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_NONE_SHA1_96(RunTestIpsecEspAll):
+ """openssl noESN NONE/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
+ """openssl noESN AES-CTR-128/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
+ """openssl noESN AES-CTR-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_noESN_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
+ """openssl noESN AES-CTR-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
+ """openssl ESN AES-CBC-128/MD5-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
+ """openssl ESN AES-CBC-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
+ """openssl ESN AES-CBC-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
+ """openssl ESN 3DES-CBC/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_NONE_SHA1_96(RunTestIpsecEspAll):
+ """openssl ESN NONE/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
+ """openssl ESN AES-CTR-128/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
+ """openssl ESN AES-CTR-192/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
+ """openssl ESN AES-CTR-256/SHA1-96 IPSec test"""
+ def test_ipsec(self):
+ self.run_test()