From 1d84ff5bd923dfc3ed70d2b8619f5e070b9cb414 Mon Sep 17 00:00:00 2001 From: arlakshm <55814491+arlakshm@users.noreply.github.com> Date: Thu, 17 Feb 2022 18:31:30 -0800 Subject: [PATCH] remove staticd.conf (#9657) resolves #8979 and #9055 How I did it Remove the file static.conf.j2,which adds the default route on eth0 from frr docker Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan --- dockers/docker-fpm-frr/frr/frr.conf.j2 | 2 -- dockers/docker-fpm-frr/frr/staticd/staticd.conf.j2 | 2 -- .../frr/staticd/staticd.default_route.conf.j2 | 10 ---------- .../tests/data/sonic-cfggen/frr.conf.j2/all.conf | 4 ---- .../tests/data/sonic-cfggen/staticd/staticd.conf | 2 -- .../tests/data/sonic-cfggen/staticd/staticd.conf.json | 5 ----- .../sonic-cfggen/staticd/staticd.default_route.conf | 4 ---- .../staticd/staticd.default_route.conf.json | 7 ------- src/sonic-bgpcfgd/tests/test_sonic-cfggen.py | 6 ------ src/sonic-config-engine/tests/sample_output/frr.conf | 4 ---- src/sonic-config-engine/tests/test_frr.py | 2 -- 11 files changed, 48 deletions(-) delete mode 100644 dockers/docker-fpm-frr/frr/staticd/staticd.default_route.conf.j2 delete mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf delete mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf.json diff --git a/dockers/docker-fpm-frr/frr/frr.conf.j2 b/dockers/docker-fpm-frr/frr/frr.conf.j2 index 9e5def4ba0..278855e693 100644 --- a/dockers/docker-fpm-frr/frr/frr.conf.j2 +++ b/dockers/docker-fpm-frr/frr/frr.conf.j2 @@ -13,7 +13,5 @@ agentx ! {% include "zebra/zebra.interfaces.conf.j2" %} ! -{% include "staticd/staticd.default_route.conf.j2" %} -! {% include "bgpd/bgpd.main.conf.j2" %} ! diff --git a/dockers/docker-fpm-frr/frr/staticd/staticd.conf.j2 b/dockers/docker-fpm-frr/frr/staticd/staticd.conf.j2 index 932871dfce..921fc3f557 100644 --- a/dockers/docker-fpm-frr/frr/staticd/staticd.conf.j2 +++ b/dockers/docker-fpm-frr/frr/staticd/staticd.conf.j2 @@ -8,5 +8,3 @@ ! {% include "common/daemons.common.conf.j2" %} ! -{% include "staticd.default_route.conf.j2" %} -! diff --git a/dockers/docker-fpm-frr/frr/staticd/staticd.default_route.conf.j2 b/dockers/docker-fpm-frr/frr/staticd/staticd.default_route.conf.j2 deleted file mode 100644 index 22d61ebbd0..0000000000 --- a/dockers/docker-fpm-frr/frr/staticd/staticd.default_route.conf.j2 +++ /dev/null @@ -1,10 +0,0 @@ -! -{% block default_route %} -! set static default route to mgmt gateway as a backup to learned default -{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} -{% if prefix | ipv4 %} -ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 -{% endif %} -{% endfor %} -{% endblock default_route %} -! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf index 4cf456052b..8beebc4af7 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf @@ -32,10 +32,6 @@ link-detect ! !! ! -! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 10.10.10.1 200 -!! -! ! template: bgpd/bgpd.main.conf.j2 ! ! bgp multiple-instance diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf index 522c0d36f2..1495bc679e 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf @@ -14,6 +14,4 @@ log facility local4 ! ! end of template: common/daemons.common.conf.j2! ! -! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 10.10.10.1 200 !! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf.json index 37f660d101..2e578b9fdd 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf.json +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf.json @@ -3,10 +3,5 @@ "localhost": { "hostname": "new_hostname" } - }, - "MGMT_INTERFACE": { - "eth0|10.10.10.10/24": { - "gwaddr": "10.10.10.1" - } } } diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf deleted file mode 100644 index 11adb98ebc..0000000000 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf +++ /dev/null @@ -1,4 +0,0 @@ -! -! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 10.10.10.1 200 -! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf.json deleted file mode 100644 index 80cd218a79..0000000000 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "MGMT_INTERFACE": { - "eth0|10.10.10.10/24": { - "gwaddr": "10.10.10.1" - } - } -} diff --git a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py index d10ec65d21..762cbccd90 100644 --- a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py +++ b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py @@ -72,12 +72,6 @@ def test_common_functions(): "common/functions.conf.json", "common/functions.conf") -def test_staticd_default_route(): - run_test("staticd.default_route.conf.j2", - "staticd/staticd.default_route.conf.j2", - "staticd/staticd.default_route.conf.json", - "staticd/staticd.default_route.conf") - def test_staticd(): run_test("staticd.conf.j2", "staticd/staticd.conf.j2", diff --git a/src/sonic-config-engine/tests/sample_output/frr.conf b/src/sonic-config-engine/tests/sample_output/frr.conf index 8e84f31ee9..77a8dea5b1 100644 --- a/src/sonic-config-engine/tests/sample_output/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/frr.conf @@ -35,10 +35,6 @@ link-detect ! !! ! -! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 10.0.0.1 200 -!! -! ! template: bgpd/bgpd.main.conf.j2 ! ! bgp multiple-instance diff --git a/src/sonic-config-engine/tests/test_frr.py b/src/sonic-config-engine/tests/test_frr.py index dd41e17117..f9229d9793 100644 --- a/src/sonic-config-engine/tests/test_frr.py +++ b/src/sonic-config-engine/tests/test_frr.py @@ -60,6 +60,4 @@ class TestCfgGen(TestCase): def test_zebra_frr(self): self.assertTrue(*self.run_case('zebra/zebra.conf.j2', 'zebra_frr.conf')) - def test_staticd_frr(self): - self.assertTrue(*self.run_case('staticd/staticd.conf.j2', 'staticd_frr.conf'))