From 85bdafacbdd25f88c06076ca7208ff14fe10b74c Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Wed, 21 Dec 2016 11:51:05 +0100 Subject: Python API: Incorrect error for empty VLA list. Change-Id: Ie3e9a54ca23af6b9ee43615f59a48cb05e3906d4 Signed-off-by: Ole Troan --- vpp-api/python/tests/test_vpp_papi2.py | 12 +++++++++++- vpp-api/python/vpp_papi/vpp_papi.py | 3 --- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'vpp-api') diff --git a/vpp-api/python/tests/test_vpp_papi2.py b/vpp-api/python/tests/test_vpp_papi2.py index 18f6b6866a8..f45f791e627 100755 --- a/vpp-api/python/tests/test_vpp_papi2.py +++ b/vpp-api/python/tests/test_vpp_papi2.py @@ -434,7 +434,7 @@ class TestACL(unittest.TestCase): rv = vpp.acl_plugin_get_version() print('RV', rv) - self.assertEqual(rv.major, 0) + self.assertEqual(rv.major, 1) self.assertEqual(rv.minor, 1) rv = vpp.acl_add_replace(acl_index = 0xFFFFFFFF, @@ -472,6 +472,16 @@ class TestACL(unittest.TestCase): vpp = VPP(jsonfiles) vpp.status() + def test_acl_interface_get(self): + vpp = VPP(jsonfiles) + + vpp.connect('test_vpp_papi2') + + rv = vpp.macip_acl_interface_get() + + print('RV', rv) + + vpp.disconnect() if __name__ == '__main__': unittest.main() diff --git a/vpp-api/python/vpp_papi/vpp_papi.py b/vpp-api/python/vpp_papi/vpp_papi.py index 02fe2457ef0..6b6b79fd70b 100644 --- a/vpp-api/python/vpp_papi/vpp_papi.py +++ b/vpp-api/python/vpp_papi/vpp_papi.py @@ -206,9 +206,6 @@ class VPP(): e = v[0] if type(v[0]) is int else res[v[2]] if e == -1: e = (len(buf) - off) / v[1].size - if e == 0: - raise ValueError(1, - 'Variable length array, empty length: ' + k) lst = [] res.append(lst) size = 0 -- cgit 1.2.3-korg