f-41: lab: FRR après deploy.sh puis redémarrage de l'agent, base BGP par l'agent #41
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
ee77d65f28
commit
6c0e05e1e7
3 changed files with 13 additions and 8 deletions
|
|
@ -312,18 +312,20 @@ func TestRun_RenderShipsTheExampleFRRConfigs(t *testing.T) {
|
|||
if code != 0 {
|
||||
t.Fatalf("code %d, stderr %s", code, stderr)
|
||||
}
|
||||
for node, want := range map[string]string{
|
||||
"sw1": "router bgp 65100",
|
||||
"rr1": "bgp listen range 192.168.14.0/24 peer-group fabric",
|
||||
"hv1": "bgp router-id 192.168.14.11",
|
||||
"hv2": "bgp router-id 192.168.14.12",
|
||||
for node, wants := range map[string][]string{
|
||||
"sw1": {"router bgp 65100"},
|
||||
"rr1": {"bgp listen range 192.168.14.0/24 peer-group fabric"},
|
||||
"hv1": {"hostname hv1", "route_reflectors: [10.255.255.1]"},
|
||||
"hv2": {"hostname hv2", "route_reflectors: [10.255.255.1]"},
|
||||
} {
|
||||
data, err := os.ReadFile(filepath.Join(out, node, "user-data"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(string(data), want) {
|
||||
t.Errorf("%s user-data does not carry %q", node, want)
|
||||
for _, want := range wants {
|
||||
if !strings.Contains(string(data), want) {
|
||||
t.Errorf("%s user-data does not carry %q", node, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ func TestRoles_ProvisioningIsOneScriptThatStopsAtTheFirstFailure(t *testing.T) {
|
|||
nodes := renderRoles(t)
|
||||
for name, steps := range map[string]string{
|
||||
"sw1": "systemctl daemon-reload\nsystemctl enable --now lab-switch.service\n/usr/local/sbin/lab-frr\n",
|
||||
"hv1": "/usr/local/sbin/lab-deploy\n/usr/local/sbin/lab-frr\n",
|
||||
"hv1": "/usr/local/sbin/lab-deploy\n/usr/local/sbin/lab-frr\nsystemctl restart agent.service\n",
|
||||
"hv2": "/usr/local/sbin/lab-deploy\n",
|
||||
} {
|
||||
cfg := user(t, nodeNamed(t, nodes, name))
|
||||
|
|
|
|||
|
|
@ -133,6 +133,9 @@ func userData(p *topology.Plan, n topology.NodePlan, o Options) ([]byte, error)
|
|||
writeFile{Path: FRRScript, Permissions: "0755", Content: frrScript(n)},
|
||||
)
|
||||
steps = append(steps, FRRScript)
|
||||
if n.Role == topology.RoleHypervisor {
|
||||
steps = append(steps, "systemctl restart agent.service")
|
||||
}
|
||||
}
|
||||
if len(steps) > 0 {
|
||||
cfg.WriteFiles = append(cfg.WriteFiles,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue