summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTianyu Li <tianyu.li@arm.com>2022-04-22 11:22:55 +0800
committerDave Wallace <dwallacelf@gmail.com>2022-05-24 18:01:43 +0000
commit26c39878ad8c2e5e673956327badcd6e419488db (patch)
treeac9ab8083d0732d9c3a3ecfe70fb2b80460879d9 /test
parent152a9b6165c640bd551447e87a68132709864b67 (diff)
tests: fix ipsec sdp cases with parrallel job
Serveral IPSec SPD cases re-use the same test class name, leads to test error when do parrallel test with TEST_JOBS=16, change the test class names to unique values. Type: fix Fixes: 7cd35f5d688d9e3bddf66602655274dae944b086 Signed-off-by: Tianyu Li <tianyu.li@arm.com> Change-Id: Ia5768654ddb6274531222761cc82b226d97325a9
Diffstat (limited to 'test')
-rw-r--r--test/test_ipsec_spd_flow_cache_input.py10
-rw-r--r--test/test_ipsec_spd_flow_cache_output.py10
2 files changed, 10 insertions, 10 deletions
diff --git a/test/test_ipsec_spd_flow_cache_input.py b/test/test_ipsec_spd_flow_cache_input.py
index 02ecb5625ce..e8c560211bc 100644
--- a/test/test_ipsec_spd_flow_cache_input.py
+++ b/test/test_ipsec_spd_flow_cache_input.py
@@ -150,7 +150,7 @@ class IPSec4SpdTestCaseDiscard(SpdFlowCacheInbound):
self.verify_num_inbound_flow_cache_entries(1)
-class IPSec4SpdTestCaseRemove(SpdFlowCacheInbound):
+class IPSec4SpdTestCaseRemoveInbound(SpdFlowCacheInbound):
""" IPSec/IPv4 inbound: Policy mode test case with flow cache \
(remove bypass)"""
@@ -264,7 +264,7 @@ class IPSec4SpdTestCaseRemove(SpdFlowCacheInbound):
self.verify_num_inbound_flow_cache_entries(1)
-class IPSec4SpdTestCaseReadd(SpdFlowCacheInbound):
+class IPSec4SpdTestCaseReaddInbound(SpdFlowCacheInbound):
""" IPSec/IPv4 inbound: Policy mode test case with flow cache \
(add, remove, re-add bypass)"""
@@ -418,7 +418,7 @@ class IPSec4SpdTestCaseReadd(SpdFlowCacheInbound):
self.verify_num_inbound_flow_cache_entries(1)
-class IPSec4SpdTestCaseMultiple(SpdFlowCacheInbound):
+class IPSec4SpdTestCaseMultipleInbound(SpdFlowCacheInbound):
""" IPSec/IPv4 inbound: Policy mode test case with flow cache \
(multiple interfaces, multiple rules)"""
@@ -522,7 +522,7 @@ class IPSec4SpdTestCaseMultiple(SpdFlowCacheInbound):
self.verify_num_inbound_flow_cache_entries(3)
-class IPSec4SpdTestCaseOverwriteStale(SpdFlowCacheInbound):
+class IPSec4SpdTestCaseOverwriteStaleInbound(SpdFlowCacheInbound):
""" IPSec/IPv4 inbound: Policy mode test case with flow cache \
(overwrite stale entries)"""
@@ -700,7 +700,7 @@ class IPSec4SpdTestCaseOverwriteStale(SpdFlowCacheInbound):
self.verify_num_inbound_flow_cache_entries(3)
-class IPSec4SpdTestCaseCollision(SpdFlowCacheInbound):
+class IPSec4SpdTestCaseCollisionInbound(SpdFlowCacheInbound):
""" IPSec/IPv4 inbound: Policy mode test case with flow cache \
(hash collision)"""
diff --git a/test/test_ipsec_spd_flow_cache_output.py b/test/test_ipsec_spd_flow_cache_output.py
index 9852b375a82..8af3b6cfcda 100644
--- a/test/test_ipsec_spd_flow_cache_output.py
+++ b/test/test_ipsec_spd_flow_cache_output.py
@@ -82,7 +82,7 @@ class IPSec4SpdTestCaseAdd(SpdFlowCacheOutbound):
self.verify_num_outbound_flow_cache_entries(1)
-class IPSec4SpdTestCaseRemove(SpdFlowCacheOutbound):
+class IPSec4SpdTestCaseRemoveOutbound(SpdFlowCacheOutbound):
""" IPSec/IPv4 outbound: Policy mode test case with flow cache \
(remove rule)"""
@@ -180,7 +180,7 @@ class IPSec4SpdTestCaseRemove(SpdFlowCacheOutbound):
self.verify_num_outbound_flow_cache_entries(1)
-class IPSec4SpdTestCaseReadd(SpdFlowCacheOutbound):
+class IPSec4SpdTestCaseReaddOutbound(SpdFlowCacheOutbound):
""" IPSec/IPv4 outbound: Policy mode test case with flow cache \
(add, remove, re-add)"""
@@ -322,7 +322,7 @@ class IPSec4SpdTestCaseReadd(SpdFlowCacheOutbound):
self.verify_num_outbound_flow_cache_entries(1)
-class IPSec4SpdTestCaseMultiple(SpdFlowCacheOutbound):
+class IPSec4SpdTestCaseMultipleOutbound(SpdFlowCacheOutbound):
""" IPSec/IPv4 outbound: Policy mode test case with flow cache \
(multiple interfaces, multiple rules)"""
@@ -460,7 +460,7 @@ class IPSec4SpdTestCaseMultiple(SpdFlowCacheOutbound):
self.verify_num_outbound_flow_cache_entries(3)
-class IPSec4SpdTestCaseOverwriteStale(SpdFlowCacheOutbound):
+class IPSec4SpdTestCaseOverwriteStaleOutbound(SpdFlowCacheOutbound):
""" IPSec/IPv4 outbound: Policy mode test case with flow cache \
(overwrite stale entries)"""
@@ -638,7 +638,7 @@ class IPSec4SpdTestCaseOverwriteStale(SpdFlowCacheOutbound):
self.verify_num_outbound_flow_cache_entries(3)
-class IPSec4SpdTestCaseCollision(SpdFlowCacheOutbound):
+class IPSec4SpdTestCaseCollisionOutbound(SpdFlowCacheOutbound):
""" IPSec/IPv4 outbound: Policy mode test case with flow cache \
(hash collision)"""
.highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .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) 2015 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 <vppinfra/error.h>
#include <vppinfra/hash.h>
#include <vnet/vnet.h>
#include <vnet/ip/ip.h>
#include <vnet/ethernet/ethernet.h>
#include <vnet/vxlan-gpe/vxlan_gpe.h>
#include <ioam/lib-vxlan-gpe/vxlan_gpe_ioam_packet.h>
#include <ioam/lib-vxlan-gpe/vxlan_gpe_ioam.h>
#include <ioam/lib-vxlan-gpe/vxlan_gpe_ioam_util.h>

/* Statistics (not really errors) */
#define foreach_vxlan_gpe_encap_ioam_v4_error    \
_(ENCAPSULATED, "good packets encapsulated")

static char *vxlan_gpe_encap_ioam_v4_error_strings[] = {
#define _(sym,string) string,
  foreach_vxlan_gpe_encap_ioam_v4_error
#undef _
};

typedef enum
{
#define _(sym,str) VXLAN_GPE_ENCAP_IOAM_V4_ERROR_##sym,
  foreach_vxlan_gpe_encap_ioam_v4_error
#undef _
    VXLAN_GPE_ENCAP_IOAM_V4_N_ERROR,
} vxlan_gpe_encap_ioam_v4_error_t;

typedef enum
{
  VXLAN_GPE_ENCAP_IOAM_V4_NEXT_IP4_LOOKUP,
  VXLAN_GPE_ENCAP_IOAM_V4_NEXT_DROP,
  VXLAN_GPE_ENCAP_IOAM_V4_N_NEXT
} vxlan_gpe_encap_ioam_v4_next_t;


always_inline void
vxlan_gpe_encap_ioam_v4_two_inline (vlib_main_t * vm,
				    vlib_node_runtime_t * node,
				    vxlan_gpe_main_t * ngm,
				    vlib_buffer_t * b0, vlib_buffer_t * b1,
				    u32 * next0, u32 * next1)
{
  *next0 = *next1 = VXLAN_GPE_ENCAP_IOAM_V4_NEXT_IP4_LOOKUP;
  vxlan_gpe_encap_decap_ioam_v4_one_inline (vm, node, b0, next0,
					    VXLAN_GPE_ENCAP_IOAM_V4_NEXT_DROP,
					    0 /* use_adj */ );
  vxlan_gpe_encap_decap_ioam_v4_one_inline (vm, node, b1, next1,
					    VXLAN_GPE_ENCAP_IOAM_V4_NEXT_DROP,
					    0 /* use_adj */ );
}


static uword
vxlan_gpe_encap_ioam_v4 (vlib_main_t * vm,
			 vlib_node_runtime_t * node,
			 vlib_frame_t * from_frame)
{
  u32 n_left_from, next_index, *from, *to_next;
  vxlan_gpe_main_t *ngm = &vxlan_gpe_main;

  from = vlib_frame_vector_args (from_frame);
  n_left_from = from_frame->n_vectors;

  next_index = node->cached_next_index;

  while (n_left_from > 0)
    {
      u32 n_left_to_next;

      vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);

      while (n_left_from >= 4 && n_left_to_next >= 2)
	{
	  u32 bi0, bi1;
	  vlib_buffer_t *b0, *b1;
	  u32 next0, next1;

	  next0 = next1 = VXLAN_GPE_ENCAP_IOAM_V4_NEXT_IP4_LOOKUP;

	  /* Prefetch next iteration. */
	  {
	    vlib_buffer_t *p2, *p3;

	    p2 = vlib_get_buffer (vm, from[2]);
	    p3 = vlib_get_buffer (vm, from[3]);

	    vlib_prefetch_buffer_header (p2, LOAD);
	    vlib_prefetch_buffer_header (p3, LOAD);

	    CLIB_PREFETCH (p2->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
	    CLIB_PREFETCH (p3->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
	  }

	  bi0 = from[0];
	  bi1 = from[1];
	  to_next[0] = bi0;
	  to_next[1] = bi1;
	  from += 2;
	  to_next += 2;
	  n_left_to_next -= 2;
	  n_left_from -= 2;

	  b0 = vlib_get_buffer (vm, bi0);
	  b1 = vlib_get_buffer (vm, bi1);

	  vxlan_gpe_encap_ioam_v4_two_inline (vm, node, ngm, b0, b1,
					      &next0, &next1);


	  vlib_validate_buffer_enqueue_x2 (vm, node, next_index, to_next,
					   n_left_to_next, bi0, bi1, next0,
					   next1);
	}

      while (n_left_from > 0 && n_left_to_next > 0)
	{
	  u32 bi0;
	  vlib_buffer_t *b0;
	  u32 next0 = VXLAN_GPE_ENCAP_IOAM_V4_NEXT_IP4_LOOKUP;

	  bi0 = from[0];
	  to_next[0] = bi0;
	  from += 1;
	  to_next += 1;
	  n_left_from -= 1;
	  n_left_to_next -= 1;

	  b0 = vlib_get_buffer (vm, bi0);

	  vxlan_gpe_encap_decap_ioam_v4_one_inline (vm, node, b0,
						    &next0,
						    VXLAN_GPE_ENCAP_IOAM_V4_NEXT_DROP,
						    0 /* use_adj */ );

	  if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
	    {
	      vxlan_gpe_ioam_v4_trace_t *tr = vlib_add_trace (vm, node, b0,
							      sizeof (*tr));
	    }
	  vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
					   n_left_to_next, bi0, next0);
	}

      vlib_put_next_frame (vm, node, next_index, n_left_to_next);
    }

  return from_frame->n_vectors;
}



/* *INDENT-OFF* */
VLIB_REGISTER_NODE (vxlan_gpe_encap_ioam_v4_node) = {
  .function = vxlan_gpe_encap_ioam_v4,
  .name = "vxlan-gpe-encap-ioam-v4",
  .vector_size = sizeof (u32),
  .format_trace = format_vxlan_gpe_ioam_v4_trace,
  .type = VLIB_NODE_TYPE_INTERNAL,

  .n_errors = ARRAY_LEN(vxlan_gpe_encap_ioam_v4_error_strings),
  .error_strings = vxlan_gpe_encap_ioam_v4_error_strings,

  .n_next_nodes = VXLAN_GPE_ENCAP_IOAM_V4_N_NEXT,

  .next_nodes = {
    [VXLAN_GPE_ENCAP_IOAM_V4_NEXT_IP4_LOOKUP] = "ip4-lookup",
    [VXLAN_GPE_ENCAP_IOAM_V4_NEXT_DROP] = "error-drop",
  },
};
/* *INDENT-ON* */


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