5649 Commits

Author SHA1 Message Date
Paul Vinciguerra
1314ec6170 test/hook.py. Add human-friendly annotations to log msgs.
*  Add human-friendly annotations to packed data values in
   the logs.

Examples:
vpp-unittest-TestNAT66-_JdbMS/log.txt:22:31:29,152 API: ip_neighbor_add_del (is_static=0, is_no_adj_fib=0, is_add=1, sw_if_index=2, dst_address='\xfd\x01\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02 (fd01:2::2)', mac_address='\x02\x02\x00\x00\xff\x02 (02:02:00:00:ff:02)', is_ipv6=1)

vpp-unittest-TestACL_dot1ad_bridged-xEdhrj/log.txt:22:31:17,130 API: ip_neighbor_add_del (is_static=0, is_no_adj_fib=0, is_add=1, sw_if_index=5, dst_address='\xfd\x01\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc9 (fd01:5::c9)', mac_address='\x02\x05\xc9\x00\xff\xc9 (02:05:c9:00:ff:c9)', is_ipv6=1)
vpp-unittest-TestACL_dot1ad_bridged-xEdhrj/log.txt:22:31:17,240 API: sw_interface_add_del_address (address_length=24, del_all=0, is_add=1, sw_if_index=6, address='\xac\x10\x06\x01 (172.16.6.1)', is_ipv6=0)
vpp-unittest-TestACL_dot1ad_bridged-xEdhrj/log.txt:22:31:17,314 API: sw_interface_add_del_address (address_length=64, del_all=0, is_add=1, sw_if_index=6, address='\xfd\x01\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01 (fd01:6::1)', is_ipv6=1)

Change-Id: Id6991569ee0ff853f76fae8fac941e8a26468a19
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-13 14:32:10 +00:00
jackiechen1985
e91e6de840 Fix VPP-1530 Classify session creation error
Change-Id: I6f877be6b3a1ef7100607560d430400bb824b6ba
Signed-off-by: jackiechen1985 <xiaobo.chen@tieto.com>
2018-12-13 14:30:18 +00:00
Florin Coras
e80b59104f tcp: fix handling of no wscale in syns
Change-Id: I7219a8d315b312812acafd9d2709fba8b4a2a679
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13 13:41:01 +00:00
Florin Coras
05ecfcc08a ldp/vcl: reduce debug verbosity
Also cleanup some ldp debug code.

Change-Id: I23d1b9d744289244f4778f623702fc2b5d6fcd8b
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13 13:41:01 +00:00
Florin Coras
4850e3e73c tcp: validate seq for handshake ack
Change-Id: Ifc0584d781efc30904069ea17c0afbb68c49c442
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13 13:40:45 +00:00
Florin Coras
42ceddb7cd session/tcp: support tx flush mark
For tcp this means that the last enqueued data goes out with a psh bit
set.

Change-Id: I29d357ecae6f02e748b59a7b799150ec73d14ba2
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13 13:40:32 +00:00
Ole Troan
413f4a5b21 API: Use string type instead of u8.
The new string type is modelled after string in proto3.
It is always variable length.

Change-Id: I64884067e28a80072c8dac31b7c7c82d6e306051
Signed-off-by: Ole Troan <ot@cisco.com>
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-13 12:11:50 +00:00
jdenisco
6f666ad99a docs: Update the requirements
Change-Id: I80ea8a65317805c6542e338a92a21e6090f6c015
Signed-off-by: jdenisco <jdenisco@cisco.com>
2018-12-13 08:14:30 +00:00
Zhiyong Yang
b2ecc5d415 ip4_rewrite_inline: fix variable error
Change-Id: I0470b4b13095583fe018f565f100342fab45715e
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2018-12-13 08:12:39 +00:00
Klement Sekera
173e20ceae vapi: code cleanup
Change-Id: If3bdb4369d6055e06a9b29bcba37785dbd32eb71
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-12-13 08:03:01 +00:00
Mohsin Kazmi
51edc3ab01 vom: Add support for new stats
This patch deprecates old stats and adds support for
new stats.

This implements the PULL design where client will enable
stats on objects (i.e. interfaces, etc), register a call
back function which will run once stats will be ready for
enabled object and call HW::read_stats() periodically to
read stats for enabled objects from VPP.

Change-Id: I32525a417427be87408d01f8bc93a731602ff690
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-12-13 07:46:02 +00:00
Dave Barach
eb6c799947 VPP-1529: check hop-by-hop header length
Fix a single packet-of-death case, caught by vlib_buffer_advance() in
debug images.

Change-Id: I9c107f20d7c053c3e40a0756dd7ca1c3be276a1a
Signed-off-by: Dave Barach <dave@barachs.net>
2018-12-12 08:30:11 -05:00
Neale Ranns
cf3ecb1a42 VOM: vxlan-tunnel takes egress interface for multicast
Change-Id: I23b44d883fbd7919bf55b96b180f97837fd6dae9
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-12 12:05:49 +00:00
Igor Mikhailov (imichail)
11312ef90b dpdk: net/bonding: fix buffer corruption in packets
This fix is needed for setup with bonded interfaces.
In some scenarios vpp might crash, this change fixes the issue.

Change-Id: I0dc66e32b6c89dc3f8d552401833d6785a12c978
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-12-12 00:36:14 +00:00
Lijian.Zhang
ca7f53a171 Fix CDP failure in make test
Once the hostname is longer than 15 bytes,
the name of device in the output of show cdp command will be truncated,
and CDP test case will fail with below message.

==============================================================================
FAIL: test_send_cdp_packet (test_cdp.TestCDP)
------------------------------------------------------------------------------
Traceback (most recent call last):
File "vpp/test/test_cdp.py", line 92, in test_send_cdp_packet
    "CDP received invalid device id")
File "vpp/test/framework.py", line 804, in assert_equal
    self.assertEqual(real_value, expected_value, msg)
AssertionError: Invalid CDP received invalid device id: net-x86-supermi does not match expected value net-x86-supermicro-02

Change-Id: Ia32b92c6cd1bb6070adcee3ec45e38399ec382a7
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
2018-12-12 00:35:27 +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
Matthew Smith
41b25cf638 fix spurious error setting SA on ipsec intf
Reverse the polarity on test to determine if old SA session
deletion succeeded. 0 == success, not failure.

Change-Id: I499cb04c7f13165e6c92367d4385057b77fe3836
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-12-12 00:34:27 +00:00
Pierre Pfister
057b3565a0 Change ipsec feature node names
ipsec4-output and ipsec6-output were conflicting with ipsec
interface names ("ipsec<id>") and vnet/interface.c autogenerated
output node ("<ifname>-output").

Changing feature names seems to be the less invasive option.
This patch also changes "input" feature names for consistency.

Change-Id: I4ba10d07e9ba09df20aa2500104252b06b55f8f7
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2018-12-12 00:34:13 +00:00
Khers
bb5d22dafb New api in order to get max entries of connection table is added.
Change-Id: I2f81ec95de55ad2355f82550451ad825c228e5cd
Signed-off-by: Khers <s3m2e1.6star@gmail.com>
2018-12-11 15:13:37 +00:00
juraj.linkes
a409f2729a Fix vat dependencies
Needed for arm machines in CI.

Change-Id: Ib16a8b63e145116c7cb22376243e9026d9545c8a
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-12-11 12:57:00 +00:00
juraj.linkes
185e6490ee Fix typo in sanity test description
Change-Id: Icd575b8ed62c340c57857ff6576f65557434f3e0
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-12-11 12:55:41 +00:00
Pierre Pfister
4c422f9a3c Add IPSec interface FIB index for TX packet
This patch adds a configuration parameter to IPSec tunnels, enabling
custom FIB selection for encapsulated packets.
Although this option could also be used for policy-based IPSec,
this change only enables it for virtual-tunnel-interface mode.

Note that this patch does change the API default behavior regarding
TX fib selection for encapsulated packets.
Previous behavior was to use the same FIB after and before encap.
The new default behavior consists in using the FIB 0 as default.

Change-Id: I5c212af909940a8cf6c7e3971bdc7623a2296452
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2018-12-11 12:42:09 +00:00
jackiechen1985
240f69aed7 Fix [csit-dev] CSIT IPv6 IPSec transport mode tests are failing
Change-Id: I7893a8fd5b3e15063675597c0e9bd1cd0b49ef0e
Signed-off-by: jackiechen1985 <xiaobo.chen@tieto.com>
2018-12-11 12:40:52 +00:00
Jon Loeliger
5a2e278a09 MAP: Add API support for setting parameters.
Change-Id: Ic67073e1f2ebe54bee5cb96a951eb92a28b1de06
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2018-12-11 06:32:21 +00:00
Neale Ranns
193c47d900 VOM: vxlan-gbp
Change-Id: I5f4464435f1346207f2f9b497369795eb82b58b6
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-10 17:50:09 +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
Paul Vinciguerra
6919b0de47 test/framework.py: change logger to return 'e' format.
* When the framework logs an unexpected sleep time,
  display the units in the same format. Typically,
  it has been returning a float and an 'e'.
  ex. unexpected time.sleep() result - slept for 0.000107049942017s instead of ~4.88758087158e-05s!

* Defer logger interpolation.

Change-Id: I543ad6d41c7f263d61615341437f80973c0017de
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-10 08:16:23 +00:00
Ole Troan
dfb984d4e8 Python API: Use services to determine stream RPC
The services {} definitions contain which APIs are streaming.
In addition only create function definition for the client side
(not for reply messages).

Change-Id: I8e83d35386cdd9ebee83d4571eaebdc6dff19e82
Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-10 08:02:24 +00:00
Ole Troan
7f99183a20 Test framework: StringIO fixes for Python3
Add 2/3 support to binarytomac and mactobinary and move to vpp_mac.py

Change-Id: I3dc7e4a24486aee22140c781aae7e44e58935877
Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-10 08:01:56 +00:00
Neale Ranns
521a8d7df4 FIB recusrion loop checks traverse midchain adjacencies
if a tunnel's destination address is reachable through the tunnel
(see example config belwo) then search for and detect a recursion
loop and don't stack the adjacency. Otherwise this results in a
nasty surprise.

DBGvpp# loop cre
DBGvpp# set int state loop0 up
DBGvpp# set int ip addr loop0 10.0.0.1/24
DBGvpp# create gre tunnel src 10.0.0.1 dst 1.1.1.1
DBGvpp# set int state gre0 up
DBGvpp# set int unnum gre0 use loop0
DBGvpp# ip route 1.1.1.1/32 via gre0

DBGvpp# sh ip fib 1.1.1.1
ipv4-VRF:0, fib_index:0, flow hash:[src dst sport dport proto ] locks:[src:plugin-hi:2, src:default-route:1, ]
1.1.1.1/32 fib:0 index:11 locks:4   <<< this is entry #11
  src:CLI refs:1 entry-flags:attached, src-flags:added,contributing,active,
    path-list:[14] locks:2 flags:shared,looped, uPRF-list:12 len:1 itfs:[2, ]
      path:[14] pl-index:14 ip4 weight=1 pref=0 attached-nexthop:  oper-flags:recursive-loop,resolved, cfg-flags:attached,
        1.1.1.1 gre0 (p2p)
          [@0]: ipv4 via 0.0.0.0 gre0: mtu:9000 4500000000000000fe2fb0cc0a0000010101010100000800
             stacked-on entry:11:  <<<< and the midchain forwards via entry #11
               [@2]: dpo-drop ip4

  src:recursive-resolution refs:1 src-flags:added, cover:-1

 forwarding:   unicast-ip4-chain
  [@0]: dpo-load-balance: [proto:ip4 index:13 buckets:1 uRPF:12 to:[0:0]]
    [0] [@6]: ipv4 via 0.0.0.0 gre0: mtu:9000 4500000000000000fe2fb0cc0a0000010101010100000800
        stacked-on entry:11:
          [@2]: dpo-drop ip4

DBGvpp# sh adj 1
[@1] ipv4 via 0.0.0.0 gre0: mtu:9000 4500000000000000fe2fb0cc0a0000010101010100000800
  stacked-on entry:11:
    [@2]: dpo-drop ip4
   flags:midchain-ip-stack midchain-looped  <<<<< this is a loop
   counts:[0:0]
   locks:4
 delegates:

 children:
  {path:14}

Change-Id: I39b82bd1ea439be4611c88b130d40289fa0c1b59
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-07 15:09:37 +00:00
Florin Coras
ab86f86e7c tcp: improve check for invalid sack blocks
Change-Id: Ic6a6202a2d5aca33eee7fc6ff8eeaa1db9b58525
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07 15:08:58 +00:00
Florin Coras
df08478317 tcp: measure us rtt with syn-ack
Change-Id: I20820145377060e12aeeb23b433206c79fd88332
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07 15:08:58 +00:00
Florin Coras
ea41aac320 tcp: fix timestamp check and paws
Change-Id: I5a5ee48755befc370a1f89ddbb0d91f164ed564f
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07 15:08:58 +00:00
Florin Coras
8023111319 tcp: better handling of options only allowed in syns
Change-Id: I6debfe85d9d55f6f9a8ef0ce1dcc008393847a37
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07 15:08:58 +00:00
Florin Coras
311e11b179 tcp: validate connection state in retransmit
Change-Id: Ia9048bb4e074f7ebc36eb77e542a916924103332
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07 15:08:58 +00:00
Florin Coras
b8dda5ffb6 tcp: fix length check
Change-Id: Iff75be238a231df88a37b61610c134e4a4770708
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07 15:08:58 +00:00
Pavel Kotucek
e88865d7bc VPP-1506: dump local punts and registered punt sockets
Change-Id: If7835e9b80ec9402404bfc8d271eb11a10ef992b
Signed-off-by: Pavel Kotucek <pavel.kotucek@pantheon.tech>
2018-12-07 12:24:52 +00:00
juraj.linkes
e6b58cf86a Test reader thread hardening
The test reader thread could get stuck in case an unexpected Exception
was raised during test runs in parent thread. Catch the Exception, close
the thread and raise the Exception to avoid this.

Change-Id: I3a9298d593c334d96d04b6207d604b684572a2ac
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-12-07 10:45:09 +00:00
Koren Lev
f3b7a5e47a vpp_if_stats: Fixing a bug in getting vpp interfaces indexes
Change-Id: I6290945a94b4f7878e9af94cc7daec455327482e
Signed-off-by: Koren Lev <korenlev@gmail.com>
2018-12-07 10:42:00 +00:00
jackiechen1985
9f6957d1a5 Fix VPP-1515 IPSec receive packet error in transport mode with udp encap
Change-Id: Ife66395b89e1e9f9206666e5f0fd441b3c241bb2
Signed-off-by: jackiechen1985 <xiaobo.chen@tieto.com>
2018-12-07 10:23:40 +00:00
Mohsin Kazmi
920fd77e9c vom: Fix the api type definition
Change-Id: I1e5f5a0d60745a42e6efaab3b6eb49b6b0e74e36
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-12-07 09:42:34 +00:00
Paul Vinciguerra
91afaab068 Fix L2BD arp termination Test Case
This patch is a followup to: https://gerrit.fd.io/r/#/c/16307/ which is
currently causing ubuntu1804 to complain.

See: https://logs.fd.io/production/vex-yul-rot-jenkins-1/vpp-beta-verify-master-ubuntu1804/3837/console-timestamp.log.gz
s/RuntimeError/ for details.

==============================================================================
L2BD arp termination Test Case
==============================================================================
12:02:21,850 Couldn't stat : /tmp/vpp-unittest-TestL2bdArpTerm-_h44qo/stats.sock
L2BD arp term - add 5 hosts, verify arp responses                        OK
L2BD arp term - delete 3 hosts, verify arp responses                     OK
L2BD arp term - recreate BD1, readd 3 hosts, verify arp responses        OK
L2BD arp term - 2 IP4 addrs per host                                     OK
L2BD arp term - create and update 10 IP4-mac pairs                       OK
L2BD arp/ND term - hosts with both ip4/ip6                               OK
L2BD ND term - Add and Del hosts, verify ND replies                      OK
L2BD ND term - Add and update IP+mac, verify ND replies                  OK
L2BD arp term - send garps, verify arp event reports                     OK
L2BD arp term - send duplicate garps, verify suppression                 OK
L2BD arp term - disable ip4 arp events,send garps, verify no events      OK
L2BD ND term - send NS packets verify reports                            OK
L2BD ND term - send duplicate ns, verify suppression                     OK
L2BD ND term - disable ip4 arp events,send ns, verify no events          OK

==============================================================================
TEST RESULTS:
     Scheduled tests: 14
      Executed tests: 14
        Passed tests: 14
==============================================================================

Test run was successful

Change-Id: If66f22412f8aa36b183131cd22af4b3e7a20da46
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-06 21:58:12 +00:00
juraj.linkes
f18eb86c32 Rename VPP_TEST_FAILED_DIR to FAILED_DIR
15999 renamed VPP_TEST_FAILED_DIR, but not in all files. Fix this in the
one remaining file.

Change-Id: I159cdc86bfd5dd33af74256830873a8d081f1a73
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-12-06 21:32:01 +00:00
Mohsin Kazmi
90a9fdfd3e stat_client: Fix the type casting
Change-Id: I9726ac5cc7292a492928b213bc85ccfa8a26c1cb
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-12-06 21:30:53 +00:00
juraj.linkes
68ebc83e60 Skip failing ARM testcases for CI
There are a few tests that fail on ARM and thus we can't enable testing
in CI. Skip the failing tests until they're fixed so that we catch new
failures in CI (when we enable testing for the remaining tests).

Change-Id: Ie896ef5c449ef965029633e38d317a8d5ac26352
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-12-06 20:58:35 +00:00
Paul Vinciguerra
f0cbcea428 Test framework: fix import logic for sphynx.
* Simplify conditional import. Remove global variable.
  * Fix vpp_l2 import side effect.

Change-Id: I3945cf2a0cf8844004af2cd636f92d73ddc60f93
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-06 19:22:50 +00:00
Dave Barach
10c5ff143a nsim: add packet loss simulation, docs
Change-Id: Ic9747541aad8148ebf7d520b525b99c4cc3961f3
Signed-off-by: Dave Barach <dave@barachs.net>
2018-12-06 18:28:47 +00:00
Neale Ranns
995ff06fb7 DOC-ONLY: MFIB documentation
Change-Id: I8c7277584f231dd4732a4c6013e156a5bb821f41
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-06 08:36:55 -08: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
Michal Cmarada
1f0dd7a066 Update japi to support type aliases
Change-Id: I6d6068d641d4c91e5c5b52eefb898affc5c0d2c0
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
2018-12-06 14:04:44 +00:00