]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: fixup for vtysh-grammar merge
authorDavid Lamparter <equinox@opensourcerouting.org>
Mon, 28 Nov 2016 17:32:45 +0000 (18:32 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 28 Nov 2016 17:32:45 +0000 (18:32 +0100)
Tests weren't updated for vtysh-grammar yet...
NB: things still fail since some CLI behaviour changed.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
tests/common-cli.c
tests/common-cli.h
tests/test-cli.c
tests/test-commands.c

index aed20b2d5396258c90304c897f6aa89317296bf4..9cc1626fe80b5e4612ea1a0a6f008c384e139dad 100644 (file)
 struct thread_master *master;
 
 int dump_args(struct vty *vty, const char *descr,
-              int argc, const char **argv)
+              int argc, struct cmd_token *argv[])
 {
   int i;
   vty_out (vty, "%s with %d args.%s", descr, argc, VTY_NEWLINE);
   for (i = 0; i < argc; i++)
     {
-      vty_out (vty, "[%02d]: %s%s", i, argv[i], VTY_NEWLINE);
+      vty_out (vty, "[%02d]: %s%s", i, argv[i]->arg, VTY_NEWLINE);
     }
 
   return CMD_SUCCESS;
index 8f6751512ef1cf7935ccd410fcc4287b81bc3a59..9c72b08e44a448f115083b0eb939483c0cb41069 100644 (file)
@@ -36,7 +36,7 @@ extern void test_init (void);
 extern struct thread_master *master;
 
 extern int dump_args(struct vty *vty, const char *descr,
-              int argc, const char **argv);
+              int argc, struct cmd_token *argv[]);
 
 #define DUMMY_HELPSTR \
        "00\n01\n02\n03\n04\n05\n06\n07\n08\n09\n" \
index 6fab6d52cb2495adcd13cb452913997b78015787..e7bed0991ee9a72d6f52e7abdb8156d25389ed68 100644 (file)
@@ -28,10 +28,10 @@ DUMMY_DEFUN(cmd0,  "arg ipv4 A.B.C.D");
 DUMMY_DEFUN(cmd1,  "arg ipv4m A.B.C.D/M");
 DUMMY_DEFUN(cmd2,  "arg ipv6 X:X::X:X");
 DUMMY_DEFUN(cmd3,  "arg ipv6m X:X::X:X/M");
-DUMMY_DEFUN(cmd4,  "arg range <5-15>");
-DUMMY_DEFUN(cmd5,  "pat a ( a|b)");
-DUMMY_DEFUN(cmd6,  "pat b  (a|)");
-DUMMY_DEFUN(cmd7,  "pat c (a | b|c) A.B.C.D");
+DUMMY_DEFUN(cmd4,  "arg range (5-15)");
+DUMMY_DEFUN(cmd5,  "pat a < a|b>");
+DUMMY_DEFUN(cmd6,  "pat b  <a|>");
+DUMMY_DEFUN(cmd7,  "pat c <a | b|c> A.B.C.D");
 DUMMY_DEFUN(cmd8,  "pat d {  foo A.B.C.D|bar   X:X::X:X| baz }");
 DUMMY_DEFUN(cmd9,  "pat e [ WORD ]");
 DUMMY_DEFUN(cmd10, "pat f [key]");
index b4613a567d010637a5f1cb31664f52d86b67b840..c0bc39f88f87c483bd92979ef7436410fc3bde31 100644 (file)
@@ -146,7 +146,7 @@ static struct cmd_node keychain_key_node =
 };
 
 static int
-test_callback(struct cmd_element *cmd, struct vty *vty, int argc, const char *argv[])
+test_callback(const struct cmd_element *cmd, struct vty *vty, int argc, struct cmd_token *argv[])
 {
   int offset;
   int rv;
@@ -162,7 +162,7 @@ test_callback(struct cmd_element *cmd, struct vty *vty, int argc, const char *ar
   for (i = 0; i < argc; i++)
     {
       rv = snprintf(test_buf + offset, sizeof(test_buf) - offset, "%s'%s'",
-                    (i == 0) ? ": " : ", ", argv[i]);
+                    (i == 0) ? ": " : ", ", argv[i]->arg);
       if (rv < 0)
         abort();
       offset += rv;
@@ -332,7 +332,7 @@ test_run(struct prng *prng, struct vty *vty, const char *cmd, unsigned int edit_
             for (j = 0; j < vector_active(descriptions); j++)
               {
                 struct cmd_token *cmd = vector_slot(descriptions, j);
-                printf("  '%s' '%s'\n", cmd->cmd, cmd->desc);
+                printf("  '%s' '%s'\n", cmd->text, cmd->desc);
               }
             vector_free(descriptions);
           }