Skip to content

Commit

Permalink
e2e,handler: use copy-mac-from copy mac from primary iface (#1092)
Browse files Browse the repository at this point in the history
* e2e,handler: use copy-mac-from copy mac from primary iface

Signed-off-by: Radim Hrazdil <[email protected]>

* docs,examples: use copy-mac-from in bond example

Signed-off-by: Radim Hrazdil <[email protected]>
  • Loading branch information
rhrazdil authored Jun 9, 2022
1 parent a506950 commit 7575d73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/examples/bond.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
- name: bond0
type: bond
state: up
copy-mac-from: eth1
ipv4:
dhcp: true
enabled: true
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/handler/bonding_default_interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import (
"github.com/nmstate/kubernetes-nmstate/test/e2e/policy"
)

// TODO: When https://bugzilla.redhat.com/show_bug.cgi?id=1906307 is resolved, add firstSecondaryNic to the bond again
func boundUpWithPrimaryAndSecondary(bondName string) nmstate.State {
return nmstate.NewState(fmt.Sprintf(`interfaces:
- name: %s
type: bond
state: up
copy-mac-from: %s
ipv4:
dhcp: true
enabled: true
Expand All @@ -44,7 +44,8 @@ func boundUpWithPrimaryAndSecondary(bondName string) nmstate.State {
primary: %s
%s:
- %s
`, bondName, fmt.Sprintf(miimonFormat, 140), primaryNic, portFieldName, primaryNic))
- %s
`, bondName, primaryNic, fmt.Sprintf(miimonFormat, 140), primaryNic, portFieldName, primaryNic, firstSecondaryNic))
}

func bondAbsentWithPrimaryUp(bondName string) nmstate.State {
Expand Down

0 comments on commit 7575d73

Please sign in to comment.