summaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest
AgeCommit message (Collapse)AuthorFilesLines
2019-04-02vppinfra: fix sparse_vec_index() returning non-zero index for some ↵Andrew Yourtchenko2-0/+74
nonexistent elements If we are testing for an index whose membership bitmask happens to sit in LSB of uword, and there is nothing else set in that uword in the member bitmask, the shortcut path returning the valid index is taken even if the element with a given index doesn't exist in the sparse vector. This happens because the count of leading zeroes on the value of 0 is zero, which is equal to the value taken modulo bitsize uword. Take care of that case. Also add unittests showing the problem and verifying that sparse_vec_index2 does not have the same issue. Change-Id: I19117e13817c3e5de579b9250bb741de42491985 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-03-28crypto: add vnet_crypto_op_init (...)Damjan Marion1-1/+1
Change-Id: I2018d8367bb010e1ab30d9c7c23d9501fc38a2e5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-03-28Punt InfraNeale Ranns2-0/+403
A punt/exception path that provides: 1) clients that use the infra 2) clients can create punt reasons 3) clients can register to recieve packets that are punted for a given reason to be sent to the desired node. 4) nodes which punt packets fill in the {reason,protocol} of the buffere (in the meta-data) and send to the new node "punt-dispatch" 5) punt-dispatch sends packets to the registered nodes or drops Change-Id: Ia4f144337f1387cbe585b4f375d0842aefffcde5 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra2-3/+3
Change-Id: I53ab8d17914e6563110354e4052109ac02bf8f3b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-22crypto: implement rfc4231 test casesFilip Tehlar4-2/+422
Change-Id: I540241672a20f687d20bb70adbf2b33200f34167 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-22ADJ: more thorough link up checkNeale Ranns1-0/+3
Change-Id: I04dbfb914706b25fcc3bd6ee0d19cfdc810234ae Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-22tcp: improve handling of snd_nxtFlorin Coras1-2/+2
- avoid changing snd_nxt when doing fast retransmits - use snd_una_max only to keep track of the max seq number sent - simplify future ack testing Change-Id: I3580ad3aefe30128486c3375d0ac3f3f62c04c5e Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-22IPSEC: test for packet drop on sequence number wrapNeale Ranns2-0/+76
Change-Id: Id546c56a4904d13d4278055f3c5a5e4548e2efd0 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-20tests: implement crypto tests per RFC2202Filip Tehlar4-85/+416
Change-Id: I18b30d5ee8aa60c34d52b7716b5feb7225cb0d59 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-19crypto: introduce crypto infraDamjan Marion6-0/+661
Change-Id: Ibf320b3e7b054b686f3af9a55afd5d5bda9b1048 Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-14TEST: link-state up/down notifications on FIB forwardingNeale Ranns2-0/+76
Change-Id: I478c4e5feb9603b7443efdf2967f98f9bde7ea0f Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-13VPP-1576: fix a set of coverity warningsDave Barach1-0/+3
Change-Id: Ifd34aed8692d5acaa370d4976d974ac573e43705 Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-12svm mq: add unit testFlorin Coras1-0/+179
Change-Id: I2f1fa15a99163b9c105707484503dc9502265c52 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-02session: cleanup/rename functionsFlorin Coras1-1/+1
- remove unused functions - rename old "stream" functions Change-Id: Icbb03daa9f9f1c58b5be5c38aa8a9cbcf9159b47 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-27string_test: The dark side of coveritySteven Luong1-4/+0
Me: "Mr Coverity, I thought I fixed the dead code warning just few days ago in this file. Why are you still complaining about the same stuff to me?" Mr. Coverity: "Duh! But you are supposed to fix all occurences in the same file." Me: "Mr. Coverity, I didn't see you flag the warning in the other places last time?" Mr. Coverity: "Shh! That is the secret of my dark side!" Change-Id: I565eccd90bf1bb39c9881664d361f83396ca8bcc Signed-off-by: Steven Luong <sluong@cisco.com>
2019-02-21string_test: Coverity woeSteven Luong1-2/+0
Coverity complains about dead code as shown below and it is right. The fix is to simply remove the dead code. 503 if (v_indicator != indicator) CID 190173 (#3 of 3): Logically dead code (DEADCODE) dead_error_line: Execution cannot reach this statement: return -1;. 504 return -1; Change-Id: Ibca9e10451a4459db099bef5ecc6939474bdb903 Signed-off-by: Steven Luong <sluong@cisco.com>
2019-02-19VPP-1568:when entry src cover change, recursive-loop fib still can not work.mu.duojiao1-0/+75
Change-Id: I90762b59f94175f278380c95776471a30bc94d34 Signed-off-by: mu.duojiao <mu.duojiao@zte.com.cn>
2019-02-18session: move fifo allocation logic to app workerFlorin Coras1-1/+1
Change-Id: I1662ec4b5503cb64a8a86a2441842311d959b3a6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-11session: cleanup application interfaceFlorin Coras1-36/+21
Change-Id: I89d240753b3f3c5e984aa303a7c8fa35fa59bf7f Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-09session: refactor listen logicFlorin Coras2-22/+24
Make app-listener the handle for app listens. Consequently transport and local listen sessions are now associated to the app-listener. Change-Id: I9397a26d42cccb100970b6b4794c15bac2e11465 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-04session: cleanup part 1Florin Coras2-10/+10
Rename core data structures. This will break compatibility for out of tree builtin apps. - stream_session_t to session_t - server_rx/tx_fifo to rx/tx_fifo - stream_session.h to session_types.h - update copyright Change-Id: I414097c6e28bcbea866fbf13b8773c7db3f49325 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-18Fix GCC 8 compiler warnings on strncpy's truncated copy on debian distroSteven Luong1-0/+12
For some reason, GCC 8 in debian is pickier than GCC 8 in ubuntu. It complains about things in strncpy like this /home/sluong/vpp/src/vlib/linux/pci.c:485:7: error: ‘strncpy’ output may be truncated copying 15 bytes from a string of length 255 [-Werror=stringop-truncation] strncpy (ifr.ifr_name, e->d_name, sizeof (ifr.ifr_name) - 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/sluong/vpp/src/vlib/linux/pci.c: At top level: It also complains similar things in string_test.c The fix in pci.c is to convert strncpy to use clib_strncpy The fix in string_test.c is condiational compile the complained code for GCC 8. Change-Id: Ic9341ca54ed7407210502197a28283bc42c26662 Signed-off-by: Steven Luong <sluong@cisco.com>
2019-01-12session: generate wrong thread errors instead of crashingFlorin Coras1-1/+2
Change-Id: I7e59ae718d2722c49d42b22a0874e1645a191e89 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-10strncpy_s_inline copies more bytes than necessarySteven1-1/+10
Given n equals to the maximum number of bytes to copy from src in the API, or the rough estimate strlen of src, strncpy_s_inline should not copy more than the number of bytes, computed by strlen(src), to dst if n is greater than strlen(src). The number of bytes to copy is computed by strnlen(src,n), not n. Change-Id: I088b46125d9776962750e121f1fbf441952efc2b Signed-off-by: Steven <sluong@cisco.com>
2019-01-07string_test: coverity woeSteven1-6/+0
Remove the needless tests and checks which coverity complains about in string_test.c Change-Id: I971650cada77136f06528a65625ef99bd3d7e915 Signed-off-by: Steven <sluong@cisco.com>
2019-01-02Fixes for buliding for 32bit targets:David Johnson1-2/+2
* u32/u64/uword mismatches * pointer-to-int fixes * printf formatting issues * issues with incorrect "ULL" and related suffixes * structure alignment and padding issues Change-Id: I70b989007758755fe8211c074f651150680f60b4 Signed-off-by: David Johnson <davijoh3@cisco.com>
2018-12-28session: free session after transport and app confirmFlorin Coras2-3/+3
In addition to that, a bit of refactoring. Change-Id: Iea1eabc2167bcdef185ec53bc09bae087c5398e6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-18MFIB: recurse resolution through an MFIB entryNeale Ranns1-22/+467
Change-Id: I8dc261e40b8398c5c8ab6bb69ecebbd0176055d9 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-16IP6-MFIB: replace the radix tree with bihash (VPP-1526)Neale Ranns1-15/+16
Change-Id: I7a48890c075826fbd8c75436dfdc5ffff230a693 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-14Revert gerrit 16429 to fix a Debian build-breakDave Barach1-22/+44
Change-Id: I9382bc981c25a29c293f7ddc6ed3d34130678696 Signed-off-by: Dave Barach <dave@barachs.net>
2018-12-14Fix compiling issue with GCC-8.x in string test functionsLijian.Zhang1-44/+22
Same pointer is passed to two or more restrict-qualified parameters of a function. vpp/src/plugins/unittest/string_test.c: In function ‘test_strcpy_s’: vpp/src/plugins/unittest/string_test.c:562:19: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict] err = strcpy_s (dst, s1size, dst); ^~~ ~~~ Change-Id: Ica06b457bbcbf2d552eec380976c37f9fd447b1c Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com> Reviewed-by: Sirshak Das <sirdas@arm.com>
2018-12-05Fix gcc-8 compile issues in string_test.cDave Barach1-1/+35
gcc-8 flunks a certain number of tests at compile time, so conditionally disable (negative) tests which won't even compile. Change-Id: Id7e85f38bc371623972efa6e2c8f9ee4717f5ff5 Signed-off-by: Dave Barach <dave@barachs.net>
2018-12-03move [m]fib and BIER tests to unittest pluginNeale Ranns4-0/+13050
Change-Id: I9d2f52e756363df011026773bfffa838a557313f Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-02vppinfra: c11 safe string functionsSteven1-25/+1559
Add memcmp_s, strcmp_s, strncmp_s, strcpy_s, strncpy_s, strcat_s, strncat_s, strtok_s, strnlen_s, and strstr_s C11 safe string API. For migrating extant unsafe API, add also the corresponding macro version of each safe API, clib_memcmp, clib_strcmp, etc. In general, the benefits of the safe string APIs are to provide null pointer checks, add additional argument to specify the string length of the passed string rather than relying on the null terminated character, and src/dest overlap checking for the the string copy operations. The macro version of the API takes the same number of arguments as the unsafe API to provide easy migration. However, it does not usually provide the full aformentioned benefits. In some cases, it is necessary to move to the safe API rather than using the macro in order to avoid some unpredictable problems such as accessing memory beyond what it is intended due to the lack of the passed string length. dbarach: add a "make test" vector, and a doxygen file header cookie. Change-Id: I5cd79b8928dcf76a79bf3f0b8cbc1a8f24942f4c Signed-off-by: Steven <sluong@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-30session: segment handle in accept/connect notificationsFlorin Coras1-2/+2
Change-Id: I03884b6cde9d4c38ae13d1994fd8d37d44016ef0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-21session: cleanup use of api_client_indexFlorin Coras1-2/+2
Change-Id: I8a680be62ab91d2ccb144641981a635506973a49 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-18vcl/session: apps with process workersFlorin Coras1-0/+5
Allow apps to register child processes as app workers. In particular, on fork vcl now registers the child process with vpp as a new worker. Change-Id: I52a65fbc3292962b1f6e1fe0f6153f739e6e0d4a Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-15session: fix endpt cfg test (VPP-1492)Florin Coras1-3/+11
Change-Id: I0f2266c4727a96b6410a3084dc079bae7bc649ab Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach1-2/+2
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-31session: add wrk contextFlorin Coras1-5/+5
Change-Id: I66ca0ddea872948507d078e405eb90f9f3a0e897 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-28session: move test to unittest pluginFlorin Coras2-2/+1759
Change-Id: I4921054b4e42bac3442d399681b21b613ce8b681 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-23c11 safe string handling supportDave Barach3-8/+154
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-21tcp: count first lost hole (VPP-1465)Florin Coras1-3/+29
Change-Id: I3ac136e2a10796d8fa86ddb6f0d6cabe5fa749f8 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-18tcp: fix sacks lost bytes counting (VPP-1465)Florin Coras1-34/+90
Change-Id: Ie46b3a81de4ed39b7b40e3879436f7e5a2908d98 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-18tls: fix connection failures/interrupts at scale (VPP-1464)Florin Coras1-2/+3
Change-Id: I0bc4062c1fd3202ee201acb36a2bb14fc6ee1543 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-17tcp: avoid sack processing when not needed (VPP-1460)Florin Coras1-1/+1
Change-Id: If81ee34e1f1e929de1a5b758ddb9aede4002e858 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-12fix bihash test codeDave Barach1-0/+7
Change-Id: Ie71b99385c33122cbf55f80ebabdc2ccdb4cf2ae Signed-off-by: Dave Barach <dave@barachs.net>
2018-08-25cmake: improve add_vpp_plugin macroDamjan Marion1-1/+2
Change-Id: Iffd5c45ab242a919592a1f686f7f880936b68a1a Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-0/+18
Change-Id: Ibc59323e849810531dd0963e85493efad3b86857 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-24Create a unit-test pluginDave Barach4-0/+2360
Move the tcp unit test to the plugin Add a bihash unit test and a "make test" program to call it Adjust framework.py to load the plugin, which is disabled by default Change-Id: Ic229d386a56a9d28dbd54974f231149053ca8f93 Signed-off-by: Dave Barach <dave@barachs.net>