From 011ea89145daf67b639053cedb62c01f682038ab Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 16 Jul 2025 07:56:33 -0500 Subject: T7637: be lenient on redundant/duplicate values for smoketests Errors Useless_set and Duplicate_value are considered non-critical, as may occur in automation, for example smoketests. --- src/session.ml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/session.ml b/src/session.ml index 1ff9bae..62037d5 100644 --- a/src/session.ml +++ b/src/session.ml @@ -105,10 +105,7 @@ let set w s path = (fun c -> RT.set_tag_data w.reference_tree c path) |> (fun c -> RT.set_leaf_data w.reference_tree c path) with - | CT.Useless_set -> - raise (Session_error (Printf.sprintf "Useless set, path: %s" (string_of_op op))) - | CT.Duplicate_value -> - raise (Session_error (Printf.sprintf "Duplicate value, path: %s" (string_of_op op))) + | CT.Useless_set | CT.Duplicate_value -> s.proposed_config in {s with proposed_config=config; changeset=(op :: s.changeset)} -- cgit v1.2.3 From 59c22fbdc1f1a9ad277c5ed8c9665ce0f8d86e57 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 16 Jul 2025 20:33:45 -0500 Subject: T7637: fix typo in update of trees when cloning path with tag_value This missed a proper update in the case of failures in a collection of tag node values; caught in test_interfaces_vxlan.py test_vxlan_external. --- src/commit.ml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/commit.ml b/src/commit.ml index 0d675d8..2e2dbac 100644 --- a/src/commit.ml +++ b/src/commit.ml @@ -181,7 +181,12 @@ let config_result_update c_data n_data = match r.success, n_data.source with | true, ADD -> let add = CT.get_subtree c_data.config_diff ["add"] in - let add_tree = CD.clone add (CT.default) n_data.path in + let path = + match n_data.tag_value with + | None -> n_data.path + | Some v -> n_data.path @ [v] + in + let add_tree = CD.clone add (CT.default) path in let config = CD.tree_union add_tree c_data.config_result in let result = { success = c_data.result.success && true; @@ -190,7 +195,12 @@ let config_result_update c_data n_data = { c_data with config_result = config; result = result; } | false, DELETE -> let del = CT.get_subtree c_data.config_diff ["del"] in - let add_tree = CD.clone del (CT.default) n_data.path in + let path = + match n_data.tag_value with + | None -> n_data.path + | Some v -> n_data.path @ [v] + in + let add_tree = CD.clone del (CT.default) path in let config = CD.tree_union add_tree c_data.config_result in let result = { success = c_data.result.success && false; -- cgit v1.2.3