forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubevirt#7418 from EdDev/tests-cleanup
tests: Various helpers cleanups
- Loading branch information
Showing
5 changed files
with
15 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ go_library( | |
"job.go", | ||
"migration.go", | ||
"pod_servers.go", | ||
"test.go", | ||
"utils.go", | ||
"vmi_servers.go", | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ package network | |
import ( | ||
"context" | ||
"fmt" | ||
"strings" | ||
|
||
expect "github.com/google/goexpect" | ||
|
||
|
@@ -72,7 +73,7 @@ var _ = SIGDescribe("[crit:high][arm64][vendor:[email protected]][level:componen | |
// Start a VirtualMachineInstance with bridged networking | ||
nodeName := tests.WaitForSuccessfulVMIStart(bridgeVMI).Status.NodeName | ||
|
||
tests.VerifyDummyNicForBridgeNetwork(bridgeVMI) | ||
verifyDummyNicForBridgeNetwork(bridgeVMI) | ||
|
||
By("restarting kubelet") | ||
pod := renderPkillAllPod("kubelet") | ||
|
@@ -108,7 +109,7 @@ var _ = SIGDescribe("[crit:high][arm64][vendor:[email protected]][level:componen | |
// Start a VirtualMachineInstance with bridged networking | ||
By("Waiting the VirtualMachineInstance start") | ||
bridgeVMI = tests.WaitUntilVMIReady(bridgeVMI, console.LoginToCirros) | ||
tests.VerifyDummyNicForBridgeNetwork(bridgeVMI) | ||
verifyDummyNicForBridgeNetwork(bridgeVMI) | ||
|
||
vmIP := libnet.GetVmiPrimaryIpByFamily(bridgeVMI, k8sv1.IPv4Protocol) | ||
dadCommand := fmt.Sprintf("sudo /usr/sbin/arping -D -I eth0 -c 2 %s | grep Received | cut -d ' ' -f 2\n", vmIP) | ||
|
@@ -128,3 +129,11 @@ var _ = SIGDescribe("[crit:high][arm64][vendor:[email protected]][level:componen | |
func renderPkillAllPod(processName string) *k8sv1.Pod { | ||
return tests.RenderPrivilegedPod("vmi-killer", []string{"pkill"}, []string{"-9", processName}) | ||
} | ||
|
||
func verifyDummyNicForBridgeNetwork(vmi *v1.VirtualMachineInstance) { | ||
output := tests.RunCommandOnVmiPod(vmi, []string{tests.BinBash, "-c", "/usr/sbin/ip link show|grep DOWN|grep -c eth0"}) | ||
ExpectWithOffset(1, strings.TrimSpace(output)).To(Equal("1")) | ||
|
||
output = tests.RunCommandOnVmiPod(vmi, []string{tests.BinBash, "-c", "/usr/sbin/ip link show|grep UP|grep -c eth0-nic"}) | ||
ExpectWithOffset(1, strings.TrimSpace(output)).To(Equal("1")) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters