Skip to content

Commit

Permalink
[sonic-config-engine]: Fix ndppd.conf test
Browse files Browse the repository at this point in the history
Signed-off-by: Lawrence Lee <[email protected]>
  • Loading branch information
theasianpianist committed Oct 2, 2020
1 parent 9eb476c commit 6299775
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
# See man page for ndppd.conf.5 for descriptions of all available options

proxy Vlan1000 {
rule fc01:1000::/64 {
static
}
rule fc02:1000::/64 {
static
}
rule fc03:1000::/64 {
static
}
rule fc01:1000::/64 {
static
}
}

proxy Vlan2000 {
Expand Down
25 changes: 25 additions & 0 deletions src/sonic-config-engine/tests/sample_output/py3/ndppd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# =========== Managed by sonic-cfggen -- DO NOT edit manually! ====================
# Generated by /usr/share/sonic/templates/ndppd.conf.j2 using config DB data
# File: /etc/ndppd.conf
#
# Config file for ndppd, the NDP Proxy Daemon
# See man page for ndppd.conf.5 for descriptions of all available options

proxy Vlan1000 {
rule fc02:1000::/64 {
static
}
rule fc03:1000::/64 {
static
}
rule fc01:1000::/64 {
static
}
}

proxy Vlan2000 {
rule fc01:2000::/64 {
static
}
}

7 changes: 2 additions & 5 deletions src/sonic-config-engine/tests/test_j2files.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,11 @@ def test_ipinip_multi_asic(self):
def test_ndppd_conf(self):
conf_template = os.path.join(self.test_dir, "ndppd.conf.j2")
vlan_interfaces_json = os.path.join(self.test_dir, "data", "ndppd", "vlan_interfaces.json")
expected = os.path.join(self.test_dir, "sample_output", "ndppd.conf")
expected = os.path.join(self.test_dir, "sample_output", utils.PYvX_DIR, "ndppd.conf")

argument = '-j {} -t {} > {}'.format(vlan_interfaces_json, conf_template, self.output_file)
self.run_script(argument)
f = open(self.output_file)
contents = f.read()
f.close()
assert filecmp.cmp(expected, self.output_file), contents
assert filecmp.cmp(expected, self.output_file), self.run_diff(expected, self.output_file)


def tearDown(self):
Expand Down

0 comments on commit 6299775

Please sign in to comment.