summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-12-06 23:37:05 +0100
committerRenato Westphal <renato@opensourcerouting.org>2018-12-07 14:11:33 +0100
commitfbdc1c0a8484301111582dcbef90b8ec646db6dd (patch)
tree7f2b846c6478533de4534ec5c7be71fff74a5285 /tests/lib
parentMerge pull request #3438 from opensourcerouting/bgp-rfapi-default-value (diff)
downloadfrr-fbdc1c0a8484301111582dcbef90b8ec646db6dd.tar.xz
frr-fbdc1c0a8484301111582dcbef90b8ec646db6dd.zip
lib: add support for confirmed commits
Confirmed commits allow the user to request an automatic rollback to the previous configuration if the commit operation is not confirmed within a number of minutes. This is particularly useful when the user is accessing the CLI through the network (e.g. using SSH) and any configuration change might cause an unexpected loss of connectivity between the user and the managed device (e.g. misconfiguration of a routing protocol). By using a confirmed commit, the user can rest assured the connectivity will be restored after the given timeout expires, avoiding the need to access the router physically to fix the problem. When "commit confirmed TIMEOUT" is used, a new "commit" command is expected to confirm the previous commit before the given timeout expires. If "commit confirmed TIMEOUT" is used while there's already a confirmed-commit in progress, the confirmed-commit timeout is reset to the new value. In the current implementation, if other users perform commits while there's a confirmed-commit in progress, all commits are rolled back when the confirmed-commit timeout expires. It's recommended to use the "configure exclusive" configuration mode to prevent unexpected outcomes when using confirmed commits. When an user exits from the configuration mode while there's a confirmed-commit in progress, the commit is automatically rolled back and the user is notified about it. In the future we might want to prompt the user if he or she really wants to exit from the configuration mode when there's a pending confirmed commit. Needless to say, confirmed commit only work for configuration commands converted to the new northbound model. vtysh support will be implemented at a later time. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/cli/common_cli.c2
-rw-r--r--tests/lib/cli/test_commands.c2
-rw-r--r--tests/lib/northbound/test_oper_data.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c
index 04f1e3253..3cf30f00c 100644
--- a/tests/lib/cli/common_cli.c
+++ b/tests/lib/cli/common_cli.c
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
vty_init(master);
memory_init();
yang_init();
- nb_init(NULL, 0);
+ nb_init(master, NULL, 0);
test_init(argc, argv);
diff --git a/tests/lib/cli/test_commands.c b/tests/lib/cli/test_commands.c
index 74816ece8..ba46bdcea 100644
--- a/tests/lib/cli/test_commands.c
+++ b/tests/lib/cli/test_commands.c
@@ -143,7 +143,7 @@ static void test_init(void)
cmd_init(1);
yang_init();
- nb_init(NULL, 0);
+ nb_init(master, NULL, 0);
install_node(&bgp_node, NULL);
install_node(&rip_node, NULL);
diff --git a/tests/lib/northbound/test_oper_data.c b/tests/lib/northbound/test_oper_data.c
index a9a89ee49..7c5713d8f 100644
--- a/tests/lib/northbound/test_oper_data.c
+++ b/tests/lib/northbound/test_oper_data.c
@@ -449,7 +449,7 @@ int main(int argc, char **argv)
vty_init(master);
memory_init();
yang_init();
- nb_init(modules, array_size(modules));
+ nb_init(master, modules, array_size(modules));
/* Create artificial data. */
create_data(num_vrfs, num_interfaces, num_routes);