From b6df26f89df776bb63e79203c06744f9bed65c72 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Sun, 16 Mar 2025 21:10:07 -0500 Subject: T7121: add test_commit wrapper and test script --- python/vyos/configtree.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'python') diff --git a/python/vyos/configtree.py b/python/vyos/configtree.py index c1db0782b..83954327c 100644 --- a/python/vyos/configtree.py +++ b/python/vyos/configtree.py @@ -539,6 +539,19 @@ def show_commit_data(active_tree, proposed_tree, libpath=LIBPATH): return res.decode() +def test_commit(active_tree, proposed_tree, libpath=LIBPATH): + if not ( + isinstance(active_tree, ConfigTree) and isinstance(proposed_tree, ConfigTree) + ): + raise TypeError('Arguments must be instances of ConfigTree') + + __lib = cdll.LoadLibrary(libpath) + __test_commit = __lib.test_commit + __test_commit.argtypes = [c_void_p, c_void_p] + + __test_commit(active_tree._get_config(), proposed_tree._get_config()) + + def reference_tree_to_json(from_dir, to_file, internal_cache='', libpath=LIBPATH): try: __lib = cdll.LoadLibrary(libpath) -- cgit v1.2.3