rv = self.v.show_version()
self.assertEqual(rv.retval, 0)
def test_show_version_invalid_param(self):
rv = self.v.show_version()
self.assertEqual(rv.retval, 0)
def test_show_version_invalid_param(self):
rv = self.v.get_node_index(node_name='ip4-lookup')
self.assertEqual(rv.retval, 0)
node_name = 'X' * 100
rv = self.v.get_node_index(node_name='ip4-lookup')
self.assertEqual(rv.retval, 0)
node_name = 'X' * 100
p = json.loads(TestPAPIMessageParsing.show_version_msg)
msglist = VPP(testmode=json)
msgdef = msglist.add_message(p[0], p[1:])
p = json.loads(TestPAPIMessageParsing.show_version_msg)
msglist = VPP(testmode=json)
msgdef = msglist.add_message(p[0], p[1:])
self.assertTrue(msglist.ret_tup('show_version'))
def test_adding_new_message_object_with_array(self):
self.assertTrue(msglist.ret_tup('show_version'))
def test_adding_new_message_object_with_array(self):
p = json.loads(TestPAPIMessageParsing.ip_address_details_msg)
msglist = VPP(testmode=True)
msglist.add_message(p[0], p[1:])
p = json.loads(TestPAPIMessageParsing.ip_address_details_msg)
msglist = VPP(testmode=True)
msglist.add_message(p[0], p[1:])
msglist = VPP(testmode=True)
p = json.loads(TestPAPIMessageParsing.show_version_msg)
msgdef = msglist.add_message(p[0], p[1:])
msglist = VPP(testmode=True)
p = json.loads(TestPAPIMessageParsing.show_version_msg)
msgdef = msglist.add_message(p[0], p[1:])
self.assertEqual([1, 2], rv.list)
def test_add_new_types(self):
self.assertEqual([1, 2], rv.list)
def test_add_new_types(self):
counter_type = '''["ip4_fib_counter",
["u32", "address"],
["u8", "address_length"],
counter_type = '''["ip4_fib_counter",
["u32", "address"],
["u8", "address_length"],
self.assertEqual(5678, rv.counter.bytes)
def test_add_two_new_types(self):
self.assertEqual(5678, rv.counter.bytes)
def test_add_two_new_types(self):
self.assertEqual(4, rv.r1.a1)
def test_nested_array_type(self):
self.assertEqual(4, rv.r1.a1)
def test_nested_array_type(self):
self.assertEqual(bt_tbl_id['bt_set'], rv.br_tbl_id.bt_set)
def test_add_new_compound_type_with_array(self):
self.assertEqual(bt_tbl_id['bt_set'], rv.br_tbl_id.bt_set)
def test_add_new_compound_type_with_array(self):
counter_type = '''["ip4_fib_counter",
["u32", "address"],
["u8", "address_length"],
counter_type = '''["ip4_fib_counter",
["u32", "address"],
["u8", "address_length"],
self.assertEqual(333, rv.counter[1].packets)
def test_simple_array(self):
self.assertEqual(333, rv.counter[1].packets)
def test_simple_array(self):
msglist = VPP(testmode=True)
simple_byte_array = '''["simple_byte_array",
msglist = VPP(testmode=True)
simple_byte_array = '''["simple_byte_array",
self.assertEqual('foobar', rv.list)
def test_old_vla_array(self):
self.assertEqual('foobar', rv.list)
def test_old_vla_array(self):
self.assertEqual(b'foobar', rv.oldmask)
def test_old_vla_array_not_last_member(self):
self.assertEqual(b'foobar', rv.oldmask)
def test_old_vla_array_not_last_member(self):
self.assertRaises(ValueError, msglist.add_message, p[0], p[1:])
def test_old_vla_array_u32(self):
self.assertRaises(ValueError, msglist.add_message, p[0], p[1:])
def test_old_vla_array_u32(self):
self.assertEqual([123, 456, 789], rv.oldmask)
def test_old_vla_array_compound(self):
self.assertEqual([123, 456, 789], rv.oldmask)
def test_old_vla_array_compound(self):
msgdef = msglist.add_message(p[0], p[1:])
def test_array_count_not_previous(self):
msgdef = msglist.add_message(p[0], p[1:])
def test_array_count_not_previous(self):
self.assertEqual(rv.lst, [1, 2, 3])
def test_argument_name(self):
self.assertEqual(rv.lst, [1, 2, 3])
def test_argument_name(self):
msglist = VPP(testmode=True)
simple_name = '''["simple_name",
msglist = VPP(testmode=True)
simple_name = '''["simple_name",