-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e2e: add qos policy test cases #2924
Conversation
94f0694
to
0e37176
Compare
Hi, @zhangzujian could you please help review this e2e? |
test/e2e/framework/vpc-nat-gw.go
Outdated
if qosPolicyName != "" { | ||
vpcNatGw.Spec.QoSPolicy = qosPolicyName | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if qosPolicyName != "" { | |
vpcNatGw.Spec.QoSPolicy = qosPolicyName | |
} | |
vpcNatGw.Spec.QoSPolicy = qosPolicyName |
attachNet := framework.MakeNetworkAttachmentDefinition(externalNetworkName, framework.KubeOvnNamespace, attachConf) | ||
attachNetClient.Create(attachNet) | ||
nad := attachNetClient.Get(externalNetworkName) | ||
framework.ExpectNoError(err, "failed to get") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework.ExpectNoError(err, "failed to get") |
test/e2e/framework/exec_utils.go
Outdated
// ExecWithOptions executes a command in the specified container, | ||
// returning stdout, stderr and error. `options` allowed for | ||
// additional parameters to be passed. | ||
func ExecWithOptions(f *Framework, options ExecOptions) (string, string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use util.ExecuteCommandInContainer()
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was referencing kubernetes/test/e2e/network/networking_perf.go
to write e2e, I also considered this issue. If it is in the e2e scenario, I think it would be better to use func ExecCommandInContainer(f *framework.Framework, podName, containerName string, cmd ...string) string
, because I can use framework.Logf
to output some debugging information and obtain some properties through f.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
klog.Infof()
can also print debug information.
What does obtain some properties through f.
mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I can pass f.Namespace.Name
as a parameter.
Thank you for your suggestion. I will try to modify exec_util.go
and reuse the code from /pkg/util/pod_exec.go
.
e8f418b
to
f13c096
Compare
Set qos policy for natgw Set qos policy for eip Rebuild qos of natgw when the natgw pod restarts Rebuild qos of eip when the natgw pod restarts Change qos policy of natgw Change qos policy of eip Update qos policy of eip Set specific ip qos policy of natgw Match Qos priority Create natgw with qos policy Create eip with qos policy
@@ -34,6 +38,34 @@ const vpcNatGWConfigMapName = "ovn-vpc-nat-gw-config" | |||
const networkAttachDefName = "ovn-vpc-external-network" | |||
const externalSubnetProvider = "ovn-vpc-external-network.kube-system" | |||
|
|||
const iperf2Port = "20288" | |||
const skipIperf = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iperf will cause the program to spend more time on e2e, taking approximately 15 minutes.
I will try to optimize the program to reduce the time to 5 minutes and then enable the iperf test.
Add the following test cases:
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes:
Fixes #2633
WHAT
🤖 Generated by Copilot at fe99231
This pull request fixes a bug in the qosPolicy finalizer logic and adds e2e tests and framework enhancements to cover the qos policy feature of the eip and nat gateway objects. It modifies
pkg/controller/qos_policy.go
,test/e2e/framework/iptables-eip.go
, andtest/e2e/framework/vpc-nat-gw.go
to handle the qos policy logic and verification. It also adds new filestest/e2e/framework/exec_utils.go
andtest/e2e/framework/qos-policy.go
to provide helper functions for executing commands and manipulating qos policy objects. It also adds a new functionNetworkDelete
totest/e2e/framework/docker/network.go
to clean up the docker networks used for testing.🤖 Generated by Copilot at fe99231
HOW
🤖 Generated by Copilot at fe99231
test/e2e/framework/iptables-eip.go
file (link, link, link, link, link)test/e2e/framework/iptables-eip.go
file (link, link)test/e2e/framework/vpc-nat-gw.go
file (link)test/e2e/framework/vpc-nat-gw.go
file (link, link)test/e2e/framework/vpc-nat-gw.go
file (link)pkg/controller/qos_policy.go
file and skip error handling if true (link, link)