aboutsummaryrefslogtreecommitdiffstats
path: root/test/sanity_run_vpp.py
blob: 4b21de12dfed2419bb7053b704462b4fad5a942b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3

from __future__ import print_function
from multiprocessing import Pipe
import sys
import os
from framework import VppDiedError, VppTestCase, KeepAliveReporter


class SanityTestCase(VppTestCase):
    """ Sanity test case - verify whether VPP is able to start """
    cpus = [0]

    # don't ask to debug SanityTestCase
    @classmethod
    def wait_for_enter(cls, pid=0):
        pass

    @classmethod
    def _debug_quit(cls):
        try:
            cls.vpp.poll()
        except AttributeError:
            pass


if __name__ == '__main__':
    rc = 0
    tc = SanityTestCase
    x, y = Pipe()
    reporter = KeepAliveReporter()
    reporter.pipe = y
    try:
        tc.setUpClass()
    except VppDiedError:
        rc = -1
    else:
        try:
            tc.tearDownClass()
        except Exception:
            rc = -1
    x.close()
    y.close()

    if rc == 0:
        print('Sanity test case passed.')
    else:
        print('Sanity test case failed.')

    sys.exit(rc)
* Typedef for a client handle */ typedef int vlib_punt_hdl_t; /** * @brief Register a new clinet * * @param who - The name of the client * * @retrun the handle the punt infra allocated for this client that must * be used when the client wishes to use the infra */ vlib_punt_hdl_t vlib_punt_client_register (const char *who); typedef void (*punt_interested_listener_t) (vlib_enable_or_disable_t i, void *data); /** * Allocate a new punt reason * @param fn - A callback to invoke when an entity becomes [un]interested * in the punt code. * @param data - To be passed in the callback function. */ extern int vlib_punt_reason_alloc (vlib_punt_hdl_t client, const char *reason_name, punt_interested_listener_t fn, void *data, vlib_punt_reason_t * reason); /** * Validate that a punt reason is assigned */ extern int vlib_punt_reason_validate (vlib_punt_reason_t reason); /** * @brief Register a node to receive particular punted buffers * * @paran client - The registered client registering for the packets * @param reason - The reason the packet was punted * @param node - The node to which the punted packets will be sent */ extern int vlib_punt_register (vlib_punt_hdl_t client, vlib_punt_reason_t reason, const char *node); extern int vlib_punt_unregister (vlib_punt_hdl_t client, vlib_punt_reason_t pr, const char *node); /** * FOR USE IN THE DP ONLY * * Arc[s] to follow for each reason */ extern u16 **punt_dp_db; /** * FOR USE IN THE DP ONLY * * Per-reason counters */ extern vlib_combined_counter_main_t punt_counters; #endif /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */