aboutsummaryrefslogtreecommitdiffstats
path: root/tests/func
diff options
context:
space:
mode:
authorselias <samelias@cisco.com>2016-10-17 10:16:28 +0200
committerSamuel Eliáš <samelias@cisco.com>2016-10-20 08:54:39 +0000
commit811b8dc97ccf12952d5ec460bb0a421ce8933326 (patch)
treea9641ca87f2dbbd40fcf0144542765572b0f2400 /tests/func
parent21921596d22a72cc4e4f7dee172ff17d1e5853cd (diff)
CSIT-427: Honeycomb ietf-ACL tests - mixed layers
- add test cases for mixing L2 and L3 rules - update methods with mixed-acl functionality - update test variables Change-Id: I2aaa3033eede609627f751ea896e098548ffae98 Signed-off-by: selias <samelias@cisco.com>
Diffstat (limited to 'tests/func')
-rw-r--r--tests/func/honeycomb/081_ietf_acl_traffic.robot87
1 files changed, 81 insertions, 6 deletions
diff --git a/tests/func/honeycomb/081_ietf_acl_traffic.robot b/tests/func/honeycomb/081_ietf_acl_traffic.robot
index 53d4bddc95..be6ea16947 100644
--- a/tests/func/honeycomb/081_ietf_acl_traffic.robot
+++ b/tests/func/honeycomb/081_ietf_acl_traffic.robot
@@ -22,6 +22,7 @@
| ${acl_name_l2}= | acl_l2
| ${acl_name_l3_ip4}= | acl_l3_ip4
| ${acl_name_l3_ip6}= | acl_l3_ip6
+| ${acl_name_mixed}= | acl_mixed
*** Settings ***
| Resource | resources/libraries/robot/default.robot
@@ -89,9 +90,9 @@
| | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv4 addresses on both\
| | ... | interfaces to TG, add ARP entry and routes, and configure L3 IPv4 ACL\
| | ... | on ingress interface with src/dst IP and protocol.
-| | ... | [Ver] Send simple TCP packets from one TG interface to the other,\
-| | ... | using different IPv4 IPs. Receive all packets except those with\
-| | ... | IPs in the filtered ranges and UDP protocol payload.
+| | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
+| | ... | to the other, using different IPv4 IPs. Receive all packets except\
+| | ... | those with IPs in the filtered ranges and UDP protocol payload.
| | Given Setup interface IPs and routes for IPv4 ietf-ACL test
| | ... | L3_IP4 | ${acl_name_l3_ip4}
| | When Honeycomb creates ACL chain through IETF node
@@ -123,9 +124,9 @@
| | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv6 addresses on both\
| | ... | interfaces to TG, add IP neighbor entry and routes, and configure\
| | ... | L3 IPv6 ACL on ingress interface with src/dst IP and next-header.
-| | ... | [Ver] Send simple TCP packets from one TG interface to the other,\
-| | ... | using different IPv6 IPs. Receive all packets except those with\
-| | ... | IPs in the filtered ranges and UDP protocol payload.
+| | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
+| | ... | to the other, using different IPv6 IPs. Receive all packets except\
+| | ... | those with IPs in the filtered ranges and UDP protocol payload.
| | Given Path for 2-node testing is set
| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
| | And Import Variables | resources/test_data/honeycomb/ietf_acl.py
@@ -167,6 +168,80 @@
| | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
| | ... | UDP | ${src_port} | ${dst_port}
+| TC04: Honeycomb can configure L2 and L3 ACL on L2-mode interface
+| | [Documentation]
+| | ... | [Top] TG=DUT1=TG.
+| | ... | [Enc] Eth-IPv4-TCP.
+| | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG\
+| | ... | and configure L2 and L3 ACL on ingress interface\
+| | ... | with src/dst MAC, src/dst IP and protocol.
+| | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
+| | ... | to the other, using different MACs and IPv4 IPs. Receive all packets\
+| | ... | except those with MACs and IPs in the filtered ranges and UDP\
+| | ... | protocol payload.
+| | [Teardown] | Run Keywords
+| | ... | Clear IETF-ACL settings | ${node} | ${dut_to_tg_if1} | AND
+| | ... | Show Packet Trace on All DUTs | ${nodes} | AND
+| | ... | Honeycomb removes all bridge domains
+| | ... | ${node} | ${dut_to_tg_if1} | ${dut_to_tg_if2}
+| | Given Setup interfaces and bridge domain for ietf-ACL test
+| | ... | mixed | ${acl_name_mixed}
+| | When Honeycomb creates ACL chain through IETF node
+| | ... | ${dut_node} | ${acl_name_mixed} | mixed | ${acl_settings}
+| | And Honeycomb assigns IETF-ACL chain to interface
+| | ... | ${dut_node} | ${dut_to_tg_if1} | mixed | ingress | ${acl_name_mixed}
+| | ... | permit | L2
+| | Then Send TCP or UDP packet | ${tg_node} | ${src_ip} | ${dst_ip}
+| | ... | ${tg_to_dut_if1} | ${classify_src_mac}
+| | ... | ${tg_to_dut_if2} | ${classify_dst_mac}
+| | ... | TCP | ${src_port} | ${dst_port}
+| | And Send TCP or UDP packet | ${tg_node}
+| | ... | ${classify_src_ip} | ${classify_dst_ip}
+| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
+| | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
+| | ... | UDP | ${src_port} | ${dst_port}
+| | And Run keyword and expect error | TCP/UDP Rx timeout
+| | ... | Send TCP or UDP packet | ${tg_node}
+| | ... | ${classify_src_ip} | ${classify_dst_ip}
+| | ... | ${tg_to_dut_if1} | ${classify_src_mac}
+| | ... | ${tg_to_dut_if2} | ${classify_dst_mac}
+| | ... | UDP | ${src_port} | ${dst_port}
+
+| TC05: Honeycomb can configure L2 and L3 ACL on L3-mode interface
+| | [Documentation]
+| | ... | [Top] TG=DUT1=TG.
+| | ... | [Enc] Eth-IPv4-TCP.
+| | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv4 addresses on both\
+| | ... | interfaces to TG, add ARP entry and routes, and configure\
+| | ... | L2 and L3 ACL on ingress interface with src/dst MAC, src/dst IP\
+| | ... | and protocol.
+| | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
+| | ... | to the other, using different MACs and IPv4 IPs. Receive all packets\
+| | ... | except those with MACs and IPs in the filtered ranges and UDP\
+| | ... | protocol payload.
+| | Setup interface IPs and routes for IPv4 ietf-ACL test
+| | ... | mixed | ${acl_name_mixed}
+| | When Honeycomb creates ACL chain through IETF node
+| | ... | ${dut_node} | ${acl_name_mixed} | mixed | ${acl_settings}
+| | And Honeycomb assigns IETF-ACL chain to interface
+| | ... | ${dut_node} | ${dut_to_tg_if1} | mixed | ingress | ${acl_name_mixed}
+| | ... | permit | L3
+| | Then Send TCP or UDP packet | ${tg_node} | ${src_ip} | ${dst_ip}
+| | ... | ${tg_to_dut_if1} | ${classify_src_mac}
+| | ... | ${tg_to_dut_if2} | ${classify_dst_mac}
+| | ... | TCP | ${src_port} | ${dst_port}
+| | And Send TCP or UDP packet | ${tg_node}
+| | ... | ${classify_src_ip} | ${classify_dst_ip}
+| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
+| | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
+| | ... | UDP | ${src_port} | ${dst_port}
+| | And Run keyword and expect error | TCP/UDP Rx timeout
+| | ... | Send TCP or UDP packet | ${tg_node}
+| | ... | ${classify_src_ip} | ${classify_dst_ip}
+| | ... | ${tg_to_dut_if1} | ${classify_src_mac}
+| | ... | ${tg_to_dut_if2} | ${classify_dst_mac}
+| | ... | UDP | ${src_port} | ${dst_port}
+
# TODO: Test case for L4 ACL port-based filtering
# TODO: Test case for multiple classify rules and rule ordering
="k">struct { ssvm_private_t ssvm; /**< ssvm segment data */ fifo_segment_header_t *h; /**< fifo segment data */ } fifo_segment_t; typedef struct { fifo_segment_t *segments; /**< pool of fifo segments */ u64 next_baseva; /**< Where to put the next one */ u32 timeout_in_seconds; /**< Time to wait during attach */ } fifo_segment_main_t; typedef struct { ssvm_segment_type_t segment_type; /**< type of segment requested */ u32 segment_size; /**< size of the segment */ int memfd_fd; /**< fd for memfd segments */ char *segment_name; /**< segment name */ u32 *new_segment_indices; /**< return vec of new seg indices */ } fifo_segment_create_args_t; #define fifo_segment_flags(_fs) _fs->h->flags int fifo_segment_init (fifo_segment_t * fs); int fifo_segment_create (fifo_segment_main_t * sm, fifo_segment_create_args_t * a); int fifo_segment_attach (fifo_segment_main_t * sm, fifo_segment_create_args_t * a); void fifo_segment_delete (fifo_segment_main_t * sm, fifo_segment_t * fs); fifo_segment_t *fifo_segment_get_segment (fifo_segment_main_t * sm, u32 fs_index); u32 fifo_segment_index (fifo_segment_main_t * sm, fifo_segment_t * fs); void fifo_segment_info (fifo_segment_t * seg, char **address, size_t * size); /** * Allocate fifo in fifo segment * * @param fs fifo segment for fifo * @param data_bytes size of default fifo chunk in bytes * @param ftype fifo type @ref fifo_segment_ftype_t * @return new fifo or 0 if alloc failed */ svm_fifo_t *fifo_segment_alloc_fifo (fifo_segment_t * fs, u32 data_bytes, fifo_segment_ftype_t ftype); /** * Free fifo allocated in fifo segment * * @param fs fifo segment for fifo * @param f fifo to be freed */ void fifo_segment_free_fifo (fifo_segment_t * fs, svm_fifo_t * f); /** * Try to preallocate fifo headers * * Tries to preallocate fifo headers and adds them to freelist. * * @param fs fifo segment * @param batch_size number of chunks to be allocated * @return 0 on success, negative number otherwise */ int fifo_segment_prealloc_fifo_hdrs (fifo_segment_t * fs, u32 batch_size); /** * Try to preallocate fifo chunks on segment * * Tries to preallocate chunks of requested size on segment and adds them * to chunk freelist. * * @param fs fifo segment * @param chunk_size size of chunks to be allocated in bytes * @param batch_size number of chunks to be allocated * @return 0 on success, negative number otherwise */ int fifo_segment_prealloc_fifo_chunks (fifo_segment_t * fs, u32 chunk_size, u32 batch_size); /** * Pre-allocates fifo pairs in fifo segment * * The number of fifos pre-allocated is the minimum of the requested number * of pairs and the maximum number that fit within the segment. If the maximum * is hit, the number of fifo pairs requested is updated by subtracting the * number of fifos that have been successfully allocated. * * @param fs fifo segment for fifo * @param rx_fifo_size data size of rx fifos * @param tx_fifo_size data size of tx fifos * @param n_fifo_pairs number of pairs requested. Prior to returning, this * is decremented by the the number of pairs allocated. */ void fifo_segment_preallocate_fifo_pairs (fifo_segment_t * fs, u32 rx_fifo_size, u32 tx_fifo_size, u32 * n_fifo_pairs); /** * Grow fifo size by adding an additional chunk of memory * * @param fs fifo segment for fifo * @param f fifo to be grown * @param chunk_size number of bytes to be added to fifo * @return 0 on success or a negative number otherwise */ int fifo_segment_grow_fifo (fifo_segment_t * fs, svm_fifo_t * f, u32 chunk_size); /** * Collect unused chunks for fifo * * @param fs fifo segment for fifo * @param f fifo whose chunks are to be collected * @return 0 on success, error otherwise */ int fifo_segment_collect_fifo_chunks (fifo_segment_t * fs, svm_fifo_t * f); /** * Fifo segment estimate of number of free bytes * * Returns fifo segment's internal estimate of the number of free bytes. * To force a synchronization between the segment and the underlying * memory allocator, call @ref fifo_segment_update_free_bytes * * @param fs fifo segment * @return free bytes estimate */ u32 fifo_segment_free_bytes (fifo_segment_t * fs); /** * Update fifo segment free bytes estimate * * Forces fifo segment free bytes estimate synchronization with underlying * memory allocator. * * @param fs fifo segment */ void fifo_segment_update_free_bytes (fifo_segment_t * fs); /** * Number of bytes on chunk free lists * * @param fs fifo segment * @return free bytes on chunk free lists */ u32 fifo_segment_chunk_prealloc_bytes (fifo_segment_t * fs); u8 fifo_segment_has_fifos (fifo_segment_t * fs); svm_fifo_t *fifo_segment_get_fifo_list (fifo_segment_t * fs); u32 fifo_segment_num_fifos (fifo_segment_t * fs); u32 fifo_segment_num_free_fifos (fifo_segment_t * fs); /** * Find number of free chunks of given size * * @param fs fifo segment * @param size chunk size of interest or ~0 if all should be counted * @return number of chunks of given size */ u32 fifo_segment_num_free_chunks (fifo_segment_t * fs, u32 size); void fifo_segment_main_init (fifo_segment_main_t * sm, u64 baseva, u32 timeout_in_seconds); format_function_t format_fifo_segment; format_function_t format_fifo_segment_type; #endif /* __included_fifo_segment_h__ */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */