@@ -78,18 +78,16 @@ func renderTemplateFile(filepath string, data any) (string, error) {
7878
7979func TestGetConfig (t * testing.T ) {
8080 tests := []struct {
81- Name string
82- Description string
83- StateCache stateCache
84- NoHardware bool
85- InterfacesAndPeers bool
86- Pubkey string
87- Want string
81+ Name string
82+ Description string
83+ StateCache stateCache
84+ NoHardware bool
85+ Pubkey string
86+ Want string
8887 }{
8988 {
90- Name : "render_unicast_config_successfully" ,
91- Description : "render configuration for a set of unicast devices successfully" ,
92- InterfacesAndPeers : true ,
89+ Name : "render_unicast_config_successfully" ,
90+ Description : "render configuration for a set of unicast devices successfully" ,
9391 StateCache : stateCache {
9492 Config : serviceability.Config {
9593 MulticastGroupBlock : [5 ]uint8 {239 , 0 , 0 , 0 , 24 },
@@ -140,9 +138,8 @@ func TestGetConfig(t *testing.T) {
140138 Want : "fixtures/unicast.tunnel.tmpl" ,
141139 },
142140 {
143- Name : "render_multicast_config_successfully" ,
144- Description : "render configuration for a set of multicast devices successfully" ,
145- InterfacesAndPeers : true ,
141+ Name : "render_multicast_config_successfully" ,
142+ Description : "render configuration for a set of multicast devices successfully" ,
146143 StateCache : stateCache {
147144 Config : serviceability.Config {
148145 MulticastGroupBlock : [5 ]uint8 {239 , 0 , 0 , 0 , 24 },
@@ -226,9 +223,8 @@ func TestGetConfig(t *testing.T) {
226223 Want : "fixtures/multicast.tunnel.tmpl" ,
227224 },
228225 {
229- Name : "get_config_mixed_tunnels_successfully" ,
230- Description : "get config for a mix of unicast and multicast tunnels" ,
231- InterfacesAndPeers : true ,
226+ Name : "get_config_mixed_tunnels_successfully" ,
227+ Description : "get config for a mix of unicast and multicast tunnels" ,
232228 StateCache : stateCache {
233229 Config : serviceability.Config {
234230 MulticastGroupBlock : [5 ]uint8 {239 , 0 , 0 , 0 , 24 },
@@ -322,10 +318,9 @@ func TestGetConfig(t *testing.T) {
322318 Want : "fixtures/mixed.tunnel.tmpl" ,
323319 },
324320 {
325- Name : "get_config_nohardware_tunnels_successfully" ,
326- Description : "get config for a mix of unicast and multicast tunnels with no hardware option" ,
327- NoHardware : true ,
328- InterfacesAndPeers : true ,
321+ Name : "get_config_nohardware_tunnels_successfully" ,
322+ Description : "get config for a mix of unicast and multicast tunnels with no hardware option" ,
323+ NoHardware : true ,
329324 StateCache : stateCache {
330325 Config : serviceability.Config {
331326 MulticastGroupBlock : [5 ]uint8 {239 , 0 , 0 , 0 , 24 },
@@ -419,9 +414,8 @@ func TestGetConfig(t *testing.T) {
419414 Want : "fixtures/nohardware.tunnel.tmpl" ,
420415 },
421416 {
422- Name : "render_base_config_successfully" ,
423- Description : "render base configuration with BGP peers" ,
424- InterfacesAndPeers : true ,
417+ Name : "render_base_config_successfully" ,
418+ Description : "render base configuration with BGP peers" ,
425419 StateCache : stateCache {
426420 Config : serviceability.Config {
427421 MulticastGroupBlock : [5 ]uint8 {239 , 0 , 0 , 0 , 24 },
@@ -481,9 +475,8 @@ func TestGetConfig(t *testing.T) {
481475 Want : "fixtures/base.config.txt" ,
482476 },
483477 {
484- Name : "render_base_config_with_mgmt_vrf_successfully" ,
485- Description : "render base configuration with BGP peers" ,
486- InterfacesAndPeers : true ,
478+ Name : "render_base_config_with_mgmt_vrf_successfully" ,
479+ Description : "render base configuration with BGP peers" ,
487480 StateCache : stateCache {
488481 Config : serviceability.Config {
489482 MulticastGroupBlock : [5 ]uint8 {239 , 0 , 0 , 0 , 24 },
@@ -530,9 +523,6 @@ func TestGetConfig(t *testing.T) {
530523 noHardware : test .NoHardware ,
531524 deviceLocalASN : 65342 ,
532525 }
533- if ! test .InterfacesAndPeers {
534- controller .log = slog .New (slog .NewTextHandler (io .Discard , nil ))
535- }
536526 pb .RegisterControllerServer (server , controller )
537527
538528 go func () {
@@ -1221,17 +1211,16 @@ func TestServiceabilityProgramClientArg(t *testing.T) {
12211211// can be rendered and sent back to the client via gRPC.
12221212func TestEndToEnd (t * testing.T ) {
12231213 tests := []struct {
1224- Name string
1225- Config serviceability.Config
1226- Users []serviceability.User
1227- Devices []serviceability.Device
1228- Links []serviceability.Link
1229- MulticastGroups []serviceability.MulticastGroup
1230- Exchanges []serviceability.Exchange
1231- InterfacesAndPeers bool
1232- AgentRequest * pb.ConfigRequest
1233- DevicePubKey string
1234- Want string
1214+ Name string
1215+ Config serviceability.Config
1216+ Users []serviceability.User
1217+ Devices []serviceability.Device
1218+ Links []serviceability.Link
1219+ MulticastGroups []serviceability.MulticastGroup
1220+ Exchanges []serviceability.Exchange
1221+ AgentRequest * pb.ConfigRequest
1222+ DevicePubKey string
1223+ Want string
12351224 }{
12361225 {
12371226 Name : "fetch_accounts_and_render_config_successfully" ,
@@ -1251,7 +1240,6 @@ func TestEndToEnd(t *testing.T) {
12511240 BgpCommunity : 10050 ,
12521241 },
12531242 },
1254- InterfacesAndPeers : true ,
12551243 Users : []serviceability.User {
12561244 {
12571245 AccountType : serviceability .AccountType (0 ),
@@ -1368,7 +1356,6 @@ func TestEndToEnd(t *testing.T) {
13681356 BgpCommunity : 10050 ,
13691357 },
13701358 },
1371- InterfacesAndPeers : true ,
13721359 Users : []serviceability.User {
13731360 {
13741361 AccountType : serviceability .AccountType (0 ),
@@ -1490,8 +1477,7 @@ func TestEndToEnd(t *testing.T) {
14901477 BgpCommunity : 10050 ,
14911478 },
14921479 },
1493- InterfacesAndPeers : true ,
1494- Users : []serviceability.User {},
1480+ Users : []serviceability.User {},
14951481 Devices : []serviceability.Device {
14961482 {
14971483 AccountType : serviceability .AccountType (0 ),
0 commit comments