diff options
author | John Estabrook <jestabro@vyos.io> | 2025-03-16 21:10:07 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2025-03-16 23:55:12 -0500 |
commit | b6df26f89df776bb63e79203c06744f9bed65c72 (patch) | |
tree | 71d834f122886bf9d4ac887749aa425dfc8bf012 /python | |
parent | 21d960b34da2cd8b98be1ff59c416e434c31b1e1 (diff) | |
download | vyos-1x-b6df26f89df776bb63e79203c06744f9bed65c72.tar.gz vyos-1x-b6df26f89df776bb63e79203c06744f9bed65c72.zip |
T7121: add test_commit wrapper and test script
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configtree.py | 13 |
1 files changed, 13 insertions, 0 deletions
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) |