summaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest
AgeCommit message (Collapse)AuthorFilesLines
2021-03-14ip: extend punt CLI for exception packetsMohammed Hawari1-6/+7
Change-Id: I20e48a5ac8068eccb8d998346d35227c4802bb68 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: feature
2021-02-26ipsec: move the IPSec SA pool out of ipsec_mainNeale Ranns1-2/+1
Type: refactor this allows the ipsec_sa_get funtion to be moved from ipsec.h to ipsec_sa.h where it belongs. Also use ipsec_sa_get throughout the code base. Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I2dce726c4f7052b5507dd8dcfead0ed5604357df
2021-02-18tests: policer test check unformat return valuesBrian Russell1-4/+6
Keep coverity happy by checking the return value of unformat calls. Type: test Signed-off-by: Brian Russell <brian@graphiant.com> Change-Id: Iccd0296da527d079f79cc7bd8b57af1b524299bd
2021-02-15ip: Path MTUNeale Ranns1-4/+26
Type: feature Support setting the MTU for a peer on an interface. The minimum value of the path and interface MTU is used at forwarding time. the path MTU is specified for a given peer, by address and table-ID. In the forwarding plane the MTU is enfored either: 1 - if the peer is attached, then the MTU is set on the peer's adjacency 2 - if the peer is not attached, it is remote, then a DPO is added to the peer's FIB entry to perform the necessary fragmentation. Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I8b9ea6a07868b50e97e2561f18d9335407dea7ae
2021-02-15policer: improve policer structBrian Russell1-1/+1
Ensure policer struct is cache aligned and fits in one cache line. Give it a simpler name to reflect its job as the representation of a policer. Type: improvement Signed-off-by: Brian Russell <brian@graphiant.com> Change-Id: If1ae4931c818b86eee20306e503f4e5d6b84bd0d
2021-02-10tests: add policer test helperBrian Russell2-0/+72
Add a helper CLI to exercise a policer pre-configured by the test harness. The test harness will check the stats afterwards. Type: test Signed-off-by: Brian Russell <brian@graphiant.com> Change-Id: I913dda4a9f8179c1c6b3061a68164bf1e698a392
2021-02-05session svm: non blocking mqFlorin Coras1-8/+3
Avoid synchronizing producers and the consumer. Instead, only use mutex or spinlock (if eventfds are configured) to synchronize producers. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie2aafbdc2e07fced5d5e46ee2df6b30a186faa2f
2021-02-04vlib: increase the stats epoch only when necessaryMiklos Tirpak2-0/+263
When the counter vectors are validated and they are already long enough to fit the given index in memory, there is no need to increase the stats segment epoch. In this case, the counter vectors do not change as a result of the validation. This optimization is necessary for the case when the configuration is changed at multiple thousands per second rate. The counter vectors grow at the beginning and their size stabilizes after a while. Without this improvement, it can still take several seconds for a stats reader to succeed. Type: improvement Signed-off-by: Miklos Tirpak <miklos.tirpak@gmail.com> Change-Id: I5a6c30255832716a1460018d0bd0f63031de102b
2021-02-01fib: Changes to interpose sourceNeale Ranns1-3/+149
Type: improvement 1) stack the interpose on any path-extensions (e.g. labels) from the next best source 2) allow more than 1 source to contribute a DPO for a given prefix Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Idc2fbb36cfbd2387081765d8af0f1fbe61612160
2021-01-25svm: add custom q implementation for mqFlorin Coras1-3/+2
Add separate queue implementation for the message queue as it's custom tailored for fifo segments as opposed to binary api. Also move eventfds to the private data structures. Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6df0c824ecd94c7904516373f92a9fffc6b04736
2020-12-30svm: fifo segment sptr for fifo hdr free listFlorin Coras1-3/+3
With this there are no more pointers in data structures allocated on fifo segments. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibe584b7b6809fa360a105974655a91674db69ab6
2020-12-29svm: allow mq attachments at random offsetsFlorin Coras1-11/+14
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic373cd2c11272da539eb4b0db27227f36f2f9688
2020-12-26svm: change fifo pointers to offsetsFlorin Coras2-11/+12
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I113a630d6db4741f54e508f7e0ed77be139df0e4
2020-12-24svm: split fifo into private and shared structsFlorin Coras3-50/+50
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id8e77e8b2623be719fd43a95e181eaa5b7df2b6e
2020-12-23vppinfra: mem bulk testFlorin Coras2-0/+146
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Icd44ede9604c29839af250a2be93ecf467467aa0
2020-12-23svm: separate private from shared fifo segment ptrsFlorin Coras1-6/+13
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idcc8d862b98dba4a67f829c1778377f35ad47b00
2020-12-23svm: remove fifo segment heapFlorin Coras2-21/+16
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I518e096fe13847759806ff62009e73fd8f7451b7
2020-12-11fib: Remove unused BIER variablesNeale Ranns1-3/+0
Type: refactor Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Change-Id: Idf17c3c02fb77fcadf69a9164abd4da35289aaed
2020-12-08fib: Source Address SelectionNeale Ranns1-6/+8
Type: feature Use the FIB to provide SAS (in so far as it is today) - Use the glean adjacency as the record of the connected prefixes = there's a glean per-{interface, protocol, connected-prefix} - Keep the glean up to date with whatever the recieve host prefix is (since it can change) Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Change-Id: I0f3dd1edb1f3fc965af1c7c586709028eb9cdeac
2020-11-09session: remove support for shm bapi attachmentFlorin Coras1-2/+0
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I21bda0c46406aff54ad8fe5e44491e8e332de170
2020-10-29session: fix ct cleanup before full establishementFlorin Coras1-2/+26
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I58fb0e05f62eae45818c23e8e148ff6758ba463a
2020-10-26tcp: byte tracker fixRyujiro Shibuya1-0/+215
Type: fix Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: If7e22978a6b65f5b68ccb2bd97b5e0fba167b3bf
2020-10-23tcp: remove snd_una_maxFlorin Coras1-8/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I03f923053499f219035c9b7b6640fc575568d474
2020-10-21svm: fix fifo unit testBenoît Ganne1-4/+6
- fix fifo initialization overflowing chunk size - stick to the default base virtual address to initialize fifo. ASAN can be picky about address space Type: fix Change-Id: If9a29138d2c207859d72845e928290c808c4a982 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-22lisp: Move to pluginNeale Ranns2-1433/+0
Type: refactor Change-Id: I54df533a8f863c4e49742903cf2457f18b4fc506 Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-09-09tcp: fix the tcp unittest to workRyujiro Shibuya1-0/+2
Type: fix Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: If5a8313262da828616db8b1d9ef831d42b11d952
2020-09-08svm session: document unsupported fifo deq combinationsFlorin Coras1-5/+21
Type: fix - Document that ooo dequeues with ooo lookups cannot be done in combination with in order dequeues. - Added assert to capture this scenario and de-initialized rbtrees for cut-through tx fifo Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic40d020b3f0391fcf022ea3c906b86121744144f
2020-09-01crypto-openssl: add chacha20-poly1305 to crypto-opensslArtem Glazychev2-0/+158
Type: feature Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Change-Id: Iec28fb11b6edff1bee23117f56aa3a3e5729541a Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-08-20tcp: track reorder with sacksFlorin Coras1-1/+5
Type: feature Change-Id: I041bff2e8d589c171661de286fa1503531dff891 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-08-06misc: harmonize namesDave Barach5-100/+101
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ibad744788e200ce012ad88ff59c2c34920742454
2020-08-03unittest: add clib_count_equal_u8/16/32/64 testsBenoît Ganne1-4/+100
Type: test Change-Id: I490c1b1a2fa49badda038e6be014c77b9bee6c56 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-19unittest: keep ASAN happy for non-terminated string testsBenoît Ganne1-0/+2
Type: fix Change-Id: Iae9e84d4297acd54c909d3a8a39adafcd86b0a91 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-07-13session: reduce verbosity on fifo alloc failureFlorin Coras1-3/+14
Also fix session test app name registrations Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7d365154ab9af83b17b026762ab4f0aea85ce486
2020-05-25tcp: fix sack block validation on wrapFlorin Coras1-0/+26
Type: fix Fixes: 487507f Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia9813ae09d14111dc8edac0fa6ab082e13ab6e2e
2020-05-19vppinfra: refactor mpcap.hDave Barach1-1/+1
vppinfra source files MUST NOT #include <vlib/vlib.h>, <vnet/vnet.h> or similar. Move mpcap_add_packet(...), mpcap_add_buffer(...) to a new file: src/vnet/mpcap.h. Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Id517aef6fe49b618f853ce32940b91ba45a1e60d
2020-05-04session: add option to preallocate fifo headersFlorin Coras1-1/+57
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie47546ef36590b90ed481b14cf812afbecf7981c
2020-05-04misc: binary api fuzz test fixesDave Barach2-0/+188
Add a hook to src/vlibapi/api_shared.c to fuzz (screw up) binary API messages, e.g. by xoring random data into them before processing. We specifically exempt client connection messages, and inband debug CLI messages. We step over msg_id, client index, client context, and sw_if_index. Otherwise, "make test" vectors fail too rapidly to learn anything. The goal is to reduce the number of crashes caused to zero. We're fairly close with this patch. Add vl_msg_api_max_length(void *mp), which returns the maximum plausible length for a binary API message. Use it to hardern vl_api_from_api_to_new_vec(...) which takes an additional argument - message pointer - so it can verify that astr->length is sane. If it's not sane, return a u8 *vector of the form "insane astr->length nnnn\0". Verify array lengths in vl_api_dhcp6_send_client_message_t_handler(...) and vl_api_dhcp6_pd_send_client_message_t_handler(...). Add a fairly effective binary API fuzz hook to the unittest plugin, and modify the "make test" framework.py to pass "api-fuzz { on|off }" to enable API fuzzing: "make API_FUZZ=on TEST=xxx test-debug" or similar Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I0157267652a163c01553d5267620f719cc6c3bde
2020-04-28vppinfra: improve test coverageDave Barach2-0/+77
Bonus corner-case bugfix in bitmap.h, found during the exercise. Issue dates from 2001 or thereabouts. Please review this specific change carefully. lcov_post: filter system include directories and generated files in build-root Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Iaa0b63e9dc571dfe3d992197ac49ba4d93403c61
2020-04-22svm: asan: fix asan supportBenoît Ganne1-2/+2
- restrict the unittests SVM address space to what is supported by ASan - mark SVM mmap()ed address space accessible for ASan - SVM shared memory heap scheme means some allocation can happen outside the current process. Lazily mark those accessible for ASan Type: fix Change-Id: I7c196c80b2a5297651d0afa54f1a8e478fcf59b1 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-20svm: check if fifo free list index is valid on allocFlorin Coras1-12/+29
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Benoît Ganne <bganne@cisco.com> Change-Id: Ib85c2f01dc7ec9858f2f88b89e209f989d78c5d9
2020-04-06session udp: shared local endpointsFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie7102355b95eefb233ec7d146e61819051a7bf07
2020-04-04misc: strcpy be goneDave Barach1-1/+1
Causes static analysis "vulnerability" warnings Type: fix Ticket: VPP-1837 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I272fa69251d70f62178e6dff0423c16f99937af1
2020-04-03session: improve error reportingFlorin Coras2-11/+8
Type: improvement Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-04-02tcp: move features to separate filesFlorin Coras1-0/+1
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia477b8dba9266f47907967e363c11048e5cd95ab
2020-03-17fib: Always install all routers mcast addressesNeale Ranns2-5/+5
Type: improvement Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ia8dff15855a81cf29729bdaa3ff28fbe3254fa97
2020-03-17svm: fifo testRyujiro Shibuya1-0/+66
Type: feature Adding a very simple test case just to confirm that setting fifo size same as the current in-use size would result no space to enqueue, which is zero-window in the TCP. Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: I6d60449386eaa270f801d2046cc7e546f843bf34
2020-03-17ip: ip_address_t uses ip46_address_tNeale Ranns1-16/+16
Type: improvement type re-use. Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ic2a2e6babf9ae66a1e53aec53a6cd157e1893dc8
2020-03-12vppinfra: refactor clib_timebase_tDave Barach1-1/+3
Add a clib_time_t * argument to clib_timebase_init(...), to encourage client code to share the vlib_main_t's clib_time_t object. Display the current day / date in GMT via the "show time" debug CLI. Fix the test framework so it processes the new "show time" output format. Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I5e52d57eb164b7cdb6355362d520df6928491711
2020-02-29svm: fix slice locking on fifo allocFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1fef115ffc2277ad6e0673b49be137147808891c
2020-02-26svm: support multi-chunk fifo chunk allocFlorin Coras1-4/+4
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id601cd241a2d124d3189057edab4299ffde7ee32