@@ -20,6 +20,9 @@ def setUp(self):
20
20
def run_script (self , argument ):
21
21
print 'CMD: sonic-cfggen ' + argument
22
22
return subprocess .check_output (self .script_file + ' ' + argument , shell = True )
23
+
24
+ def run_diff (self , file1 , file2 , diff ):
25
+ return subprocess .check_output ('diff {} {} >{}' .format (file1 , file2 , diff ), shell = True )
23
26
24
27
def test_interfaces (self ):
25
28
interfaces_template = os .path .join (self .test_dir , '..' , '..' , '..' , 'files' , 'image_config' , 'interfaces' , 'interfaces.j2' )
@@ -59,6 +62,18 @@ def test_lldp(self):
59
62
self .run_script (argument )
60
63
self .assertTrue (filecmp .cmp (os .path .join (self .test_dir , 'sample_output' , 'lldpd.conf' ), self .output_file ))
61
64
65
+ def test_bgpd (self ):
66
+ conf_template = os .path .join (self .test_dir , '..' , '..' , '..' , 'dockers' , 'docker-fpm-quagga' , 'bgpd.conf.j2' )
67
+ argument = '-m ' + self .t0_minigraph + ' -p ' + self .t0_port_config + ' -t ' + conf_template + ' > ' + self .output_file
68
+ self .run_script (argument )
69
+ self .assertTrue (filecmp .cmp (os .path .join (self .test_dir , 'sample_output' , 'bgpd.conf' ), self .output_file ))
70
+
71
+ def test_zebra (self ):
72
+ conf_template = os .path .join (self .test_dir , '..' , '..' , '..' , 'dockers' , 'docker-fpm-quagga' , 'zebra.conf.j2' )
73
+ argument = '-m ' + self .t0_minigraph + ' -p ' + self .t0_port_config + ' -t ' + conf_template + ' > ' + self .output_file
74
+ self .run_script (argument )
75
+ self .assertTrue (filecmp .cmp (os .path .join (self .test_dir , 'sample_output' , 'zebra.conf' ), self .output_file ))
76
+
62
77
def test_teamd (self ):
63
78
64
79
def test_render_teamd (self , pc , minigraph , sample_output ):
@@ -94,7 +109,6 @@ def test_ipinip(self):
94
109
self .run_script (argument )
95
110
96
111
sample_output_file = os .path .join (self .test_dir , 'sample_output' , 'ipinip.json' )
97
-
98
112
assert filecmp .cmp (sample_output_file , self .output_file )
99
113
100
114
def test_msn27xx_32ports_buffers (self ):
0 commit comments