aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2021-06-25 13:30:50 +0000
committerMatthew Smith <mgsmith@netgate.com>2021-06-28 13:32:40 +0000
commit9c23ff8c8ab2ba881540a1c9c6d331d2ed6c8c6a (patch)
treeb51b465b056c87d845e5778c013d9055bcc2d4a3
parentdabdc197981a49eac54bb43238f4ebd31075622a (diff)
ipsec: Enable the extended Sequence Number IPSec tests for GCM
Type: test Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Ie691b1c8841f5e195525bfff990f12ab918ba394
-rw-r--r--test/test_ipsec_esp.py74
1 files changed, 72 insertions, 2 deletions
diff --git a/test/test_ipsec_esp.py b/test/test_ipsec_esp.py
index 95703f5a076..41ac56efafd 100644
--- a/test/test_ipsec_esp.py
+++ b/test/test_ipsec_esp.py
@@ -977,7 +977,6 @@ class RunTestIpsecEspAll(ConfigIpsecESP,
# 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'"""' ;
@@ -988,7 +987,6 @@ class RunTestIpsecEspAll(ConfigIpsecESP,
# GEN for FLG in noESN ESN; do for ALG in \
# GEN AES-GCM-128/NONE AES-GCM-192/NONE AES-GCM-256/NONE \
# GEN AES-CBC-192/SHA1-96 AES-CBC-256/SHA1-96; do \
-# GEN [[ ${FLG} == "ESN" && ${ALG} == *"NONE" ]] && continue
# GEN echo -e "\n\nclass Test_async_${FLG}_${ALG}(RunTestIpsecEspAll):" |
# GEN sed -e 's/-/_/g' -e 's#/#_#g' ; \
# GEN echo ' """'async $FLG $ALG IPSec test'"""' ;
@@ -1063,6 +1061,24 @@ class Test_native_noESN_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
self.run_test()
+class Test_native_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
+ """native ESN AES-GCM-128/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_native_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
+ """native ESN AES-GCM-192/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_native_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
+ """native ESN AES-GCM-256/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
class Test_native_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
"""native ESN AES-CBC-128/MD5-96 IPSec test"""
def test_ipsec(self):
@@ -1177,6 +1193,24 @@ class Test_ipsecmb_noESN_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
self.run_test()
+class Test_ipsecmb_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
+ """ipsecmb ESN AES-GCM-128/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
+ """ipsecmb ESN AES-GCM-192/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_ipsecmb_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
+ """ipsecmb ESN AES-GCM-256/NONE 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):
@@ -1291,6 +1325,24 @@ class Test_openssl_noESN_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
self.run_test()
+class Test_openssl_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
+ """openssl ESN AES-GCM-128/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
+ """openssl ESN AES-GCM-192/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_openssl_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
+ """openssl ESN AES-GCM-256/NONE 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):
@@ -1369,6 +1421,24 @@ class Test_async_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
self.run_test()
+class Test_async_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
+ """async ESN AES-GCM-128/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_async_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
+ """async ESN AES-GCM-192/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
+class Test_async_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
+ """async ESN AES-GCM-256/NONE IPSec test"""
+ def test_ipsec(self):
+ self.run_test()
+
+
class Test_async_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
"""async ESN AES-CBC-192/SHA1-96 IPSec test"""
def test_ipsec(self):
ght .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (c) 2017 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "vom/vxlan_tunnel_cmds.hpp"

DEFINE_VAPI_MSG_IDS_VXLAN_API_JSON;

namespace VOM {
namespace vxlan_tunnel_cmds {

create_cmd::create_cmd(HW::item<handle_t>& item,
                       const std::string& name,
                       const vxlan_tunnel::endpoint_t& ep)
  : interface::create_cmd<vapi::Vxlan_add_del_tunnel>(item, name)
  , m_ep(ep)
{
}

bool
create_cmd::operator==(const create_cmd& other) const
{
  return (m_ep == other.m_ep);
}

rc_t
create_cmd::issue(connection& con)
{
  msg_t req(con.ctx(), std::ref(*this));

  auto& payload = req.get_request().get_payload();
  payload.is_add = 1;
  payload.is_ipv6 = 0;
  to_bytes(m_ep.src, &payload.is_ipv6, payload.src_address);
  to_bytes(m_ep.dst, &payload.is_ipv6, payload.dst_address);
  payload.mcast_sw_if_index = ~0;
  payload.encap_vrf_id = 0;
  payload.decap_next_index = ~0;
  payload.vni = m_ep.vni;

  VAPI_CALL(req.execute());

  m_hw_item = wait();

  if (m_hw_item) {
    insert_interface();
  }

  return rc_t::OK;
}

std::string
create_cmd::to_string() const
{
  std::ostringstream s;
  s << "vxlan-tunnel-create: " << m_hw_item.to_string() << m_ep.to_string();

  return (s.str());
}

delete_cmd::delete_cmd(HW::item<handle_t>& item,
                       const vxlan_tunnel::endpoint_t& ep)
  : interface::delete_cmd<vapi::Vxlan_add_del_tunnel>(item)
  , m_ep(ep)
{
}

bool
delete_cmd::operator==(const delete_cmd& other) const
{
  return (m_ep == other.m_ep);
}

rc_t
delete_cmd::issue(connection& con)
{
  msg_t req(con.ctx(), std::ref(*this));

  auto payload = req.get_request().get_payload();
  payload.is_add = 0;
  payload.is_ipv6 = 0;
  to_bytes(m_ep.src, &payload.is_ipv6, payload.src_address);
  to_bytes(m_ep.dst, &payload.is_ipv6, payload.dst_address);
  payload.mcast_sw_if_index = ~0;
  payload.encap_vrf_id = 0;
  payload.decap_next_index = ~0;
  payload.vni = m_ep.vni;

  VAPI_CALL(req.execute());

  wait();
  m_hw_item.set(rc_t::NOOP);

  remove_interface();
  return (rc_t::OK);
}

std::string
delete_cmd::to_string() const
{
  std::ostringstream s;
  s << "vxlan-tunnel-delete: " << m_hw_item.to_string() << m_ep.to_string();

  return (s.str());
}

dump_cmd::dump_cmd()
{
}

bool
dump_cmd::operator==(const dump_cmd& other) const
{
  return (true);
}

rc_t
dump_cmd::issue(connection& con)
{
  m_dump.reset(new msg_t(con.ctx(), std::ref(*this)));

  auto& payload = m_dump->get_request().get_payload();
  payload.sw_if_index = ~0;

  VAPI_CALL(m_dump->execute());

  wait();

  return rc_t::OK;
}

std::string
dump_cmd::to_string() const
{
  return ("Vpp-vxlan_tunnels-Dump");
}
} // namespace vxlan_tunnel_cmds
} // namespace VOM

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "mozilla")
 * End:
 */