forked from ovn-org/ovn-kubernetes
-
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.
kubevirt, e2e: Add DHCP/ND test case for UDPN
This change create a virt-launcher pod backed up by a pod running NetworkManager with a working DHCP client to test that ovn-k is answering back the ipv4/ipv6 DHCP/NP messages to configure networking. Signed-off-by: Enrique Llorente <ellorent@redhat.com>
- Loading branch information
Showing
5 changed files
with
193 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package kubevirt | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
func GenerateAddressDiscoveryConfigurationCommand(iface string) string { | ||
return fmt.Sprintf(` | ||
nmcli c mod %[1]s ipv4.addresses "" ipv6.addresses "" ipv4.gateway "" ipv6.gateway "" ipv6.method auto ipv4.method auto ipv6.addr-gen-mode eui64 | ||
nmcli d reapply %[1]s`, iface) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package kubevirt | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/utils/ptr" | ||
|
||
kubevirtv1 "kubevirt.io/api/core/v1" | ||
) | ||
|
||
func GenerateFakeVirtLauncherPod(namespace, vmName string) *corev1.Pod { | ||
return &corev1.Pod{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: "virt-launcher-" + vmName, | ||
Namespace: namespace, | ||
Labels: map[string]string{ | ||
kubevirtv1.VirtualMachineNameLabel: vmName, | ||
}, | ||
}, | ||
Spec: corev1.PodSpec{ | ||
Containers: []corev1.Container{{ | ||
Name: "compute", | ||
Image: "quay.io/nmstate/c10s-nmstate-dev:latest", | ||
SecurityContext: &corev1.SecurityContext{ | ||
Privileged: ptr.To(true), | ||
Capabilities: &corev1.Capabilities{ | ||
Add: []corev1.Capability{"NET_ADMIN"}, | ||
}, | ||
}, | ||
}}, | ||
}, | ||
} | ||
} |
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