f-73: metadata: network-config par VM, une entrée ethN par NIC visée par sa MAC #73
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
9a6c9485b7
commit
0e3d91d246
5 changed files with 54 additions and 7 deletions
20
internal/vm/create_test.go
Normal file
20
internal/vm/create_test.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package vm
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNicMACs_KeepsTheOrderAndLowersTheCase(t *testing.T) {
|
||||
nics := []nicData{
|
||||
{index: 0, mac: "52:54:00:49:01:0C"},
|
||||
{index: 1, mac: "52:54:00:49:02:16", primary: true},
|
||||
}
|
||||
|
||||
got := nicMACs(nics)
|
||||
|
||||
want := []string{"52:54:00:49:01:0c", "52:54:00:49:02:16"}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Errorf("nicMACs = %v, attendu %v", got, want)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue