Browse Source

tests: add a test program for lib/command.c

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Christian Franke 6 years ago
parent
commit
8f399b0e4f

+ 2 - 0
tests/.gitignore

@@ -33,4 +33,6 @@ testsegv
 testsig
 teststream
 testnexthopiter
+testcommands
+test-commands-defun.c
 site.exp

+ 17 - 1
tests/Makefile.am

@@ -9,7 +9,9 @@ EXTRA_DIST = \
 	config/unix.exp \
 	lib/bgpd.exp \
 	lib/libzebra.exp \
-	global-conf.exp
+	global-conf.exp \
+	testcommands.in \
+	testcommands.out
 
 INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = @DEFS@ $(LOCAL_OPTS) -DSYSCONFDIR=\"$(sysconfdir)/\"
@@ -26,8 +28,20 @@ endif
 
 check_PROGRAMS = testsig testsegv testbuffer testmemory heavy heavywq heavythread \
 		testprivs teststream testchecksum tabletest testnexthopiter \
+		testcommands \
 		$(TESTS_BGPD)
 
+../vtysh/vtysh_cmd.c:
+	$(MAKE) -C ../vtysh vtysh_cmd.c
+
+test-commands-defun.c: ../vtysh/vtysh_cmd.c
+	sed \
+		-e '/"vtysh.h"/d' \
+		-e 's/vtysh_init_cmd/test_init_cmd/' \
+		-e 's/VTYSH_[A-Z][A-Z_0-9]*/0/g' \
+		< ../vtysh/vtysh_cmd.c \
+		> test-commands-defun.c
+
 noinst_HEADERS = prng.h
 
 testsig_SOURCES = test-sig.c
@@ -47,6 +61,7 @@ testchecksum_SOURCES = test-checksum.c
 testbgpmpath_SOURCES = bgp_mpath_test.c
 tabletest_SOURCES = table_test.c
 testnexthopiter_SOURCES = test-nexthop-iter.c prng.c
+testcommands_SOURCES = test-commands-defun.c test-commands.c prng.c
 
 testsig_LDADD = ../lib/libzebra.la @LIBCAP@
 testsegv_LDADD = ../lib/libzebra.la @LIBCAP@
@@ -65,3 +80,4 @@ testchecksum_LDADD = ../lib/libzebra.la @LIBCAP@
 testbgpmpath_LDADD = ../bgpd/libbgp.a ../lib/libzebra.la @LIBCAP@ -lm
 tabletest_LDADD = ../lib/libzebra.la @LIBCAP@ -lm
 testnexthopiter_LDADD = ../lib/libzebra.la @LIBCAP@
+testcommands_LDADD = ../lib/libzebra.la @LIBCAP@

+ 1 - 0
tests/libzebra.tests/Makefile.am

@@ -1,3 +1,4 @@
 EXTRA_DIST = \
 	tabletest.exp \
+	testcommands.exp \
 	testnexthopiter.exp

+ 23 - 0
tests/libzebra.tests/testcommands.exp

@@ -0,0 +1,23 @@
+set timeout 30
+set test_name "testcommands"
+
+spawn sh -c "./testcommands -e 0 < testcommands.in | diff -au - testcommands.out"
+
+expect {
+	eof {
+	}
+	timeout {
+		exp_close
+		fail "$test_name: timeout"
+	}
+}
+
+catch wait result
+set os_error    [lindex $result 2]
+set exit_status [lindex $result 3]
+
+if { $os_error == 0 && $exit_status == 0 } {
+	pass "$test_name"
+} else {
+	fail "$test_name"
+}

+ 48 - 0
tests/prng.c

@@ -25,6 +25,7 @@
 
 #include <assert.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "prng.h"
 
@@ -75,6 +76,53 @@ prng_rand(struct prng *prng)
   return rv;
 }
 
+const char *
+prng_fuzz(struct prng *prng,
+          const char *string,
+          const char *charset,
+          unsigned int operations)
+{
+  static char buf[256];
+  unsigned int charset_len;
+  unsigned int i;
+  unsigned int offset;
+  unsigned int op;
+  unsigned int character;
+
+  assert(strlen(string) < sizeof(buf));
+
+  strncpy(buf, string, sizeof(buf));
+  charset_len = strlen(charset);
+
+  for (i = 0; i < operations; i++)
+    {
+      offset = prng_rand(prng) % strlen(buf);
+      op = prng_rand(prng) % 3;
+
+      switch (op)
+        {
+        case 0:
+          /* replace */
+          character = prng_rand(prng) % charset_len;
+          buf[offset] = charset[character];
+          break;
+        case 1:
+          /* remove */
+          memmove(buf + offset, buf + offset + 1, strlen(buf) - offset);
+          break;
+        case 2:
+          /* insert */
+          assert(strlen(buf) + 1 < sizeof(buf));
+
+          memmove(buf + offset + 1, buf + offset, strlen(buf) + 1 - offset);
+          character = prng_rand(prng) % charset_len;
+          buf[offset] = charset[character];
+          break;
+        }
+    }
+  return buf;
+}
+
 void
 prng_free(struct prng *prng)
 {

+ 4 - 0
tests/prng.h

@@ -29,6 +29,10 @@ struct prng;
 
 struct prng* prng_new(unsigned long long seed);
 unsigned int prng_rand(struct prng*);
+const char * prng_fuzz(struct prng*,
+                       const char *string,
+                       const char *charset,
+                       unsigned int operations);
 void prng_free(struct prng *);
 
 #endif

+ 417 - 0
tests/test-commands.c

@@ -0,0 +1,417 @@
+/*
+ * Test code for lib/command.c
+ *
+ * Copyright (C) 2013 by Open Source Routing.
+ * Copyright (C) 2013 by Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This program reads in a list of commandlines from stdin
+ * and calls all the public functions of lib/command.c for
+ * both the given command lines and fuzzed versions thereof.
+ *
+ * The output is currently not validated but only logged. It can
+ * be diffed to find regressions between versions.
+ *
+ * Quagga is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * Quagga is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Quagga; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#define REALLY_NEED_PLAIN_GETOPT 1
+
+#include <zebra.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "command.h"
+#include "memory.h"
+#include "vector.h"
+#include "prng.h"
+
+extern vector cmdvec;
+extern struct cmd_node vty_node;
+extern void test_init_cmd(void); /* provided in test-commands-defun.c */
+
+struct thread_master *master; /* dummy for libzebra*/
+
+static vector test_cmds;
+static char test_buf[32768];
+
+static struct cmd_node bgp_node =
+{
+  BGP_NODE,
+  "%s(config-router)# ",
+};
+
+static struct cmd_node rip_node =
+{
+  RIP_NODE,
+  "%s(config-router)# ",
+};
+
+static struct cmd_node isis_node =
+{
+  ISIS_NODE,
+  "%s(config-router)# ",
+};
+
+static struct cmd_node interface_node =
+{
+  INTERFACE_NODE,
+  "%s(config-if)# ",
+};
+
+static struct cmd_node rmap_node =
+{
+  RMAP_NODE,
+  "%s(config-route-map)# "
+};
+
+static struct cmd_node zebra_node =
+{
+  ZEBRA_NODE,
+  "%s(config-router)# "
+};
+
+static struct cmd_node bgp_vpnv4_node =
+{
+  BGP_VPNV4_NODE,
+  "%s(config-router-af)# "
+};
+
+static struct cmd_node bgp_ipv4_node =
+{
+  BGP_IPV4_NODE,
+  "%s(config-router-af)# "
+};
+
+static struct cmd_node bgp_ipv4m_node =
+{
+  BGP_IPV4M_NODE,
+  "%s(config-router-af)# "
+};
+
+static struct cmd_node bgp_ipv6_node =
+{
+  BGP_IPV6_NODE,
+  "%s(config-router-af)# "
+};
+
+static struct cmd_node bgp_ipv6m_node =
+{
+  BGP_IPV6M_NODE,
+  "%s(config-router-af)# "
+};
+
+static struct cmd_node ospf_node =
+{
+  OSPF_NODE,
+  "%s(config-router)# "
+};
+
+static struct cmd_node ripng_node =
+{
+  RIPNG_NODE,
+  "%s(config-router)# "
+};
+
+static struct cmd_node ospf6_node =
+{
+  OSPF6_NODE,
+  "%s(config-ospf6)# "
+};
+
+static struct cmd_node babel_node =
+{
+  BABEL_NODE,
+  "%s(config-babel)# "
+};
+
+static struct cmd_node keychain_node =
+{
+  KEYCHAIN_NODE,
+  "%s(config-keychain)# "
+};
+
+static struct cmd_node keychain_key_node =
+{
+  KEYCHAIN_KEY_NODE,
+  "%s(config-keychain-key)# "
+};
+
+static int
+test_callback(struct cmd_element *cmd, struct vty *vty, int argc, const char *argv[])
+{
+  int offset;
+  int rv;
+  int i;
+
+  offset = 0;
+  rv = snprintf(test_buf, sizeof(test_buf), "'%s'", cmd->string);
+  if (rv < 0)
+    abort();
+
+  offset += rv;
+
+  for (i = 0; i < argc; i++)
+    {
+      rv = snprintf(test_buf + offset, sizeof(test_buf) - offset, "%s'%s'",
+                    (i == 0) ? ": " : ", ", argv[i]);
+      if (rv < 0)
+        abort();
+      offset += rv;
+    }
+
+  return CMD_SUCCESS;
+}
+
+static void
+test_load(void)
+{
+  char line[4096];
+
+  test_cmds = vector_init(VECTOR_MIN_SIZE);
+
+  while (fgets(line, sizeof(line), stdin) != NULL)
+    {
+      if (strlen(line))
+        line[strlen(line) - 1] = '\0';
+      if (line[0] == '#')
+        continue;
+      vector_set(test_cmds, XSTRDUP(MTYPE_STRVEC, line));
+    }
+}
+
+static void
+test_init(void)
+{
+  unsigned int node;
+  unsigned int i;
+  struct cmd_node *cnode;
+  struct cmd_element *cmd;
+
+  cmd_init(1);
+
+  install_node (&bgp_node, NULL);
+  install_node (&rip_node, NULL);
+  install_node (&interface_node, NULL);
+  install_node (&rmap_node, NULL);
+  install_node (&zebra_node, NULL);
+  install_node (&bgp_vpnv4_node, NULL);
+  install_node (&bgp_ipv4_node, NULL);
+  install_node (&bgp_ipv4m_node, NULL);
+  install_node (&bgp_ipv6_node, NULL);
+  install_node (&bgp_ipv6m_node, NULL);
+  install_node (&ospf_node, NULL);
+  install_node (&ripng_node, NULL);
+  install_node (&ospf6_node, NULL);
+  install_node (&babel_node, NULL);
+  install_node (&keychain_node, NULL);
+  install_node (&keychain_key_node, NULL);
+  install_node (&isis_node, NULL);
+  install_node (&vty_node, NULL);
+
+  test_init_cmd();
+
+  for (node = 0; node < vector_active(cmdvec); node++)
+    if ((cnode = vector_slot(cmdvec, node)) != NULL)
+      for (i = 0; i < vector_active(cnode->cmd_vector); i++)
+        if ((cmd = vector_slot(cnode->cmd_vector, i)) != NULL)
+          {
+            cmd->daemon = 0;
+            cmd->func = test_callback;
+          }
+  sort_node();
+
+  test_load();
+  vty_init_vtysh();
+}
+
+static void
+test_terminate(void)
+{
+  unsigned int i;
+
+  vty_terminate();
+  for (i = 0; i < vector_active(test_cmds); i++)
+    XFREE(MTYPE_STRVEC, vector_slot(test_cmds, i));
+  vector_free(test_cmds);
+  cmd_terminate();
+}
+
+static void
+test_run(struct prng *prng, struct vty *vty, const char *cmd, unsigned int edit_dist, unsigned int node_index, int verbose)
+{
+  const char *test_str;
+  vector vline;
+  int ret;
+  unsigned int i;
+  char **completions;
+  unsigned int j;
+  struct cmd_node *cnode;
+  vector descriptions;
+  int appended_null;
+  int no_match;
+
+  test_str = prng_fuzz(prng, cmd, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_:. /", edit_dist);
+  vline = cmd_make_strvec(test_str);
+
+  if (vline == NULL)
+    return;
+
+  appended_null = 0;
+  for (i = 0; i < vector_active(cmdvec); i++)
+    if ((cnode = vector_slot(cmdvec, i)) != NULL)
+      {
+        if (node_index != (unsigned int)-1 && i != node_index)
+          continue;
+
+        if (appended_null)
+          {
+            vector_unset(vline, vector_active(vline) - 1);
+            appended_null = 0;
+          }
+        vty->node = cnode->node;
+        test_buf[0] = '\0';
+        ret = cmd_execute_command(vline, vty, NULL, 0);
+        no_match = (ret == CMD_ERR_NO_MATCH);
+        if (verbose || !no_match)
+          printf("execute relaxed '%s'@%d: rv==%d%s%s\n",
+                 test_str,
+                 cnode->node,
+                 ret,
+                 (test_buf[0] != '\0') ? ", " : "",
+                 test_buf);
+
+        vty->node = cnode->node;
+        test_buf[0] = '\0';
+        ret = cmd_execute_command_strict(vline, vty, NULL);
+        if (verbose || !no_match)
+          printf("execute strict '%s'@%d: rv==%d%s%s\n",
+                 test_str,
+                 cnode->node,
+                 ret,
+                 (test_buf[0] != '\0') ? ", " : "",
+                 test_buf);
+
+        if (isspace((int) test_str[strlen(test_str) - 1]))
+          {
+            vector_set (vline, NULL);
+            appended_null = 1;
+          }
+
+        vty->node = cnode->node;
+        completions = cmd_complete_command(vline, vty, &ret);
+        if (verbose || !no_match)
+          printf("complete '%s'@%d: rv==%d\n",
+                 test_str,
+                 cnode->node,
+                 ret);
+        if (completions != NULL)
+          {
+            for (j = 0; completions[j] != NULL; j++)
+              {
+                printf("  '%s'\n", completions[j]);
+                XFREE(MTYPE_TMP, completions[j]);
+              }
+            XFREE(MTYPE_VECTOR_INDEX, completions);
+          }
+
+        vty->node = cnode->node;
+        descriptions = cmd_describe_command(vline, vty, &ret);
+        if (verbose || !no_match)
+          printf("describe '%s'@%d: rv==%d\n",
+                 test_str,
+                 cnode->node,
+                 ret);
+        if (descriptions != NULL)
+          {
+            for (j = 0; j < vector_active(descriptions); j++)
+              {
+                struct desc *cmd = vector_slot(descriptions, j);
+                printf("  '%s' '%s'\n", cmd->cmd, cmd->str);
+              }
+            vector_free(descriptions);
+          }
+      }
+  cmd_free_strvec(vline);
+}
+
+int
+main(int argc, char **argv)
+{
+  int opt;
+  struct prng *prng;
+  struct vty *vty;
+  unsigned int edit_distance;
+  unsigned int max_edit_distance;
+  unsigned int node_index;
+  int verbose;
+  unsigned int test_cmd;
+  unsigned int iteration;
+  unsigned int num_iterations;
+
+  max_edit_distance = 3;
+  node_index = -1;
+  verbose = 0;
+
+  while ((opt = getopt(argc, argv, "e:n:v")) != -1)
+    {
+      switch (opt)
+        {
+        case 'e':
+          max_edit_distance = atoi(optarg);
+          break;
+        case 'n':
+          node_index = atoi(optarg);
+          break;
+        case 'v':
+          verbose++;
+          break;
+        default:
+          fprintf(stderr, "Usage: %s [-e <edit_dist>] [-n <node_idx>] [-v]\n", argv[0]);
+          exit(1);
+          break;
+        }
+    }
+
+  test_init();
+  prng = prng_new(0);
+
+  vty = vty_new();
+  vty->type = VTY_TERM;
+
+  fprintf(stderr, "Progress:\n0/%u", vector_active(test_cmds));
+  for (test_cmd = 0; test_cmd < vector_active(test_cmds); test_cmd++)
+    {
+      for (edit_distance = 0;
+           edit_distance <= max_edit_distance;
+           edit_distance++)
+        {
+          num_iterations = 1 << edit_distance;
+          num_iterations *= num_iterations * num_iterations;
+
+          for (iteration = 0; iteration < num_iterations; iteration++)
+            test_run(prng, vty, vector_slot(test_cmds, test_cmd), edit_distance, node_index, verbose);
+        }
+      fprintf(stderr, "\r%u/%u", test_cmd + 1, vector_active(test_cmds));
+    }
+  fprintf(stderr, "\nDone.\n");
+
+  vty_close(vty);
+  prng_free(prng);
+  test_terminate();
+  return 0;
+}

+ 201 - 0
tests/testcommands.in

@@ -0,0 +1,201 @@
+#
+#
+# Some randomly chosen valid commands
+#
+#
+area 0 virtual-link 1.2.3.4 authentication null message-digest-key 1 md5 VARIABLE
+area 0 virtual-link 1.2.3.4 dead-interval 1 hello-interval 1 retransmit-interval 1 transmit-delay 1
+area 0 virtual-link 1.2.3.4 retransmit-interval 1 retransmit-interval 1 dead-interval 1 retransmit-interval 1
+area 1.2.3.4 virtual-link 1.2.3.4 hello-interval 1 hello-interval 1 dead-interval 1
+area 1.2.3.4 virtual-link 1.2.3.4 retransmit-interval 1 retransmit-interval 1 transmit-delay 1 dead-interval 1
+clear bgp 1 out
+clear bgp ipv6 2001:db8::1 out
+clear bgp view VARIABLE * soft
+clear ip bgp 1.2.3.4 ipv4 multicast out
+ipv6 nd prefix 2001:db8::/32 infinite infinite no-autoconfig
+ipv6 route 2001:db8::/32 2001:db8::1 VARIABLE 1
+network 1.0.0.0/8 area 0
+no area 1.2.3.4 virtual-link 1.2.3.4 hello-interval dead-interval hello-interval transmit-delay
+no area 1.2.3.4 virtual-link 1.2.3.4 hello-interval dead-interval retransmit-interval transmit-delay
+no area 1.2.3.4 virtual-link 1.2.3.4 retransmit-interval dead-interval retransmit-interval hello-interval
+no area 1.2.3.4 virtual-link 1.2.3.4 transmit-delay retransmit-interval retransmit-interval hello-interval
+no bgp graceful-restart
+no ipv6 nd mtu 1
+no neighbor 1.2.3.4 distribute-list 1 in
+no neighbor 2001:db8::1 send-community both
+no neighbor VARIABLE maximum-prefix
+redistribute isis route-map VARIABLE metric 0 metric-type 2
+redistribute rip metric 0 route-map VARIABLE metric-type 1
+show bgp community VARIABLE local-AS no-export VARIABLE exact-match
+show bgp ipv6 community no-advertise no-export no-export no-export
+show bgp ipv6 community VARIABLE local-AS local-AS no-advertise exact-match
+show bgp ipv6 community VARIABLE local-AS VARIABLE local-AS exact-match
+show bgp view VARIABLE
+show bgp view VARIABLE ipv4 multicast community no-export no-export local-AS VARIABLE
+show bgp view VARIABLE ipv4 unicast community local-AS no-advertise no-advertise local-AS
+show bgp view VARIABLE ipv4 unicast community no-export VARIABLE no-advertise
+show bgp view VARIABLE ipv4 unicast community VARIABLE local-AS no-export VARIABLE
+show bgp view VARIABLE ipv6 multicast community no-advertise VARIABLE no-advertise local-AS
+show ip bgp community no-advertise local-AS no-advertise VARIABLE
+show ip bgp ipv4 unicast community no-advertise VARIABLE no-advertise local-AS exact-match
+show ip bgp ipv4 unicast community no-export VARIABLE local-AS VARIABLE exact-match
+show ip bgp ipv4 unicast community no-export VARIABLE no-export local-AS exact-match
+show ipv6 bgp community no-export no-export VARIABLE VARIABLE
+show ipv6 bgp community VARIABLE local-AS no-advertise no-advertise exact-match
+show ipv6 mbgp community local-AS local-AS local-AS VARIABLE exact-match
+show ipv6 mbgp community local-AS local-AS no-export no-export exact-match
+show ipv6 mbgp community no-export no-export local-AS no-export exact-match
+show ipv6 ospf6 database as-external dump
+show ipv6 ospf6 database inter-prefix 1.2.3.4 detail
+show ipv6 ospf6 database intra-prefix 1.2.3.4 internal
+#
+#
+# Slightly Fuzzed commands
+#
+#
+a8ra 0 range 1.0.0.0/8 adverOise
+accept-lifetime VARIABE 1 VA6IABLE 19I3 VARIABLE 1 VARIABLE 1993
+arAea 1.2.M.4 virtual-link 1.2.3.4 dead-interval 1 dead-interval 1 dead-inter6val 1 transmit-delay 1
+area 0 virtu0al-link 1.2.3.i hello-interval 1 ello-interval 1 transmit-delay 1 retransmit-interval 1
+area 0 virtual-lin 1.2.3.4 retransmit-interval 1 tranwmit-delay 1 retransmit-interval 1 retransmit-interval 1
+area 0 virtual-link 1.2.3.4 retransmit-interal 1 trasmit-dely 1
+area 1.2.3.4 virtual-link 1.2.3.4 deadCinterval 1  dead-intervalK 1 retransmit-interval 1 dead-interval 1
+area 1.2.3.4 virtual-link 1.2.3.4 dead-intervalo I1 dead-interval 1 retransmit-interval1 dead-interval 1
+area 1.2.3.4 virtual-link 1.2.3.4 hello-interval 1 dead-interva 1 retransmit-interval 1 transmit-delay 1
+area 1.2.3.4 virtuyl-link 1.2.3.4 dead-interval 1 dead-inervalI 1 retransmit-interval 1 dead-interval 1
+area 1.2.3.4 virual-link 1.2.34 retransmit-interval 1 dead-interval 1 dead-interva 1
+area1.2.83.4 virtual-link 1.2.3.4 retra0smit-interval 1 dead-interval 1 dead-interval 1
+clear bgAp 2001g:dbK::1
+clear ip bgp 1.2.3.4 pv4 mlticat out
+cleau bg i2001:db8::1 rsclient
+de:ug ospf6 messag2 lsreq :recv
+how ip bgp communiQy no-advertise no-adve:tise no-advertise
+ip route 1.0Q0.0/8 1.2.3.s4 reGject
+ipv6 nd prefix 2O01:db8::/32 0 infinEite off-link
+ipv6 nwd prefix 2001:db8::/32 0 infinite oUUff-link
+ipv6 route 2001:db8::/32q2001:db8:k: blackhole 1
+kshow ip rIute bgp
+matcch peer .2.30.4
+mcogin
+mhow ipv6 mbgp community o-advertise yocal-AS no-advertise
+neighbor1.2..4 attribute-unchnged next-hop
+neihbcr 2001:d b8::1 distribute-list 1 in
+nko key-tqring
+no area 0 viertual-link 1.2.3k.4 retransmit-iterval retransmit-interval retransmit-interval hello-interval
+no area 0 virtual-link 1.2.3.4 dead-intaerval dead-intervIl hello-interval retransmit-interval
+no area 0 virtual-link 1.2.3.4 retransmit-interval retransmit-intervIl dead-interval tranImit-deqlay
+no area 0 virtual-link S1.2.3.4 d-ead-interval hello-interval transmit-deay transmit-delay
+no area 1.2.3.4 virtua -link 1.2.3.4 transmit-delay hello-interval hello-interval retransmt-interval
+no area 1.2.3.4 virtual-link 1.2.3.4 dea-iterval retransmit-interva- dead-interval hello-interval
+no area 1.2.3.4 virtual-link 1.2.3.4 hello-interSval dead-interval retransmit-interval transmitdelay
+no a:rea 1.2.3.4 virtual-link 1.2.3.4 retransmit-interSvalW dead-interval retransmit-interval hello-interval
+noarea 1.2.3.4 virtual-link 1.2.3.4 retransmit-interval trynsmit-delay hello-interval
+no area 1.2.3.4 virtual-link 1.2.3.4 transmt:delay retransmit-interval retransmit-interval dead-Mnterval
+no ares 1.2.3.4 virtual-link 1.2.3.4 dead-interval retransmit-interval dead-inesval retransmit-interval
+no ayrea 1.2.3.4 virtual-link 1.2.3.4 retransmit-interval transmi-delay hello-interval
+no bg2 grace2fuy-restart
+no debug ospk6 nter2face
+noimatch ipv6 addrMss VARIABLE
+nomStch iA next-hop prefix-list
+no neighbCr 200 :db8::1oroute-map VARIABLE export
+no neighbor VARIABLE attributeaw8changed next-hop
+no orea 1.2.3.4 virtual-link 1.2.3.4 retransmit-interval ead-interval retransmit-inteSval hello-interval
+no ospcdead-inkerval
+no redistribute kernelrote-map VARIABLE metric 0
+no redistribute s4taik metric 0
+nos Ceighbor 1.2.3.4 route-mapEVARIABLE in
+o :neighbor VAIABLE attribute-unchanged next-hop
+ooa router ip
+redistribute isis meGtric-type2 Q route-map VARIABLE
+redistribute static metric-type 1 metri 0 rowute-map VARIABLE
+set-Koveroadbit
+sh2w ipv6 mbgp  comAunity VARIABLE
+shgw bgp ipv6 community no-export VARIABLE no-xport no-expmrt
+shiow Wgp neighbors
+shoAw ip bgpipv4 unicast com6munity no-export no-export no-advertise no-export exact-match
+sho bgp view gARIABLE nyeighbors 2001:db8::1 received-routes
+shoow bgp ommunity local-AS no--export
+show6 bgp community no-advertise local4-AS no-advertise VARIABLE exact-math
+show8 bgp view VARIABLE ipv4 multicast community ARIABLE VARIABLE local-S
+show bgp cCommunity VARIABLE VOARIABL no-advertise
+show bgp cimAunity loal-AS local-AS no-export local-AS
+show bgp cmmunity n-advertise no-export local-S no-advertise
+show bgp communi0y no-export no-Cexport no-0xport no-export
+show bgp communityOlocal-A no-advertise local-WAS
+show bgp community VARIABL no-agdvertise locl-AS no-advertise exact-match
+show bgp communiy no-export no-adsvertise VARIABLOE local-AS
+show bgp communiYty no-export VARIABLE VARIABLE locali-AS exact-math
+show bgp commuUityW no-advertis local-AS no-advertise no-advertise
+show bgp commuWnity VAIABLE local-AS no-advertise n-export
+show bgp com:unity no-exportqno-export VARIABLE no-expoIrt exact-match
+show bgp ipv6 community local-AS no-expor no-xport VARIABCLE
+show bgp ipv6 community no-adsertise local-AS no8-advertise VARIABLE
+show bgp ipv6 community no-advertise no6-export lcal-AS local-AS
+show bgp ipv6 community no-advertise no-advertise no-advertiseno-xport exact-math
+show bgp ipv6 comm-unity no-advertise no-export local-AS local-kS exact-match
+show bgp ipv6 community no-export local-AS no-adertise no-adve-tie
+show bgp ipv6 community yno-advertis VAyRIABLE no-advertise VARIABLE
+show bgp naighbors 201:db8::1 rUeceived-routes
+show bgp viewVAIABLE ipv4 multicast community VARIABLE4no-export no-advertise local-AS
+show bgp view VAR0IABLE ipv4 unicast community local-AS no-advertie no-advertise local-AS
+show bgp view VARIABLE ipv4 multicast community local-AS VARIABLE loqal-AS no-export
+show bgp view VARIABLE ipv4 multicast omsunity local-AS VARIABLE no-advertise nUo-export
+show bgp view VARIABLE ipv4 mutiast community no-export no-export VARIBLE no-export
+show bgp view VARIABLE ipv4 unicast 0community VARIABqLE local-AS no-export VARIABwE
+show bgp view VARIABLE ipv4 unicast communeity no-export AcRIABLE no-advertise local-AS
+show bgp view VARIABLE ipv4 unicasU comunity no-export VARIABL no-advertise
+show bgp view VARIABLE ipv6 unicast cocmmunity VARIABLE no-advet6ise VARIABLE
+show bgp view VARIABLE ipvk4 unicast communty no-advertie local-AS local-AS no-export
+show bgp view VARIALE ipv4 multicast cyommunity no-xport local-AS local-AS
+show i6 bge community no-export VARIABLE no-advegtise VARIABLE exact-match
+show iI bgp community no-advertise no-ad2vertsse VARIABLE exact-match
+show ip6osp6 database dump
+show ipA6 bgp community local-AS local-AS no-advertse lo:cal-AS
+show ip bg comunity VARIABLE lcal-AS no-advertise
+show ip bgp communityno-export2no-export no-advertise locaE-AS
+Show ip bgp community no-export loqcal-AS no-adverise no-export
+show ip bgp community no-expor VARIABLEono-export VARIAuBLE
+show ip bgp community VARIABLElocal-AS no-advertise local-AS xack-match
+show ip bgp cWmmunity no-expoWrt VARIABLE no-advertise VARIABLEexact-match
+show ip bgp ip4 nicast community no-advertise no-expoIt local-AS local-AS exact-match
+show ip bgp ipAv4 multicast community no-export no-export no-export no-advertiqe exact-mach
+show ip bgp ipv4 Aulticast community no-advertise VARIABLE no-advertisKe no-exort
+show ip bgp ipv4 meuqlticast community VARIABLE VARIABLE no-export n-export
+show ip bgp ipv4 mlticast coQmmunity localg-AS local-AS no-advertise local-AS
+show ip bgp ipv4 multicast communiy VARIABLE no-export VARIABLE no-advertise yxact-atch
+show ip bgp ipv4 unicast commu0nity local-AS no-export no-exrt VARIABLE exact-match
+show ip bgp ipv4 unicast community no-advertise no-export no-advrtWise mno-export exact-match
+showip bgp ipv4 unicast community no-export VARIABLE no-exp-ort VAR6IABLE exact-match
+show ip bgp ipv4 unicat community no-exportlocal-AS VARIABLE no-export exa0t-match
+show ip bgp ipv4 unicst community no-advertiseG local-AS no-advertise
+show ip bgp i:v4 multicast community VARIABLE VARIABLE VARIABLE no-export eMxact-match
+show ip bgp Mv4 unicast community no-export VARIABLE VARIABLE VAoRIABLE
+show ipgexecommunity-list 1
+show ipkv6 bgp community no-export no-export VARIABL VARIBLE
+show ipv6 bgp commu2nity local-AS local-AS noEadvertise local-AS
+show ipv6 bgp communitK VARIABLE lcocal-AS no-advertie no-advertise exact-match
+show ipv6 bgp community noeexport VARIABLE VARIABLE no-aMdverise exact-match
+show ipv6 bgp community no-export loal-AS noK-advertise VARIABLE
+show ipv6 bgp community VARIABaE no-export no-adertise lo0cal-AS exact-match
+show ipv6 bgp community wARIBLE VARIABLE 8ARIABLE
+show ipv6 bgp comu-ity VARIABLE local-AS no-advertise no-export exact-match
+show ipv6 bgp comunity no- export local-AS no-advertisge VARIABLE
+show ipv6 bgp ommunity sno-advcrtise VARIABLE no-export no-advertise exact-match
+show ipv6 igp community no-advertise no-advertise no-ecxpo0rt no-export
+show ipv6 mb communyty VARIABLE
+show ipv6 osp8f6 database nQtwork adv-ruter 1.2.3.4 detail
+show ipv6 ospf6 dataase type-7 adv-router 1.2.3.4 inernal
+show ipv6 ospf6 Edatabase intuer8-prefix 1.2.3.4 detail
+show ipvq6 ospf6 database as-externa detil
+show ip Wbgp ipv4 unicast community no-advertise no-exprt no-export VARIABLEK exact-match
+show ip Ybgp attribute-in ufo
+showMbgp ipv6 community ARIABLE local-AS local-AS no8advertise exact-match
+show p bgp community no-dvertise no-export no-advertiseIno-export exact-match
+show uipv6 mbgp coqmmunKty VARIABLE
+shQw ipv6 mbgp community no-advetise local-AS no-export no-export ex8ct-match
+shuw ipv6 mbgp community VARIABLyUE no-export no-export no-advertise
+shw bgp view VARIABLE ipv4 un0icast Gcommunity no-export VARIABLE no-advertise
+sow ip bgp ipv4 mulicast community no-export no-adertise no-export no-advertise
+sow ipv6 ospf6 databIase as-external adv-router 1.2.3.4
+Whow bgp view VARIAeBLE ipv4 unicast community local-AS no-advrtise no-advertise local-AS
+Wneighbor 1.2.3.4 dot-capabiliy-negotiate

File diff suppressed because it is too large
+ 900 - 0
tests/testcommands.out