mirror_frr/tests
Dinesh G Dutt 5cb5f4d04d bgpd: Eliminate all incorrect formulations of afi/safi in JSON
In a number of places, the JSON output had invalid key names for
AFI/SAFI. For example, the key name in JSON was "IPv4 Unicast" which
is invalid as a JSON Key name. Many JSON tools such as those used in
Ansible, jq etc. all fail to parse the output in these scenarios. The
valid name is ipv4Unicast. There's already a routine afi_safi_json()
defined to handle this change, but it was not consistently called.
The non-JSON version was called afi_safi_print() and it merely returned
the CLI version of the string, didn't print anything.

This patch deals with this issue by:
   - Renaming afi_safi_print to get_afi_safi_str()
   - get_afi_safi_str takes an additional param, for_json which if true
     will return the JSON-valid string
   - Renaming afi_safi_json to get_afi_safi_json_str()
   - Creating a new routine get_afi_safi_vty_str() for printing to vty
   - Consistently using get_afi_safi_str() with the appropriate for_json
     value

Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
2019-08-27 14:05:39 +00:00
..
bgpd bgpd: Eliminate all incorrect formulations of afi/safi in JSON 2019-08-27 14:05:39 +00:00
helpers lib: Add '--command-log-always` to all daemons startup 2019-05-31 10:06:42 -04:00
isisd isisd: Don't set subtlv structure if we didn't unpack any subtlvs 2019-05-10 13:24:38 +02:00
lib Merge pull request #4497 from opensourcerouting/rcu 2019-08-08 08:41:07 -04:00
ospf6d build: non-recursive tests 2018-09-08 21:26:54 +02:00
topotests bgpd: Eliminate all incorrect formulations of afi/safi in JSON 2019-08-27 14:05:39 +00:00
.gitignore tests: add prefix2str test 2019-06-13 18:30:28 +00:00
Makefile build: non-recursive tests 2018-09-08 21:26:54 +02:00
pytest.ini tests: Exclude topotests from consideration 2018-11-27 20:22:10 -05:00
runtests.py tests: add pytest testrunners 2017-02-13 17:43:47 +01:00
subdir.am lib: remove snprintf from prefix2str 2019-06-13 17:08:05 +00:00