98 Commits

Author SHA1 Message Date
Paul Vinciguerra
8feeaff56f Typos. A bunch of typos I've been collecting.
Change-Id: I53ab8d17914e6563110354e4052109ac02bf8f3b
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-28 06:36:04 +00:00
Ole Trøan
3b0d7e42f6 Revert "API: Cleanup APIs interface.api"
This reverts commit e63325e3ca03c847963863446345e6c80a2c0cfd.

Allow time for CSIT to accommodate.

Change-Id: I59435e4ab5e05e36a2796c3bf44889b5d4823cc2
Signed-off-by: ot@cisco.com
2019-03-15 17:34:06 +00:00
Jakub Grajciar
e63325e3ca API: Cleanup APIs interface.api
Use of consistent API types for interface.api

Change-Id: Ieb54cebb4ac96b432a3f0b41596718aa2f34885b
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-03-15 10:24:22 +00:00
Neale Ranns
6348074be4 TEST: link-state up/down notifications on FIB forwarding
Change-Id: I478c4e5feb9603b7443efdf2967f98f9bde7ea0f
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-14 13:04:00 +00:00
Ole Troan
a5b2eec053 vpp_papi_provider: Remove more wrapper functions.
Split this work up into pieces.
Please don't add new wrappers to vpp_papi_provider.py.

Change-Id: I0f8f2afc4cd2bba07ea70ddecea2d7319f7b2e10
Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-11 21:57:19 +00:00
Paul Vinciguerra
22ab6f7cbb VPP-1508: Tests: Fix vpp_api struct.error under py3.
Fix struct.error: expected bytes object got <class 'str'>

Change-Id: I837ae6e97e44c789a9372677151b157956525334
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11 09:20:04 +00:00
Paul Vinciguerra
a7427ec6f8 VPP-1508: Use scapy.compat to manage packet level library differences.
Change-Id: Icdf6abc9e53d33b26fd1d531c7dda6be0bb9cb55
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11 08:11:16 +00:00
Paul Vinciguerra
eaea421e1f Tests: Refactor payload_to_info()
All callers of payload_to_info were required to wrap payload with str().
Refactor to call scapy's payload.load for raw payloads or specify the
specific fieldname.

Change-Id: I1c80599d4df8dc129dbb8274733afaad406d5bcf
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-07 22:29:44 +00:00
Paul Vinciguerra
ea2450fa2d VPP-1508: Python3 tests. Explicitly specify string formatting.
.format() doesn't understand what to do with binary values by default.
Specify that we expect coersion to string.

Change-Id: Ic4b697f70852124dc85ab231f76b7934d0d71f4d
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-07 22:29:00 +00:00
Ole Troan
9a475373ed test framework: vpp_papi_provider.py - further cleanup
Part of further cleanups of this file.
Removed most wrappers that don't have conflicting signature with
message API.

Change-Id: I6acd93d20291feb7731eb35ab2eb8c9f22f4632c
Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-06 21:13:05 +01:00
Paul Vinciguerra
4eed7474f4 Fix TestIPv4FibCrud interdependencies.
The tests fail if run independently or out of order.
This change breaks the dependency between the tests.

ERROR: Add 1k routes
------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/vpp/test/test_ip4.py", line 514, in test_3_add_new_routes
    self.deleted_routes.remove(x)
ValueError: list.remove(x): x not in list

Change-Id: I344ceba6bd8b86556f92e50080be6c43092b9faf
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-17 10:14:12 +00:00
Ole Troan
0bcad32b38 PAPI: Allow ipaddress object as argument and return values from API calls
The API calls that use any of vl_api_address_t, vl_api_ip4_address,
vl_api_ip6_address_t, vl_api_prefix_t, vl_api_ip4_prefix_t,
vl_api_ip6_prefix_t now accepts either the old style dictionary,
a text string (2001:db8::/32) or an ipaddress ojbect.

Unless it is called with '_no_type_conversion':True, it will
also return an appropriate ipaddress object.

Change-Id: I84e4a1577bd57f6b5ae725f316a523988b6a955b
Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-12 00:34:43 +00:00
Neale Ranns
be2286b0a4 IP-local: any IP can appear as the source (VPP-1522)
Change-Id: Ib0d9b533d72c899b77c9a7bd1daa9b4a55b7221c
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-10 13:43:38 +00:00
Ole Troan
8c8acc0278 API: Change ip4_address and ip6_address to use type alias.
Change-Id: Id8669bbadd1d6b2054865a310a654e9b38d1667d
Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-06 14:05:04 +00:00
Paul Vinciguerra
a6fe463c1c VPP-1508 python3 tests: xrange
xrange is not supported. Use six.range.

py27 runtests: commands[5] | stestr --test-path ./test run --slowest test_ip4 test_ip6
==============================================================================
IPv4 disabled
==============================================================================
==============================================================================
ICMP Echo Test Case
==============================================================================
{0} test.test_ip4.TestIPDisabled.test_ip_disabled [5.256819s] ... ok
07:24:41,902 Couldn't stat : /tmp/vpp-unittest-TestICMPEcho-hU4IsB/stats.sock
{1} test.test_ip4.TestICMPEcho.test_icmp_echo [0.367035s] ... ok
==============================================================================
IPv4 Deaggregate Routes
==============================================================================
==============================================================================
IPv4 Input Exceptions
==============================================================================
07:24:47,314 Couldn't stat : /tmp/vpp-unittest-TestIPDeag-eE1VgC/stats.sock
{1} test.test_ip4.TestIPDeag.test_ip_deag [5.895646s] ... ok
{0} test.test_ip4.TestIPInput.test_ip_input [5.819001s] ... ok
==============================================================================
IPv4 longest Prefix Match

... output truncated ...

==============================
Failed 4 tests - output below:
==============================

test.test_ip4.TestIPv4FibCrud.test_3_add_new_routes
---------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/vpp/test/test_ip4.py", line 509, in test_3_add_new_routes
        self.deleted_routes.remove(x)
    ValueError: list.remove(x): x not in list

test.test_ip4.TestIPv4FibCrud.test_2_del_routes
-----------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/vpp/test/test_ip4.py", line 478, in test_2_del_routes
        self.configured_routes.remove(x)
    ValueError: list.remove(x): x not in list

test.test_ip4_vrf_multi_instance.TestIp4VrfMultiInst.test_ip4_vrf_03
--------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/vpp/test/test_ip4_vrf_multi_instance.py", line 465, in test_ip4_vrf_03
        self.create_vrf_and_assign_interfaces(1)
      File "/vpp/test/test_ip4_vrf_multi_instance.py", line 189, in create_vrf_and_assign_interfaces
        pg_if.set_table_ip4(vrf_id)
      File "/vpp/test/vpp_interface.py", line 322, in set_table_ip4
        self.sw_if_index, 0, self.ip4_table_id)
      File "/vpp/test/vpp_papi_provider.py", line 264, in sw_interface_set_table
        'vrf_id': table_id})
      File "/vpp/test/vpp_papi_provider.py", line 196, in api
        raise UnexpectedApiReturnValueError(msg)
    test.vpp_papi_provider.UnexpectedApiReturnValueError: API call failed, expected 0 return value instead of -114 in sw_interface_set_table_reply(_0=91, context=1007, retval=-114)

test.test_ip4_vrf_multi_instance.TestIp4VrfMultiInst.test_ip4_vrf_02
--------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/vpp/test/test_ip4_vrf_multi_instance.py", line 445, in test_ip4_vrf_02
        self.reset_vrf_and_remove_from_vrf_list(1)
      File "/vpp/test/test_ip4_vrf_multi_instance.py", line 208, in reset_vrf_and_remove_from_vrf_list
        self.vapi.reset_fib(vrf_id, is_ipv6=0)
      File "/vpp/test/vpp_papi_provider.py", line 1137, in reset_fib
        'is_ipv6': is_ipv6,
      File "/vpp/test/vpp_papi_provider.py", line 196, in api
        raise UnexpectedApiReturnValueError(msg)
    test.vpp_papi_provider.UnexpectedApiReturnValueError: API call failed, expected 0 return value instead of -3 in reset_fib_reply(_0=259, context=1198, retval=-3)

======
Totals
======
Ran: 57 tests in 266.0000 sec.
 - Passed: 53
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 4
Sum of execute time for each test: 157.3925 sec.

==============
Worker Balance
==============
 - Worker 0 (29 tests) => 0:03:52.608995
 - Worker 1 (28 tests) => 0:04:08.615473
Test id                                        Runtime (s)
---------------------------------------------  -----------
test.test_ip_mcast.TestIPMcast.test_ip6_mcast  8.535
test.test_ip4.TestIPPunt.test_ip_punt          8.082
test.test_ip6.TestIP6Punt.test_ip_punt         6.582
test.test_ip6.TestIPDeag.test_ip_deag          6.175
test.test_ip6.TestIPv6.test_ns                 6.171
test.test_ip4.TestIPDeag.test_ip_deag          5.896
test.test_ip6.TestIPv6.test_fib                5.846
test.test_ip4.TestIPInput.test_ip_input        5.819
test.test_ip6.TestIPv6.test_rs                 5.737
test.test_ip4.TestIPv4.test_fib                5.267
ERROR: InvocationError for command '/vpp/.tox/py27/bin/stestr --test-path ./test run --slowest test_ip4 test_ip6' (exited with code 1)
______________________________________________________ summary ______________________________________________________
ERROR:   py27: commands failed
Change-Id: Id9f6ecb4897386f790d82ab908963e4971a3aac8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-05 12:08:24 +00:00
Pavel Kotucek
609e1210c6 VPP-1507: Added binary api to dump configured ip_punt_redirect
Change-Id: I790f7785e183cc9aaffd5b593617c4e12a32e20d
Signed-off-by: Pavel Kotucek <pavel.kotucek@pantheon.tech>
2018-11-29 08:49:17 +00:00
Paul Vinciguerra
6e4c6ad92e VPP-1508 python3 tests: .encode('hex')
Change to binascii.hexlify() for consistent bahavior.

Change-Id: Ie430cdd1ffeb6510db4aa037546e42d85992093b
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-27 09:01:27 +00:00
Paul Vinciguerra
3d2df215bf Python3 tests: Fix asserts.
Use assert(Not)Equal()
Use assert{Greater,Less}[Equal]

Change-Id: I7c14570b8dce463ee13a67e9c1f10beb1a0308a8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-26 19:53:39 +00:00
Juraj Sloboda
68b7cb8feb Fix buffer overflow when fragmenting packets (VPP-1383)
Change-Id: Idcda9ae55fa2efb0b2e928bac3e8e86ff8d19eba
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
2018-10-22 12:34:49 +00:00
mu.duojiao
59a829533c VPP-1448: Fix error when recurse on down the trie.
Change-Id: Idfed8243643780d3f52dfe6e6ec621c440daa6ae
Signed-off-by: mu.duojiao <mu.duojiao@zte.com.cn>
2018-10-15 07:54:03 +00:00
Neale Ranns
3b93be5d76 IP route update fix when multipath and drop set
Change-Id: I9cec7486cb6e3c5261d74d2b15a4d19469285a30
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-07 11:16:14 +00:00
Neale Ranns
ce9e0b4d48 loop counter to prevent infiinte number of look ups per-packet
Change-Id: I59235d11baac18785a4c90cdaf14e8f3ddf06dab
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-08-03 11:49:39 +00:00
Neale Ranns
1855b8e48d IP directed broadcast
with ip direct broadcast enable a packet to the interface's
subnet broadcast address with be sent L2 broadcast on the
interface. dissabled, it will be dropped. it is disabled by
default, which preserves current behaviour

Change-Id: If154cb92e64834e97a541b32624354348a0eafb3
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-20 13:21:03 +00:00
Jan Gelety
e6c78ee842 make_test: add icmp packet size sweep and icmp echo tests
Jira: CSIT-1141

Change-Id: I162bb4e718bff188abefc7b2f33501de9c55bb03
Signed-off-by: Jan Gelety <jgelety@cisco.com>
2018-07-02 15:06:58 +00:00
Ole Troan
d723161e03 MTU: Software interface / Per-protocol MTU support
This patch separates setting of hardware interfaec and software
interface MTU. Software MTU is L2 payload MTU (i.e. not including L2
header). Per-protocol MTU for IPv4, IPv6 and MPLS can also be set.
Currently only IP4, IP6 are enabled in adjacency / rewrite code.

Documentation in src/vnet/MTU.md

Change-Id: Iee2fd6f0bbc8210748dd8e073ab9fab87d323690
Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-11 10:25:59 +00:00
Ole Troan
8a9c8f1412 VPP-1283: IPv4 PMTU missing MTU value in ICMP4 message.
Change-Id: I7a4133c59ff45b0744b48e246a049d9f015026fc
Signed-off-by: Ole Troan <ot@cisco.com>
2018-05-23 16:39:45 +00:00
Damjan Marion
fe7d4a2e31 Revert "MTU: Setting of MTU on software interface (instead of hardware interface)"
This reverts commit 70083ee74c3141bbefb185525315f1b34497dcaa.

Reverting as this patch is causing following crash:

0: /home/damarion/cisco/vpp3/build-data/../src/vnet/devices/devices.h:131 (vnet_get_device_input_thread_index) assertion `queue_id < vec_len (hw->input_node_thread_index_by_queue)' fails
Aborted

Change-Id: Ie2a365032110b1f67be7a9d832885b9899813d39
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-13 19:45:57 +02:00
Ole Troan
70083ee74c MTU: Setting of MTU on software interface (instead of hardware interface)
Change-Id: I98bd454a761a1032738a21edeb0fe847e801f901
Signed-off-by: Ole Troan <ot@cisco.com>
2018-04-13 13:27:44 +00:00
Neale Ranns
ffd78d1ef8 Improve MTU handling
- setting MTU on an interface updates the L3 max bytes too
- value cached in the adjacency is also updated
- MTU exceeded generates ICMP to sender

Change-Id: I343ec71d8e903b529594c4bd0543f04bc7f370b3
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-12 11:23:33 +00:00
Neale Ranns
52fae86264 test: consolidate the multiple versions of send_and_*
Change-Id: I7fa7d0ebf73dab8264a2e5ddbd412600d78ead05
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-01-09 12:41:23 +00:00
Neale Ranns
62fe07c8e3 MPLS disposition actions at the tail of unicast LSPs
Change-Id: I8c42e26152f2ed1246f91b789887bfc923418bdf
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-11-11 14:23:45 +00:00
Neale Ranns
4c7c8e55b0 Refactor IP input checks for re-use at MPLS disposition
Change-Id: I7aafdecd6f370411138e6ab67b2ff72cda6e0666
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-31 08:06:03 +00:00
Neale Ranns
054c03ac9c Source Lookup progammable via API
Change-Id: I5d5d4f22b6369d504455a644f73076d772fbcfb4
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-14 09:11:42 +00:00
Neale Ranns
d91c1dbdb3 punt and drop features:
- new IPv4 and IPv6 feature arcs on the punt and drop nodes
 - new features:
   - redirect punted traffic to an interface and nexthop
   - police punted traffic.

Change-Id: I53be8bf4e06545add8a3619e462de5ffedd0a95c
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-10 16:42:39 +00:00
Neale Ranns
1500254bee FIB table add/delete API
part 2;
  - this adds the code to create an IP and MPLS table via the API.
  - but the enforcement that the table must be created before it is used is still missing, this is so that CSIT can pass.

Change-Id: Id124d884ade6cb7da947225200e3bb193454c555
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-09-11 10:14:36 +00:00
Neale Ranns
42e6b097e0 Tests for recursive load-balancing with no choices.
Change-Id: I90bb3369576741d03628a818ffa63cc99d6e4c98
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-08-01 15:36:26 +00:00
Neale Ranns
30d0fd4804 Packets recieved on VLAN-0 map to the main interface
Change-Id: I21b1ad39275495d4d006023b58f630a213445854
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-06-06 15:37:12 +00:00
Neale Ranns
71275e3d1e MPLS hash function improvements
Change-Id: I28e98f445c01493562b6196a4f5b532a51f178af
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-05-25 21:03:11 +00:00
Neale Ranns
227038a444 IP Flow Hash Config fixes
- the flow hash config is (and was) cached on the load-balance object so the fib_table_t struct is not used a switch time. Therefore changes to the table's flow hash config need to be propagated to all load-balances and hance all FIB entries in the table.
- enable API for setting the IPv6 table flow hash config
- use only the hash config in the fib_table_t object and not on the ipX_fib_t
- add tests.

Change-Id: Ib804c11162c6d4972c764957562c372f663e05d4
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-04-26 15:31:41 +00:00
Neale Ranns
9a69a6095f Sub-net broadcast addresses for IPv4
Change-Id: Ib2189d01e8bc61de57404159690fb70f89c47277
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-03-29 12:06:13 +00:00
Neale Ranns
180279b912 Fix IP feature ordering.
Drop comes before lookup when enabled. is_first_or_last is not required when setting a feature, the anchor is added in find_config_with_features().
Don't make the PG interfaces automatically L3 enabled, this way we can have tests that check the L3 protocol disbaled behaviour.

Change-Id: Icef22a920b27ff9cec6ab2da6b05f05c532cb60f
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-03-17 19:41:56 +00:00
Neale Ranns
37be73693a Tests to target holes in adjacency and DPO test coverage
Change-Id: Ic6ac7e441a7b75baa02f03c1585d1ae00903a399
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-03-09 10:50:41 +00:00
Klement Sekera
da505f608e make test: improve documentation and PEP8 compliance
Change-Id: Ib4f0353aab6112fcc3c3d8f0bcbed5bc4b567b9b
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-01-11 23:26:16 +00:00
Klement Sekera
dab231a11e make test: improve handling of packet captures
Perform accounting of expected packets based on created packet infos.
Use this accounting info to automatically expect (and verify) the
correct number of packets to be captured. Automatically retry the read
of the capture file if scapy raises an exception while doing so to
handle rare cases when capture file is read while only partially
written during busy wait. Don't fail assert_nothing_captured if only
junk packets arrived.

Change-Id: I16ec2e9410ef510d313ec16b7e13c57d0b2a63f5
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-23 17:38:33 +00:00
Matej Klotton
16a14cdb16 make test: FIB add/update/delete - ip4 routes
- JIRA:CSIT-483

Change-Id: Idb4c5bd7a234bc975f3380ece58c0e8d4bfdafd9
Signed-off-by: Matej Klotton <mklotton@cisco.com>
2016-12-09 09:03:19 +00:00
Klement Sekera
7bb873a4cc make test: fix missing log/packet messages
Change-Id: Idb3119792943664748c4abc3829ad723f4156dfe
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-05 18:44:45 +00:00
Matej Klotton
86d87c40dd Update test documentation.
- update IRB, IPv4, ipv6 doc
- revert 778c2765c8ea5c6628f6d668847f0b9ae06dbf3d

Change-Id: I9af5ed9329ce5fe01392cf28d5bf321cfc647e48
Signed-off-by: Matej Klotton <mklotton@cisco.com>
2016-11-15 15:32:48 +00:00
Klement Sekera
d72fdf5712 Disable non-working checks in load-balancer test and rename ip->ip4
Change-Id: If62011e29e912bf0c47625b0d3b3624ef6375013
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-11-09 11:44:59 +00:00