aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/message_queue.c
AgeCommit message (Expand)AuthorFilesLines
2019-12-30svm: broadcast on raw dequeues and full ringsFlorin Coras1-0/+6
2019-12-11session: Add mq debug cliNathan Skrzypczak1-0/+14
2019-09-20session: fix msg freeing on errorNathan Skrzypczak1-5/+0
2019-07-29session: fix vpp to app msg generationFlorin Coras1-2/+4
2019-06-18session: fix memory out of bound issueLijian.Zhang1-1/+1
2018-10-19vppinfra: add atomic macros for __sync builtinsSirshak Das1-3/+3
2018-09-12vcl: improve read and fifo event handlingFlorin Coras1-2/+2
2018-08-10vcl: support for eventfd mq signalingFlorin Coras1-0/+33
2018-08-03svm: add support for eventfd signaling to queueFlorin Coras1-7/+9
2018-07-27vcl: use events for epoll/select/read/writeFlorin Coras1-11/+11
2018-07-18svm: make message queue more compactFlorin Coras1-16/+29
2018-07-17session: send ctrl msg over mqFlorin Coras1-1/+2
2018-07-17session: use msg queue for eventsFlorin Coras1-18/+84
2018-07-08session/svm: fix coverity warningsFlorin Coras1-2/+5
2018-07-06svm: add unidirectional message queueFlorin Coras1-0/+159
* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/usr/bin/env python

import unittest
from vppapigen import VPPAPI, Option, ParseError

# TODO
# - test parsing of options, typedefs, enums, defines, CRC
# - test JSON, C output


class TestVersion(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.parser = VPPAPI()

    def test_version(self):
        version_string = 'option version = "1.0.0";'
        r = self.parser.parse_string(version_string)
        self.assertTrue(isinstance(r[0], Option))


class TestTypedef(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.parser = VPPAPI()

    def test_duplicatetype(self):
        test_string = '''
        typeonly define foo1 { u8 dummy; };
        typeonly define foo1 { u8 dummy; };
        '''
        self.assertRaises(KeyError, self.parser.parse_string, test_string)


class TestDefine(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.parser = VPPAPI()

    def test_unknowntype(self):
        test_string = 'define foo { foobar foo;};'
        self.assertRaises(ParseError, self.parser.parse_string, test_string)
        test_string = 'define { u8 foo;};'
        self.assertRaises(ParseError, self.parser.parse_string, test_string)

    def test_flags(self):
        test_string = '''
          manual_print dont_trace manual_endian define foo { u8 foo; };
        '''
        r = self.parser.parse_string(test_string)
        self.assertIsNotNone(r)
        s = self.parser.process(r)
        self.assertIsNotNone(s)
        for d in s['defines']:
            self.assertTrue(d.dont_trace)
            self.assertTrue(d.manual_endian)
            self.assertTrue(d.manual_print)
            self.assertFalse(d.autoreply)

        test_string = '''
          nonexisting_flag define foo { u8 foo; };
        '''
        self.assertRaises(ParseError, self.parser.parse_string, test_string)


class TestService(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.parser = VPPAPI()

    def test_service(self):
        test_string = '''
         service foo { rpc foo (show_version) returns (show_version) };
        '''
        r = self.parser.parse_string(test_string)
        print('R', r)


if __name__ == '__main__':
    unittest.main()