f-50: lab: image vérifiée, disques et seeds des VM #50
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
f3515ca370
commit
4b176c22d7
7 changed files with 999 additions and 20 deletions
|
|
@ -18,6 +18,7 @@ const (
|
|||
|
||||
type Plan struct {
|
||||
Name string
|
||||
Images []Image
|
||||
Segments []SegmentPlan
|
||||
Nodes []NodePlan
|
||||
Cables []Cable
|
||||
|
|
@ -62,7 +63,7 @@ func Compute(t *Topology) (*Plan, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
p := &Plan{Name: t.Name}
|
||||
p := &Plan{Name: t.Name, Images: append([]Image(nil), t.Images...)}
|
||||
for i, n := range t.Nodes {
|
||||
p.Nodes = append(p.Nodes, NodePlan{
|
||||
Name: n.Name,
|
||||
|
|
|
|||
|
|
@ -107,6 +107,14 @@ func TestCompute_TwoHypervisorsPlan(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestCompute_CarriesTheDeclaredImages(t *testing.T) {
|
||||
p := compute(t, twoHypervisors)
|
||||
want := []Image{{Name: "deb", URL: "https://example.invalid/deb.qcow2", Sums: "https://example.invalid/SHA512SUMS"}}
|
||||
if !reflect.DeepEqual(p.Images, want) {
|
||||
t.Errorf("images = %+v, want %+v", p.Images, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCompute_IsStableAcrossRuns(t *testing.T) {
|
||||
first := compute(t, twoHypervisors)
|
||||
for i := 0; i < 20; i++ {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue