aboutsummaryrefslogtreecommitdiffstats
path: root/test/framework.py
AgeCommit message (Collapse)AuthorFilesLines
2018-11-29make test: create virtualenv under /test/Klement Sekera1-3/+3
instead of using build-root, use /test/venv directory for virtualenv similarly, don't pollute build-root with test-built binaries Change-Id: I1e63c04037eaee718b27b34ef16c9eb0252afa53 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-11-26Split non-parallel testsuitejuraj.linkes1-6/+26
Split one big suite into smaller suites when not running tests in parallel. This results in all tests being executed in one iteration. Change-Id: I0d3d357a95d9cc596b606d5911a5819e8ffdeee5 Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-11-26Revert "VPP-1508 python3 tests: raw_input"Ole Trøan1-24/+19
This reverts commit 72f0004ac5f6e201cbe042593d76df6f2491d743. Reason for revert: Traceback (most recent call last): File "/home/ksekera/vpp/test/test_ipsec_ah.py", line 36, in setUpClass super(TemplateIpsecAh, cls).setUpClass() File "/home/ksekera/vpp/test/template_ipsec.py", line 105, in setUpClass super(TemplateIpsec, cls).setUpClass() File "/home/ksekera/vpp/test/framework.py", line 459, in setUpClass cls.quit() File "/home/ksekera/vpp/test/framework.py", line 475, in quit six.input("When done debugging, press ENTER to kill the " AttributeError: 'module' object has no attribute 'input' Change-Id: Idf0bbfea231730b37bae5dcb4557a0f82ab1b810 Signed-off-by: Ole Troan <ot@cisco.com>
2018-11-26Fix swapped decorators in VppTestCase.Paul Vinciguerra1-5/+5
Change-Id: I39b5a8e368f0e0b5c83203141d01f22d909b6f9d Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-26VPP-1508 python3 tests: raw_inputPaul Vinciguerra1-19/+24
Raw input does not exist in python3 use six.input. Change-Id: Ie461696ff869057bcc3969a7571602dde570f5b8 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-25make test: Fix too wide subprocess exceptionsPaul Vinciguerra1-1/+1
When a command fails, CalledProcessError is raised. testing with except: masks other failures. Change-Id: I7e3a6739411cb6a4c13e96dd123aff9159213fea Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-23Fix test framework keepalivejuraj.linkes1-2/+1
The pipe used for sending keepalive messages was being added to an instance of KeepAliveReporter and then used by the class itself. This worked in the past but doesn't anymore. Fix the issue by adding the pipe to the class instead of an instance. Change-Id: If7cdca2de23ca78448e80569b155e9e29e81ff94 Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-11-23Fix test logging propagationjuraj.linkes1-0/+1
When running tests with child processes the logs from child processes would propagate to root logger, potentially resulting in some logs being emitted twice. Fix this by disabling log propagation to parent loggers in child processes. Change-Id: I31eb265c2b7f7bceff627043956a67d6def3da2b Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-11-22Revert "Fix instance method call in test/framework.py"Ole Trøan1-6/+9
This reverts commit c32023b9fd6970ed1cac1b3c7f36233b536d9968. Change-Id: Ic934d223b10028093b0262e28515bde3ae1ccb71 Signed-off-by: Ole Troan <ot@cisco.com>
2018-11-22Fix instance method call in test/framework.pyPaul Vinciguerra1-9/+6
Instance method breaking encapsulation by calling a global fn. Change-Id: Ifde2a207951143764aed75f1b191aed0bac83704 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-19VPP-1498: test/framework.py: AttributeErrorPaul Vinciguerra1-1/+2
Traceback if .send_keep_alive is called before pipe is configured. Traceback (most recent call last): File "/vpp/test/test_span.py", line 27, in setUpClass super(TestSpan, cls).setUpClass() File "/vpp/test/framework.py", line 411, in setUpClass cls.reporter.send_keep_alive(cls, 'setUpClass') File "/vpp/test/framework.py", line 172, in send_keep_alive if self.pipe is None: File "/vpp/test/framework.py", line 160, in pipe return self._pipe AttributeError: 'KeepAliveReporter' object has no attribute '_pipe' Change-Id: I561d2748441702478a84fbb4580a4d2667d70ffd Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-16VPP-1495: Fix intermittent stat sock test failures.Paul Vinciguerra1-1/+7
Loosen polling loop while waiting for stats socket. ============================================================================== Classifier IP6 UDP proto Test Case ============================================================================== connect: No such file or directory ============================================================================== ERROR: setUpClass (test_ip4.TestIPLoadBalance) ------------------------------------------------------------------------------ Traceback (most recent call last): File "/vpp/test/framework.py", line 424, in setUpClass cls.statistics = VPPStats(socketname=cls.stats_sock) File "build/bdist.linux-x86_64/egg/vpp_papi/vpp_stats.py", line 120, in _init_ raise IOError() IOError Change-Id: I80523122f96eafc41b3ebbf27bee73f6c637d781 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-09Fix logging into multiple filesjuraj.linkes1-5/+4
When running tests in one process, only one logger was used and each testcase added its own file handler, which resulted in logs appearing in multiple files. Fix this by restoring the creation of new loggers for each testcase and only reuse the stream handler from parent process. Change-Id: I5b8471e041dc769128fddb433d33812bfcb5ecf6 Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-11-08make test: p2p ethernet refactorKlement Sekera1-1/+13
Change-Id: I48b4b3eaa84e4174e4d0305594675bf983184fa0 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-11-07GBP Endpoint LearningNeale Ranns1-1/+29
Learning GBP endpoints over vxlan-gbp tunnels Change-Id: I1db9fda5a16802d9ad8b4efd4e475614f3b21502 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-10-10Setup, teardown, DEBUG=core, FAILFAST fixesjuraj.linkes1-83/+109
- Fixed a bug when an error occuring in tearDownClass would not result in test being marked as failed - Improved test results reporting in cases when an error occurs in setUpClass and tearDownClass - Fixed DEBUG=core when the core is produced in setUpClass or tearDownClass - Reworked DEBUG=core to always be handled after all tests have been executed - Fixed FAILFAST=1 for parallel test runs Change-Id: I3e9cd3b97ba6fa802fa0aa2dd7678ff82eee09ec Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-10-10Test FW: Use unittest temp dir as unix runtime dirJakub Grajciar1-7/+8
Change-Id: I5273d5f3f59cc3c43da0a15bb0c4a4056098adcf Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-10-03ipsec: add missing ipv6 ah code & ipv6 testsKlement Sekera1-6/+18
Change-Id: I89e90193ded1beb6cb0950c15737f9467efac1c3 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-09-28stats: Split stat_segment and stats code in preparation for deprecation.Ole Troan1-1/+1
Split the stat_segment.c code from stats.c. Rename stats.[ch] to prepare for removing (19.01?) In addition stats.api can be removed. Since the stats aggregation for the stat segment does not use the API, that part is now done on the main thread. (Old stats aggregator is also left in place). Change-Id: I9867429f4fc547b1a7ab7f88bc4f3625428d681b Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-20VPP-1421: Reworked results gatheringjuraj.linkes1-9/+23
The previous version sent the whole VPPTestResult object through pipe, which uses pickle to transfer objects. Pickle does not support sending any arbitrary objects and was causing issues. Now just a tuple of (test_id, result) is sent. Change-Id: I3a3a9e6f1b9ac9b05889babfc1f7560c7ac4471c Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-09-06Fix test summary and retriesjuraj.linkes1-2/+2
There was an issue when tests crashed and weren't properly retried. Change-Id: Id5ef828ecc9a8dc0f08c50183721db06e162e6c3 Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-09-05STATS: Update Prometheus portOle Troan1-1/+1
Update temporary port allocation with fixed allocated from: https://github.com/prometheus/prometheus/wiki/Default-port-allocations Change-Id: I99a7e069fb95d00884458aeacaba06e4713fbb76 Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-02STATS: Python binding to access VPP statistics and counters.Ole Troan1-1/+5
from vpp_papi.vpp_stats import VPPStats s = VPPStats(socketname='/var/run/stats.sock') c = s.ls('/if/rx') counters = s.dump(c) print(s.set_error_str()) Change-Id: I203ebe60b0c9ee5742aadc737c0f29051757959d Signed-off-by: Ole Troan <ot@cisco.com>
2018-08-30Fix hanging test runner when child process diesjuraj.linkes1-2/+12
When fixing the test summary after a test run doesn't finish properly I introduced a bug where child process which died would leave the whole run hanging. This patch fixed the bug while still having the correct test summary. Change-Id: I206b1a7dab4032d24cbc50667b8dd0bdcebb67a6 Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-08-25Fix logging to file and summary for crashed testsjuraj.linkes1-0/+2
Logging was not being logged to log.txt Crashed tests were not reported properly when running tests in one process Change-Id: Ica2d703d88351cc8a94bad86764ae4376dc79590 Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-08-23CSIT-1139: Implement parallel test executionjuraj.linkes1-132/+72
The implementation of parallel test execution in VPP Test Framework. - VPPTestCase test methods are grouped together - tests are running in separate processes - VPP instances spawned by tests are assigned to different cores - output from these processes is redirected through pipes and printed out testcase by testcase - TEST_JOBS env var is used to specify the number of parallel processes - improved test summary - a bit of code cleanup Change-Id: I9ca93904d9fe2c3daf980500c64a8611838ae28c Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-07-24Create a unit-test pluginDave Barach1-1/+2
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>
2018-07-24test frame work pump thread exit: set flag then wakeNeale Ranns1-2/+2
Change-Id: Id95b8a7ad1bf550f615c50d77b16a530cc8fc2c4 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-09IGMP improvementsNeale Ranns1-2/+3
- Enable/Disable an interface for IGMP - improve logging - refactor common code - no orphaned timers - IGMP state changes in main thread only - Large groups split over multiple state-change reports - SSM range configuration API. - more tests Change-Id: If5674f1044e7e97274a711f47807c9ba689d7b9a Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-06-25make test: fix RETRIES when setUpClass throwsKlement Sekera1-1/+21
This change adds handling of special case when setUpClass throws. In this case TestResults receives a mock object called _ErrorHolder. By parsing its description, we find test class name and use it to lookup the test class in test suite to be able to add it to the list of failures for re-running. Change-Id: I656f21e38aa450fc567cdcbcf6e586967f947a64 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-24Revert "Revert "make test: fix broken interfaces""Klement Sekera1-6/+4
This reverts commit c8efa29b6f9a91381897b54f1147daf922ed7164. Change-Id: I1d5c5773d5f86a63073e255336bd9de628e26179 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-24Revert "Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums""Klement Sekera1-5/+14
This reverts commit e0d2bd6bd7fc59c0c6ac48195d7f825dc99bfd91. Change-Id: If491e16f9ea66b2493a6a7c7f3c684ed585f8f51 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-22Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums"Ole Troan1-14/+5
This reverts commit a98346f664aae148d26a8e158008b773d73db96f. Change-Id: Iee5b3a5ddff0e8fd3a30fe5973cee24de434fe12 Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-22Revert "make test: fix broken interfaces"Ole Troan1-4/+6
This reverts commit d5c60b96a3fd93916fc4af5c8d6d25625c28242e. Change-Id: I3632b9c3f76c615aee897f28f76d094e7031e689 Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-22make test: fix broken interfacesKlement Sekera1-6/+4
Change-Id: I2e092774f81503e04b53cc6c6b5d357fe3fc52ab Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-21ipsec: VPP-1316 calculate IP/TCP/UDP inner checksumsKlement Sekera1-5/+14
Calculate IP/TCP/UDP checksums in software before adding authentication. Change-Id: I3e121cb00aeba667764f39ade8d62170f18f8b6b Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-05-16make test: unify packet checksum verificationsKlement Sekera1-0/+85
Change-Id: If9cc7c5e32ebecff398fd38b39e8f485754a4ad4 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-04-17Add logging supportDamjan Marion1-0/+1
Change-Id: Ieac9cf50156dbbb4962411e900d59256441915ef Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-24make test: fix DEBUG=gdb/gdbserver optionsKlement Sekera1-4/+3
Change-Id: I5a7fa3b1c247ad5611907db27835724dcd31f575 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-23make test: code cleanupKlement Sekera1-49/+25
Change-Id: Ic689de569e5b6e6209d16d6acdb13c489daca1f5 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-21reassembly: feature/concurrencyKlement Sekera1-0/+4
This change makes ip reassembly an interface feature, while adding concurrency support. Due to this, punt is no longer needed to test reassembly. Change-Id: I467669514ec33283ce935be0f1dd08f07684f0c7 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-14make test: early core detection, code cleanupKlement Sekera1-8/+5
Change-Id: I503d69f902f1c8d3107fb3f2b9f31b0083ebb747 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-27make test: refactor vcl test casesDave Wallace1-2/+3
- Reduce replicated code in test cases - Configure separate namespace secrets for thru hoststack test case to validate namespace secret functionality. - Pass per-instance environment variables to Worker class init function. Change-Id: I3cd5d4538f105cbfb09671c4d761541b40714b8f Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-22make test: tidy worker subprocess outputKlement Sekera1-1/+1
Change-Id: I362765a67762a59775863af12b712abb47445b3a Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-19make test: Add VPP VCL cut-thru test.Dave Wallace1-0/+2
Change-Id: Id3ec196bfeb90b141123adee97f15d9712351680 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-17make test: add test framework debuggingKlement Sekera1-0/+9
New option TEST_DEBUG=1 turns on test framework debugging, which currently consists of printing difference in allocated objects/memory and also creates reference graphs for any unfreed VppPapiProvider/VPP objects - these take a lot of memory and thus should be freed regularly. Change-Id: I29db0c1341009d4b5c5df9222d14f3095883fd0f Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-14make-test: use api custom-dump to reduce log size.Dave Wallace1-1/+1
- Reduce log size by using "api trace custom-dump" instead of "api trace dump". - Fix custom-dump output of cli_inband_t api message to include cli command being executed. New output: DBGvpp# api trace custom-dump /tmp/test vl_api_memclnt_delete_t: index: 2 handle: 0x301d8e10 SCRIPT: memclnt_create name vpp_api_test SCRIPT: sw_interface_dump all SCRIPT: control_ping SCRIPT: exec show run Old output: DBGvpp# api trace dump /tmp/test ---------- trace 0 ----------- vl_api_memclnt_delete_t: index: 33554432 handle: 0x108e1d3000000000 ---------- trace 1 ----------- vl_api_memclnt_create_t: name: vpp_api_test input_queue: 0x808e1d3000000000 context: 0 ctx_quota: 0 ---------- trace 2 ----------- vl_api_sw_interface_dump_t: _vl_msg_id: 61 client_index: 33554432 context: 0 name_filter_valid: 0 ---------- trace 3 ----------- vl_api_control_ping_t: _vl_msg_id: 712 client_index: 33554432 context: 0 ---------- trace 4 ----------- vl_api_cli_inband_t: _vl_msg_id: 715 client_index: 33554432 context: 0 length: 9 Change-Id: If740c861649a3a59b8cc7a777c23c3cf94b8ff87 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-02make test: use random seedKlement Sekera1-1/+1
This fixes a constant setting of random seed forgotten from testing. Change-Id: Ie3c4db8bb2b4b73ba33de1ffc02cb563391fd31c Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-01IPv4/6 reassemblyKlement Sekera1-7/+15
Change-Id: Ic5dcadd13c88b8a5e7896dab82404509c081614a Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-01-09test: consolidate the multiple versions of send_and_*Neale Ranns1-0/+19
Change-Id: I7fa7d0ebf73dab8264a2e5ddbd412600d78ead05 Signed-off-by: Neale Ranns <nranns@cisco.com>