Skip to content

Commit

Permalink
Merge branch 'master' into support-init-behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
slankdev authored Feb 2, 2020
2 parents fd9b635 + f5353d5 commit f4f7506
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions internal/pkg/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (node *Node) DeleteNode() []string {

// DeleteSwitch Delete bridge
func (br *Switch) DeleteSwitch() string {
deleteBrCmd := fmt.Sprintf("ip link delete %s", br.Name)
deleteBrCmd := fmt.Sprintf("ovs-vsctl del-br %s", br.Name)
return deleteBrCmd
}

Expand Down Expand Up @@ -452,7 +452,7 @@ func NetnsLinkUp(netnsName string, linkName string) string {
func (bridge *Switch) CreateSwitch() []string {
var createSwitchCmds []string

addSwitchCmd := fmt.Sprintf("ip link add %s type bridge", bridge.Name)
addSwitchCmd := fmt.Sprintf("ovs-vsctl add-br %s", bridge.Name)
createSwitchCmds = append(createSwitchCmds, addSwitchCmd)

bridgeUpCmd := HostLinkUp(bridge.Name)
Expand Down Expand Up @@ -493,7 +493,7 @@ func (inf *Interface) S2nLink(nodeName string) []string {
s2nLinkCmds = append(s2nLinkCmds, s2nLinkCmd)
s2nLinkCmds = append(s2nLinkCmds, NetnsLinkUp(nodeName, nodeinf))
s2nLinkCmds = append(s2nLinkCmds, HostLinkUp(peerBrInf))
setBrLinkCmd := fmt.Sprintf("ip link set dev %s master %s", peerBrInf, peerBr)
setBrLinkCmd := fmt.Sprintf("ovs-vsctl add-port %s %s", peerBr, peerBrInf)
s2nLinkCmds = append(s2nLinkCmds, setBrLinkCmd)

return s2nLinkCmds
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/shell/shell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func TestSwitch_DeleteSwitch(t *testing.T) {
},
},
},
want: "ip link delete SW",
want: "ovs-vsctl del-br SW",
},
}
for _, tt := range tests {
Expand Down Expand Up @@ -716,7 +716,7 @@ func TestSwitch_CreateSwitch(t *testing.T) {
},
},
},
want: []string{"ip link add SW type bridge", "ip link set SW up"},
want: []string{"ovs-vsctl add-br SW", "ip link set SW up"},
},
}
for _, tt := range tests {
Expand Down Expand Up @@ -815,7 +815,7 @@ func TestInterface_S2nLink(t *testing.T) {
args: args{
nodeName: "R1",
},
want: []string{"ip link add net0 netns R1 type veth peer name SW-R1", "ip netns exec R1 ip link set net0 up", "ip link set SW-R1 up", "ip link set dev SW-R1 master SW"},
want: []string{"ip link add net0 netns R1 type veth peer name SW-R1", "ip netns exec R1 ip link set net0 up", "ip link set SW-R1 up", "ovs-vsctl add-port SW SW-R1"},
},
}
for _, tt := range tests {
Expand Down

0 comments on commit f4f7506

Please sign in to comment.