diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-11 13:00:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-11 13:00:00 +0100 |
commit | 757abe78d84cba04c058f43b60d07dca554302c2 (patch) | |
tree | 49bf0f89b9eb968c89f6e6654d973fbebb7cf848 /tests | |
parent | Merge pull request #197 from opensourcerouting/pytest_workdir (diff) | |
parent | vtysh: make -c useful with -C (dryrun) (diff) | |
download | frr-757abe78d84cba04c058f43b60d07dca554302c2.tar.xz frr-757abe78d84cba04c058f43b60d07dca554302c2.zip |
Merge pull request #195 from opensourcerouting/cli_merge
CLI: independent merge step
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/cli/common_cli.c | 2 | ||||
-rw-r--r-- | tests/lib/cli/common_cli.h | 2 | ||||
-rw-r--r-- | tests/lib/cli/test_cli.c | 12 |
3 files changed, 13 insertions, 3 deletions
diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c index 83196e04a..104352f51 100644 --- a/tests/lib/cli/common_cli.c +++ b/tests/lib/cli/common_cli.c @@ -83,7 +83,7 @@ main (int argc, char **argv) vty_init (master); memory_init (); - test_init (); + test_init (argc, argv); vty_stdio (vty_do_exit); diff --git a/tests/lib/cli/common_cli.h b/tests/lib/cli/common_cli.h index 9c72b08e4..9e7fe9983 100644 --- a/tests/lib/cli/common_cli.h +++ b/tests/lib/cli/common_cli.h @@ -28,7 +28,7 @@ #include "command.h" /* function to be implemented by test */ -extern void test_init (void); +extern void test_init (int argc, char **argv); /* functions provided by common cli * (includes main()) diff --git a/tests/lib/cli/test_cli.c b/tests/lib/cli/test_cli.c index 1a316022e..54b34bc79 100644 --- a/tests/lib/cli/test_cli.c +++ b/tests/lib/cli/test_cli.c @@ -38,8 +38,10 @@ DUMMY_DEFUN(cmd11, "alt a WORD"); DUMMY_DEFUN(cmd12, "alt a A.B.C.D"); DUMMY_DEFUN(cmd13, "alt a X:X::X:X"); -void test_init(void) +void test_init(int argc, char **argv) { + size_t repeat = argc > 1 ? strtoul(argv[1], NULL, 0) : 223; + install_element (ENABLE_NODE, &cmd0_cmd); install_element (ENABLE_NODE, &cmd1_cmd); install_element (ENABLE_NODE, &cmd2_cmd); @@ -53,4 +55,12 @@ void test_init(void) install_element (ENABLE_NODE, &cmd11_cmd); install_element (ENABLE_NODE, &cmd12_cmd); install_element (ENABLE_NODE, &cmd13_cmd); + for (size_t i = 0; i < repeat; i++) { + uninstall_element (ENABLE_NODE, &cmd5_cmd); + install_element (ENABLE_NODE, &cmd5_cmd); + } + for (size_t i = 0; i < repeat; i++) { + uninstall_element (ENABLE_NODE, &cmd13_cmd); + install_element (ENABLE_NODE, &cmd13_cmd); + } } |