mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 17:40:04 +00:00
tests: fixup for vtysh-grammar merge
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>
This commit is contained in:
parent
64bf316f34
commit
6a23719c75
@ -34,13 +34,13 @@
|
||||
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;
|
||||
|
@ -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" \
|
||||
|
@ -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]");
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user