Skip to content

Commit 39bc186

Browse files
committed
add helper for detecting drivers with aux in test
1 parent 574f958 commit 39bc186

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

hack/jenkins/linux_integration_tests_kvm.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ JOB_NAME="KVM_Linux"
3232

3333
# We pick kvm as our gvisor testbed because it is fast & reliable
3434
EXTRA_TEST_ARGS="-gvisor"
35+
# we want to test the aux-drivers that are from HEAD not from the release minikube
36+
EXTRA_START_ARGS="--auto-update-drivers=false"
3537

3638
sudo apt-get update
3739
sudo apt-get -y install qemu-system libvirt-clients libvirt-daemon-system ebtables iptables dnsmasq

test/integration/main_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ func HyperVDriver() bool {
140140
return strings.Contains(*startArgs, "--driver=hyperv") || strings.Contains(*startArgs, "--vm-driver=hyperv")
141141
}
142142

143+
// KVM returns true is is KVM driver
144+
func KVMDriver() bool {
145+
return strings.Contains(*startArgs, "--driver=kvm") || strings.Contains(*startArgs, "--vm-driver=kvm") || strings.Contains(*startArgs, "--driver=kvm2") || strings.Contains(*startArgs, "--vm-driver=kvm2")
146+
}
147+
143148
// VirtualboxDriver returns whether or not this test is using the VirtualBox driver
144149
func VirtualboxDriver() bool {
145150
return strings.Contains(*startArgs, "--driver=virtualbox") || strings.Contains(*startArgs, "--vm-driver=virtualbox")
@@ -165,6 +170,11 @@ func KicDriver() bool {
165170
return DockerDriver() || PodmanDriver()
166171
}
167172

173+
// Returns true if the driver needs an auxiliary driver (kvm, hyperkit,..)
174+
func DriverHasAuxDriver() bool {
175+
return HyperVDriver() || KVMDriver()
176+
}
177+
168178
// VMDriver checks if the driver is a VM
169179
func VMDriver() bool {
170180
return !KicDriver() && !NoneDriver()

0 commit comments

Comments
 (0)