test getting running config from router

This commit is contained in:
Joel Wetzell
2026-03-17 18:58:18 -05:00
parent 35262fd505
commit 9c03ad2c14

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log/slog"
"reflect"
"sync"
"testing"
"time"
@@ -80,7 +81,7 @@ func TestNewRouter(t *testing.T) {
},
}
_, moduleErrors, routeErrors := showbridge.NewRouter(routerConfig)
router, moduleErrors, routeErrors := showbridge.NewRouter(routerConfig)
if moduleErrors != nil {
t.Fatalf("router should not have returned any module errors: %v", moduleErrors)
@@ -89,6 +90,10 @@ func TestNewRouter(t *testing.T) {
if routeErrors != nil {
t.Fatalf("router should not have returned any route errors: %v", routeErrors)
}
if !reflect.DeepEqual(routerConfig, router.RunningConfig()) {
t.Fatalf("router running config did not match expected, got: %v, expected: %v", router.RunningConfig(), routerConfig)
}
}
func TestNewRouterNoModuleId(t *testing.T) {