Commit Graph

634 Commits

Author SHA1 Message Date
Donald Sharp
bcbc98b0b9
Merge pull request #10242 from anlancs/fix-service-time
build: add "--with-service-timeout" in configure.ac
2022-01-08 07:15:37 -05:00
Donald Sharp
667cfdc824 tools: Run formatter over generate_support_bundle.py
The generate_support_bundle.py script needs some
reformating to meet our standards

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-06 08:18:30 -05:00
anlan_cs
fc539216ce build: add "--with-service-timeout" in configure.ac
On lower CPU with lots of static routes, it will cost more than 2
minutes.

2 minutes is the default timeout value, we can adjust it by configure:
./configure --with-service-timeout=<digit>

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2022-01-06 07:42:36 -05:00
anlan_cs
9dee14bdb8 tools: cleanup route convertion from null0/Null0 to blackhole
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-12-31 00:59:22 -05:00
Jonas Gorski
b321edc51b tools: fix backing up previous logs in generate_support_bundle.py
subprocess.check_call needs to be called with shell=True, else it will
interpret the string as a single path to execute instead of a command
with arguments:

Fixes the following error:

$ /usr/lib/frr/generate_support_bundle.py
Making backup of /var/log/frr/bgp_support_bundle.log
Traceback (most recent call last):
  File "/usr/lib/frr/generate_support_bundle.py", line 89, in <module>
    main()
  File "/usr/lib/frr/generate_support_bundle.py", line 80, in main
    stdout=open_with_backup(ofn),
  File "/usr/lib/frr/generate_support_bundle.py", line 32, in open_with_backup
    subprocess.check_call("mv {0} {0}.prev".format(path))
  File "/usr/lib/python3.8/subprocess.py", line 359, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mv /var/log/frr/bgp_support_bundle.log /var/log/frr/bgp_support_bundle.log.prev'

Fixes: 5417cc2de ("tests: collect support bundle data in parallel, fix bugs")
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
2021-12-15 10:41:49 +01:00
Quentin Young
d64d20fcd4
Merge pull request #9937 from Jafaral/rel-script 2021-12-13 12:26:22 -05:00
Russ White
46507be0fe
Merge pull request #10187 from chiragshah6/freload
tools: exit when reload fails to parse config file
2021-12-07 11:40:36 -05:00
Chirag Shah
3a442b25ec tools: exit when reload fails to parse config file
frr-reload triggers restart of service in case
it fails to parse new config file and conjunction with
running config contains 'router bgp' (default bgp instnace).

When frr-reload fails to parse new config file, it fails
to build newconfig context (empty object).
Instead of bailing out it compares against the running config
context. If the running config contains default bgp instance
it thinks new config is removing default bgp instance so it
triggers frr restart.

Fix is to to bail out reload script when it fails to parse
config file.

Ticket:#2861989
Reviewed By: MR-83
Testing Done:

router bgp 102 vrf RED
bgp router-id 2.2.2.2
neighbor underlay peer-group
neighbor underlay remote-as <---- Partial config

Before fix:
2021-12-02 02:43:16,987 ERROR: vtysh failed to process new
configuration: vtysh (mark file) exited with status 4:
b'line 79: % Command incomplete: neighbor underlay remote-as\n\n'
2021-12-02 02:43:17,145  INFO: Loading Config object from vtysh show
running
2021-12-02 02:43:17,362  INFO: "frr version 7.5+cl5.0.0u0" cannot be
removed
2021-12-02 02:43:17,362  INFO: "frr defaults datacenter" cannot be
removed
2021-12-02 02:43:17,362  INFO: "service integrated-vtysh-config" cannot
be removed
2021-12-02 02:43:17,363  INFO: "line vty" cannot be removed
2021-12-02 02:43:17,522  INFO: EVPN is enabled and default instance del
needed
2021-12-02 02:43:17,522  INFO: Restarting FRR          <---- Restart frr

After fix:

Just throw Error and abort the script.

root@TORS1:mgmt:/home/cumulus# /usr/lib/frr/frr-reload.py --debug
--reload --stdout /etc/frr/frr.conf
2021-12-02 04:00:56,519  INFO: Called via "Namespace(bindir='/usr/bin',
confdir='/etc/frr', daemon='', debug=True, filename='/etc/frr/$
rr.conf', input=None, overwrite=False, pathspace=None, reload=True,
rundir='/var/run/frr', stdout=True, test=False, vty_socket=None)"
2021-12-02 04:00:56,520  INFO: Loading Config object from file
/etc/frr/frr.conf
2021-12-02 04:00:56,679   ERROR: vtysh failed to process new
configuration: vtysh (mark file) exited with status 4:
b'line 79: % Command incomplete: neighbor underlay remote-as\n\n'
root@TORS1:mgmt:/home/cumulus#

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-12-06 14:20:57 -08:00
Jafar Al-Gharaibeh
339bd66fde tools: add a script to generate draft release changelog
This utility script helps in generated formatted and consistent
change log including:
       1- group logs per daemon
       2- standarize daemon names (lowercase, end with d)
       3- capitalize all log lines
       4- no merge commits

caveat: comments are assumed to be in the form

   daemon-name : message

Sample Output:

```
sharpd
    Follow the practice on cli design for json output
    Install route supports nexthop-seg6 (step3)
    Install_routes_helper support zapi_route flags (step1)

snapcraft
    Add missing dependency
    Add pathd to frr snap daemons
    Change base to ubuntu 18.04 and libyang 2.0.7

staticd
    Convert typedef to enum
    Fix distance processing
    Fix late initialization of blackhole type
    Output config using nb callbacks instead of operational data
```

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2021-12-06 13:44:57 -06:00
Chirag Shah
2134a5fe51 frr-reload: fix bgp nbr remote-as
Remove neighbor <> remote-as <> config line,
if the neighbor is part of the peer-group and
peer-group contains remote-as config.

Neighbors which are part of the peer-group
cannot override remote-as.

Fix:
Frr-reload needs to remote 'neighbor <> remote-as <>'
from lines_to_add if its already part of peer-group
and peer-group has remote-as config.

Testing Done:

Before:

Config snippet:
neighbor PEERS peer-group
neighbor PEERS remote-as external
neighbor PEERS timers 3 9
neighbor 10.2.1.1 remote-as external
neighbor 10.2.1.1 peer-group PEERS
neighbor 10.2.1.1 timers 3 9
neighbor 10.2.1.2 remote-as external
neighbor 10.2.1.2 peer-group PEERS

Frr-reload failure:
line 179: Failure to communicate[13] to bgpd, line:  neighbor 10.2.1.1
remote-as external
% Peer-group member cannot override remote-as of peer-group
line 179: Failure to communicate[13] to bgpd, line:  neighbor 10.2.1.2
remote-as external
% Peer-group member cannot override remote-as of peer-group

After:
frr-reload apply the config successfully.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-12-05 21:28:11 -08:00
Igor Ryzhov
cb3fa0a612
Merge pull request #10124 from ton31337/feature/vty_json 2021-11-29 02:11:29 +03:00
Donatas Abraitis
f615ecb96d tools: Convert vty_out to vty_json for JSON
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25 17:49:25 +02:00
Donatas Abraitis
15116b0069 tools: Replace prefix2str for JSON to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25 17:26:26 +02:00
Donatas Abraitis
8b3c84254d tools: Add coccinelle script to replace inet_ntop inside JSON
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18 11:32:46 +02:00
Donald Sharp
8e653596c4 tools, vtysh: Remove final vestige of address-family evpn
This was deprecated over a year ago now.  Let's finally
remove it from the system.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-17 07:49:56 -05:00
Donald Sharp
23ee09601b tools: Add another valgrind suppression for libyang
More memory leaks from libyang that we can just ignore

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-15 15:06:58 -05:00
Quentin Young
6e09a5bfea tools: simplify excessively complex conditional
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-11-12 13:37:09 -05:00
Quentin Young
d2863e4a6b tools: string literals -> comments
Convert all floating string literals being used as comments, to comments

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-11-12 13:18:52 -05:00
David Lamparter
7c1803d0a0 tools: remove Linux kernel bits from checkpatch
These aren't appropriate for use in FRR.  Among other things, this
enables running checkpatch by calling it in a git working tree with
`tools/checkpatch.pl -g origin/master..`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00
David Lamparter
4d619e25ab tools: add iterators to checkpatch
For the purpose of allowing the space in `frr_each (`, copy the list of
iterators from .clang-format and wire it up appropriately.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00
Anuradha Karuppiah
32dcd36d29 tools: upstream linter is recommending double quotes
Replaced single quotes with double quotes for strings in
the frr_babeltrace.py utility.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-10-15 10:37:45 -07:00
Anuradha Karuppiah
b9c3be8be2 tools: add frr_babeltrace.py to /usr/lib/frr
Make the script available as a part of the FRR package install for
ease of use.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-10-15 10:37:02 -07:00
Anuradha Karuppiah
a383bfc7c9 bgpd: lttng tracepoint for local events received from zebra
TPs -
=====
root@ibm-2410a1-01:mgmt:~# lttng list --userspace |grep frr_bgp:evpn.*recv
      frr_bgp:evpn_local_l3vni_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_l3vni_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_macip_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_macip_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_vni_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_vni_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_evi_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_evi_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
root@ibm-2410a1-01:mgmt:~#

Sample output -
===============
1. ES
frr_bgp:evpn_mh_local_es_add_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vtep': '27.0.0.15', 'active': 0, 'bypass': 0, 'df_pref': 50000}
frr_bgp:evpn_mh_local_es_del_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01'}

2. ES-EVI
frr_bgp:evpn_mh_local_es_evi_add_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vni': 1004}
frr_bgp:evpn_mh_local_es_evi_del_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vni': 1001}

3. L2-VNI
frr_bgp:evpn_local_vni_add_zrecv {'vni': 1004, 'vtep': '27.0.0.15', 'mc_grp': '239.1.1.104', 'vrf': 97}

4. L3-VNI
frr_bgp:evpn_local_l3vni_add_zrecv {'vni': 4001, 'vrf': 87, 'svi_rmac': '24:8a:07:cc:aa:5f', 'vrr_rmac': '24:8a:07:cc:aa:5f', 'vtep': '27.0.0.15', 'filter': 0, 'svi_ifindex': 95, 'anycast_mac': 'n'
frr_bgp:evpn_local_l3vni_del_zrecv {'vni': 4003, 'vrf': 107}

5. MAC-IP
frr_bgp:evpn_local_macip_add_zrecv {'vni': 1003, 'mac': '00:02:00:00:00:04', 'ip': 'fe80::202:ff:fe00:4', 'flags': 4, 'seq': 0, 'esi': '03:44:38:39:ff:ff:01:00:00:02'}
frr_bgp:evpn_local_macip_del_zrecv {'vni': 1000, 'mac': '00:02:00:00:00:04', 'ip': '2001:fee1::4', 'state': 1}

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-10-15 10:37:02 -07:00
anlan_cs
1bdffcf01c tools: fix wrong get_contexts() of Config class.
Calling get_contexts() can't display as expected, it wrongly displays:
<__main__.Context object at 0x7fdee1d5ad50>

So make it display correct data by add __str__ in Context class.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-10-09 04:15:55 -04:00
Donatas Abraitis
c08050d6d1 tools: Catch double pointer of struct thread towards thread_add_*
```
% spatch --sp-file tools/coccinelle/struct_thread_double_pointer.cocci --macro-file tools/cocci.h ./ 2>/dev/null
./lib/northbound_confd.c:429:65-66: Passed double 'struct thread' pointer
./lib/northbound_confd.c:1174:61-62: Passed double 'struct thread' pointer
./lib/northbound_sysrepo.c:543:69-70: Passed double 'struct thread' pointer
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-07 16:25:03 +03:00
Russ White
334d9d259f
Merge pull request #9731 from ton31337/fix/thread_null_set
cleanup: struct thread = NULL
2021-10-05 19:27:23 -04:00
Donatas Abraitis
83e66fdfd6 tools: Add coccinelle script to catch thread to NULL assignments
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:29:06 +03:00
Anuradha Karuppiah
23aa35ade5 bgpd: initial batch of evpn lttng tracepoints
Low overhead bgp-evpn TPs have been added which push data out in a binary
format -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@switch:~# lttng list --userspace |grep "frr_bgp:evpn"
      frr_bgp:evpn_mh_nh_rmac_zsend (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint)
      frr_bgp:evpn_mh_nh_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_nhg_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_vtep_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_bum_vtep_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mac_ip_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
root@switch:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

In addition to the tracepoints a babeltrace python plugin for pretty
printing (binary data is converted into grepable strings). Sample usage -
frr_babeltrace.py trace_path

Sample tracepoint output -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1. frr_bgp: evpn_mac_ip_zsend
frr_bgp:evpn_mac_ip_zsend {'action': 'add', 'vni': 1007, 'mac': '00:02:00:00:00:04', 'ip': 'fe80::202:ff:fe00:4', 'vtep': '27.0.0.15', 'esi': '03:44:38:39:ff:ff:01:00:00:02'}

2. frr_bgp: evpn_mh_vtep_zsend
frr_bgp:evpn_mh_vtep_zsend {'action': 'add', 'esi': '03:44:38:39:ff:ff:01:00:00:02', 'vtep': '27.0.0.16'}

3. frr_bgp: evpn_mh_nhg_zsend
frr_bgp:evpn_mh_nhg_zsend {'action': 'add', 'type': 'v4', 'nhg': 74999998, 'esi': '03:44:38:39:ff:ff:01:00:00:02', 'vrf': 85}

4. frr_bgp: evpn_mh_nh_zsend
frr_bgp:evpn_mh_nh_zsend {'nhg': 74999998, 'vtep': '27.0.0.16', 'svi': 93}

5. frr_bgp: evpn_mh_nh_rmac_zsend
frr_bgp:evpn_mh_nh_rmac_zsend {'action': 'add', 'vrf': 85, 'nh': '::ffff:1b00:12', 'rmac': '00:02:00:00:00:50'}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-10-01 09:02:25 -07:00
Donatas Abraitis
94ca37e0a9 tools: Add coccinelle script to catch \n or \r at the end of zlog_*
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-09-27 15:21:52 +03:00
Donald Sharp
cd8aaf076e tools: Add some new suppressions
Bunch of new stuff came in w/ the libyang2 upgrade that needs
to be suppressed.  Make it so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-21 07:54:54 -04:00
Quentin Young
32acb4a7ad
Merge pull request #9497 from opensourcerouting/cli-better-no 2021-09-09 12:22:53 -04:00
Christian Hopps
a53c08bc13 tests: cleanup: rerun changed files through black
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
4953ca977f tests: cleanup - remove unused imports
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
77a7a87cdd tools: move frr-reload.py to python3 explicitly
We already, reasonably, require python3 elsewhere. Do so here, and reap some
benefit.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
David Lamparter
b8f9523597
Merge pull request #9340 from stefreak/patch-1
tools: fix frr pathspace folder permissions
2021-09-02 13:24:44 +02:00
David Lamparter
90c8406c20 lib: add ![...] syntax for easy "no" forms
This allows defining a CLI command like this:
  `[no] some setting ![VALUE]`
with VALUE being optional for the "no" form, but required for the
positive form.  It's just a `[...]` where the empty branch can only be
taken for commands starting with `no`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-08-26 21:03:44 +02:00
Igor Ryzhov
fc43980f25 tools: significantly simplify frr-reload context processing
Currently, in frr-reload we:
- store a list of single-line context keywords which needs to be
  frequently updated,
- have a separate "if" clause for every node and subnode we have in FRR.

Instead, we can store the tree of all known FRR nodes. This tree needs
to be updated whenever we add a new node, which is not frequent. And,
most importantly, it allows us to write node-agnostic code and save more
than 250 LOC.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-23 22:08:20 +03:00
Igor Ryzhov
541af473f9
Merge pull request #9341 from LabNConsulting/chopps/ospf-support-bundle
tools: add ospfd support bundle commands
2021-08-18 14:40:08 +03:00
Donald Sharp
061bf350dd
Merge pull request #9271 from opensourcerouting/workflow-release-sched
workflow: document release scheduling discussed
2021-08-14 09:06:23 -04:00
David Lamparter
dc1c0bc2b3 workflow: document release scheduling discussed
As discussed in the weekly meeting today, this is what we're trying to
work with for the time being.

(Date calculator included as a bonus goodie ;)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-08-11 16:37:46 +02:00
Christian Hopps
36cd3e81e8 tools: add ospfd support bundle commands
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-10 07:39:18 +00:00
Christian Hopps
cb04c8e906
Merge pull request #9219 from mobash-rasool/ospfv2-bug-fixes
tools: Add ospfv2 and ospfv3 commands in support bundle
2021-08-10 03:14:43 -04:00
Steffen Neubauer
0fc6a5f8ed tools: fix frr pathspace folder permissions
The pathspace folder in /var/run needs the x permission for the group too

Otherwise vtysh fails when running it with groups frrvty and frr:

    $ vtysh -N gateway
    % Can't open configuration file /etc/frr/gateway/vtysh.conf due to 'Permission denied'.
    vtysh_connect(/var/run/frr/gateway/zebra.vty): stat = Permission denied

Signed-off-by: Steffen Neubauer <s.neubauer@syseleven.de>
2021-08-09 13:54:58 +02:00
Donald Sharp
a66413a53b
Merge pull request #8870 from anlancs/master-fix-reload-service
tools: add "vni" to oneline list
2021-08-08 07:21:10 -04:00
Mobashshera Rasool
54d8e033f3 tools: Add ospfv3 commands in the support bundle
Co-authored-by: Yash Ranjan <ranjyany@vmware.com>
Signed-off-by: Yash Ranjan <ranjyany@vmware.com>
Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-30 05:14:26 -07:00
Mobashshera Rasool
34e96abf2e tools: Add ospfd commands in support bundle
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-30 03:52:45 -07:00
Christian Hopps
be4a9b0570 tools: improve frr-reload.py delta file creation
- Remove incorrect requirement for `service integrated-vtysh-config`
  when producing a delta.
- Add `--test-reset` option which suppresses non-parseable lines from the
  produced delta
- Use new features in common_config.py

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-07-15 22:12:01 -04:00
Donatas Abraitis
107df351c6 tools: Add coccinelle script for hash compare functions NULL values
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-07-13 08:49:38 +03:00
Donald Sharp
acb4c44ef8
Merge pull request #8942 from ton31337/fix/cleanups_2
Another round of cleanup
2021-07-06 09:47:41 -04:00
Donald Sharp
432bb280fb
Merge pull request #8939 from LabNConsulting/chopps/sup-bund-fixes
Speedup support bundles, fix bugs, add CLI timestamp
2021-07-06 07:58:19 -04:00
Igor Ryzhov
c54e2a8144 tools: Simplify the script to build Debian binary package
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2021-07-03 17:02:37 +02:00
Ondřej Surý
dfbc6c046e debian: Add support for Debian bullseye to the packaging script
The Debian bullseye is frozen now, so this adds support to this
Debian release to the packaging script.

Signed-off-by: Ondřej Surý <ondrej@sury.org>
2021-07-03 17:02:37 +02:00
Ondřej Surý
9ea548cf3c debian: Fix the debian packaging script to build on non-default branch
The packaging script would fail to run on non-master branch, fix that
by pulling original branch name.

Signed-off-by: Ondřej Surý <ondrej@sury.org>
2021-07-03 17:02:37 +02:00
Ondřej Surý
223766ead4 debian: Update the tools/build-debian-package.sh to be example build script
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2021-07-03 17:02:37 +02:00
Ondřej Surý
aa1e17f5ca debian: Remove now obsolete tarsource.sh script
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2021-07-03 17:02:37 +02:00
Ondřej Surý
06417e9f18 debian: Remove the changelog-auto automation in favor of dch
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2021-07-03 17:02:37 +02:00
Ondřej Surý
bcd053ee8d debian: Update tools/build-debian-package.sh to use git-buildpackage
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2021-07-03 17:02:37 +02:00
Ondřej Surý
25785834af debian: Adjust tarsource.sh to use native debian/changelog
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2021-07-03 17:02:37 +02:00
Christian Hopps
5417cc2de3 tests: collect support bundle data in parallel, fix bugs
Speedup (large topo): OLD: ~6 minutes NEW: ~1 second.
  (when paired with common_config.py changes)
- Collect each "proc" support in parallel
- For each "proc" only call vtysh once with all commands

Bug fixes:
- output was broken, a dump of python "repr" format of str.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-30 15:46:10 +00:00
anlancs
470d316e3e tools: add "vni" to oneline list
Add "vni" into oneline list.
Additionally, keep them in order in oneline list.

Signed-off-by: anlancs <anlan_cs@tom.com>
2021-06-30 16:28:37 +08:00
Donatas Abraitis
63f7a3b910 tools: Add coccinelle script for checking against XMALLOC/XCALLOC NULLs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-06-29 22:27:50 +03:00
Donald Sharp
6293c2181a tools: limit bgp route-maps to direct changes only
When using frr-reload.py to modify a bgp neighbors route-map
the code was doing this:

a) deleting the previous route-map: `no neighbor XX route-map YY (in|out)`
b) Adding the new route-map back in `neighbor XX route-may ZZ (in|out)`

Now imagine that we have an outgoing route-map that we are changing
and the reload is large because of a large number of lines in frr.conf

Item (a) will happen.  BGP will immediately start sending all local
routes.  At some point in time in the future (b) will be applied.
This of course causes a withdraw but for a short amount of time we
are leaking unintended routes.  This is bad for several reasons
not 1) route churn upstream, 2) we might influence traffic to go the
wrong way. 3) if upstream has a maximum-prefix command the routes
being sent might trip its circuitry and shutdown the peer entirely
not even allowing you to get to (b).

Ticket: #2589685
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-23 10:19:00 -04:00
Patrick Ruddy
fa855f8fa3
Merge pull request #6695 from adharkar/frr-master-gateway_ip
EVPN route type-5 gateway IP overlay Index
2021-06-23 09:23:54 +01:00
Mark Stapp
a78dde0dcd
Merge pull request #8867 from wesleycoakley/pbr-table-range-single-line
tools: make frr-reload recognize `pbr table range` lines as single-line contexts
2021-06-22 09:12:02 -04:00
Don Slice
1443e23148 tools: add mac access-list context to frr-reload.py
Problem reported that frr-reload.py didn't handle the mac access-list
command correctly, causing reloads to fail.  This fix adds the
support for the command as a single line context.

Signed-off-by: Don Slice <dslice@nvidia.com>
2021-06-18 08:09:02 -07:00
Wesley Coakley
cbfb52986f
tools: reload recognizes pbr table range as single-line ctx
The line `pbr table range ...` does not start a new context so treat it
like a single-line context

Signed-off-by: Wesley Coakley <w@wesleycoakley.com>
2021-06-16 20:34:30 -04:00
Ameya Dharkar
fb651da9e2 tools: Add EVPN show commands to support bundle
Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2021-06-07 17:59:45 -07:00
Quentin Young
c99313762a
Merge pull request #8353 from opensourcerouting/llvm-20210327 2021-06-01 19:08:32 +00:00
Rafael Zalamena
6c1a2a6538
Merge pull request #6317 from rgirada/fix_route_dump
zebrad: Added a command to dump routes in support bundle
2021-05-28 18:12:17 -03:00
Chirag Shah
934c84a02b tools: fix peer-group deletion in frr-reload
All of peers and respective configs are wiped out when
pee-group is removed.

In an attempt to remove peer-group and its associated peers
configs via frr-reload fails if the peer-group is removed first.

To pass the peer-group config removal via frr-reload following
steps are taken:
Find the bgp context to which peer-group belongs.
Find the peer-group associated peer(s) and store them in a list.
Remove the peers config lines from the pending list.
Move the peer-group deletion line to end of the pending list so
any remaining peer-group associated config can be removed successfully.

The above steps take 3 iterations over the pending list and scales
linearly.

Ticket:2656351
Reviewed By:CCR-11575
Testing Done:

Broken:

config:
router bgp 5544
 neighbor PG1 peer-group
 neighbor PG1 remote-as external
 neighbor swp10 interface peer-group PG1
 neighbor swp10 timers 3 9

failed frr-reload log:
2021-05-17 22:02:42,608  INFO: Executed "router bgp 5544  no neighbor
PG1 peer-group"
2021-05-17 22:02:42,708  INFO: Failed to execute router bgp 5544  no
neighbor PG1 remote-as external
2021-05-17 22:02:42,808  INFO: Failed to execute router bgp 5544  no
neighbor PG1 remote-as
2021-05-17 22:02:42,906  INFO: Failed to execute router bgp 5544  no
neighbor PG1
2021-05-17 22:02:43,007  INFO: Failed to execute router bgp 5544  no
neighbor
2021-05-17 22:02:43,106  INFO: Failed to execute router bgp 5544  no
2021-05-17 22:02:43,106 ERROR: "router bgp 5544 --  no" we failed to
remove this command
2021-05-17 22:02:43,107 ERROR: % Create the peer-group or interface
first

With fix:
2021-05-17 22:05:27,687  INFO: Executed "router bgp 5544  no neighbor
PG1 remote-as external"
2021-05-17 22:05:27,791  INFO: Executed "router bgp 5544  no neighbor
PG1 peer-group"

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-05-24 16:06:24 -07:00
Christian Hopps
3bb513c399 lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of:
https://github.com/CESNET/libyang

staticd init load time of 10k routes now 6s vs ly1 time of 150s

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-13 16:24:48 -04:00
David Lamparter
0f12ac7f12
Merge pull request #8472 from donaldsharp/more_valgrind_stuff
tools: Add some more data to ignore for valgrind
2021-05-09 19:20:47 +02:00
Igor Ryzhov
d0bb3c542c
Merge pull request #8632 from wesleycoakley/le-32-128-fix
lib: ip prefix-list "le" and "ge" bug squish
2021-05-07 12:05:59 +03:00
Wesley Coakley
d7e594edd2
tools: stop frr-reload squashing le 32 / le 128
frr-reload no longer consolidates ip prefix-list "le 32" or "le 128"
rules when a "ge" is present, more accurately representing existing user
config and reflecting also what is accepted in CLI.

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-05-06 12:31:37 -04:00
rgirada
d29fd1b72e zebrad: Added a command to dump routes in support bundle
Description:
Added a new show command("show ip zebra route dump") to dump all routes
with detailed information including nexthops,flags, status ..etc.
This helps for dubugging and added to support_bundle_command.conf.
Defined this command as a hidden command.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-05-06 02:40:12 -07:00
Donald Sharp
56b99116f2 tools: Add some more data to ignore for valgrind
When running valgrind there are some possible memory leaks.
These memory leaks we have absolutely no control over, mark
them as not worthy of being reported.

Finally move the valgrind suppressions file from bgpd/ to tools/
this is because this suppressions file can be used beyond bgpd

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-05 10:52:51 -04:00
David Lamparter
64dd77361f lib: rework how we "override" assert()
The previous method, using zassert.h and hoping nothing includes
assert.h (which, on glibc at least, just does "#undef assert" and puts
its own definition in...) was fragile - and actually broke undetected.

Just provide our own assert.h and control overriding by putting it in a
separate directory to add to the include path (or not.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:27:17 +02:00
Donald Sharp
61dc17d8cb tools: Cleanup frr-reload.py by running black on it
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-21 08:59:22 -04:00
Donald Sharp
0ed6a49d90 tools: Fix warning when running frr-reload.py
When I run frr-reload.py I am seeing this error:

Apr 21 06:23:51 eva frrinit.sh[3776992]: /usr/lib/frr/frr-reload.py:1094: SyntaxWarning: "is not" with a literal. Did you mean "!="?
Apr 21 06:23:51 eva frrinit.sh[3776992]:   if line is not "exit-vrf":

fix

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-21 08:57:29 -04:00
Quentin Young
6c8bdfd569 tools: add note to users re: frr.conf overwrite
Most software doesn't overwrite its own config files; vtysh's 'wr mem'
may be confusing, so add a note to the config file explaining changes
made may be overwritten.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-09 13:14:30 -04:00
David Lamparter
b0b14dfdd1 tools: dump YANG info in frr-llvm-cg
Since all of these function pointers are entry points for YANG actions,
they're useful to have in the call graph.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-07 22:31:54 +02:00
David Lamparter
d71449a3f7 tools: grok struct member calls in frr-llvm-cg
Calling a function pointer embedded in a struct is quite common & having
this listed in the call graph is useful.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-07 22:31:25 +02:00
Quentin Young
2a9d6bce5a
Merge pull request #8384 from volta-networks/fix_no_srb_block
tools: do in-place SRGB/SRLB changes
2021-04-06 03:44:25 +00:00
Quentin Young
63f1943136
Merge pull request #8364 from stipmonster/master
Added pathd to the init files
2021-04-04 00:33:19 +00:00
Emanuele Di Pascale
5ad4633333 tools: do in-place SRGB/SRLB changes
avoid issuing a [no] command if we are then issuing the affirmative
one. This avoids spurious requests for the default label ranges,
which might fail if something else is using those labels.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2021-04-01 10:35:57 +02:00
Don Slice
00302a580c tools: frr-reload fixes for deleting vrf static routes
Problems reported that in certain cases, frr-reload.py would
delete vrf static routes inadvertantly due to two different
reasons. First, vrf statics with null0 or Null0 nexthops would
fail the match since rendered as blackholes.  This was already
fixed for non-vrf statics so added for vrf-based.  Second,
frr-reload would fail to match due to different formats for
adding the command. If entered in the old way
"ip route x.x.x.x/x y.y.y.y vrf NAME" and rendered
in the new sway "vrf NAME\nip route x.x.x.x/x y.y.y.y" it would
fail to match do an inadvertant delete.

Ticket: 2570270
Signed-off-by: Don Slice <dslice@nvidia.com>
2021-03-31 09:38:59 -07:00
Don Slice
880dcb06e4 tools: frr-reload.py changes to make black happy
Since black is finding issues before applying my change, committing
those changes separately

Signed-off-by: Don Slice <dslice@nvidia.com>
2021-03-31 09:38:59 -07:00
Erik Kooistra
f8ca116ef0 tools: Added pathd to the relevant init files
Currently pathd is missing from the deamon list in frrcommon
with this missing frrinit can't start pathd if it is added to
the deamon file. This commit adds it to the frrcommon deamon list
and updates the example deamon file.

Signed-off-by: Erik Kooistra <me@erikkooistra.nl>
2021-03-29 15:42:35 +02:00
David Lamparter
49fc8264e9 tools: adapt frr-llvm-cg to xref changes
These caused some function names to change, which frr-llvm-cg looks at
in order to improve callgraph accuracy.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-27 20:59:45 +01:00
David Lamparter
fa03d806ef build: ignore frr-llvm-cg binary
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-27 20:59:39 +01:00
David Lamparter
bcf9d7d8aa tools/gcc-plugin: support [un]signed in pragma
Need `unsigned char *` for `%pHX`.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-26 17:51:55 +01:00
David Lamparter
23922bbc08 tools/gcc-plugin: fix format precision/width type
`%*.*pEXT` applied the extension type to the precision and width (*.*)
too.  Oops.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-26 17:51:55 +01:00
Donald Sharp
1a6aa9d098
Merge pull request #8341 from simondeziel/systemd-onfailure
systemd's %n already includes the type suffix (.service)
2021-03-25 15:00:13 -04:00
Donald Sharp
95a2b8f9eb
Merge pull request #8252 from SaiGomathiN/8249
pimd: support bundle commands added
2021-03-25 11:52:12 -04:00
Simon Deziel
489faf5e4a tools: fix systemd OnFailure directive
systemd's %n already includes the type suffix (.service)

Signed-off-by: Simon Deziel <simon@sdeziel.info>
2021-03-25 10:37:23 -04:00
David Lamparter
5493cdf55e tools: run vtysh -b once for all-startup
As noted by Donald:

When FRR is starting all daemons (or restarting them all) FRR is reading
in the configuration 1 time for each daemon specified to run. This is
not a big deal if you have a very small configuration. But with large
configurations FRR is taking long enough that watchfrr is not
establishing connection to all the daemons and starting some over.

Modify the code so that vtysh is only read in at the end of a all
sequence. If we are restarting an individual daemon allow the read in of
the whole config.

Reported-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-22 20:21:19 +01:00
nsaigomathi
79c889228f tools: Add pimd support bundle commands
PIM Support Bundle commands are added in support_bundle_commands.conf file.
It will help us in debugging PIM test Failures.

Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-03-17 06:48:29 -07:00
Donald Sharp
30643d6f31
Merge pull request #8155 from idryzhov/zebra-support-bundle
zebra support bundle fixes and improvements
2021-03-16 13:00:37 -04:00
Donatas Abraitis
293b8b9529
Merge pull request #8214 from chiragshah6/mdev
tools: frr-reload refine error handling
2021-03-16 09:28:03 +02:00
Jafar Al-Gharaibeh
fe67f1f929 tools: add explicit licence phrase
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2021-03-10 11:31:25 -06:00