Skip to content
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

Update e2e testing nodePort service listening on same port but different protocols #81419

Merged

Conversation

mgdevstack
Copy link
Contributor

@mgdevstack mgdevstack commented Aug 14, 2019

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test

/kind feature

/kind flake

What this PR does / why we need it:

  1. Updates should be able to update NodePorts with two same port numbers but different protocols to test service reachability and improved e2e Name and behavior.
  2. Removes should use same NodePort with same port but different protocols as this behaviour would be tested by above updated e2e.

Which issue(s) this PR fixes:

Fixes #81418

Special notes for your reviewer:
Changes are made to make e2e eligible for Conformance.
Source of Issue : #77865 (comment)

Does this PR introduce a user-facing change?:

None

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


/area conformance
/sig testing
@kubernetes/cncf-conformance-wg
@kubernetes/sig-node-pr-reviews
@kubernetes/sig-architecture-pr-reviews

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. kind/feature Categorizes issue or PR as related to a new feature. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/conformance Issues or PRs related to kubernetes conformance tests sig/testing Categorizes an issue or PR as relevant to SIG Testing. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test labels Aug 14, 2019
@mgdevstack
Copy link
Contributor Author

Once merged, we can promote this e2e to Conformance in this release cycle v1.16 which is very near.
/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 14, 2019
@mgdevstack mgdevstack changed the title Update e2e testing nodePort service listening on same port but differ… Update e2e testing nodePort service listening on same port but different protocols Aug 14, 2019
Copy link
Contributor

@mattjmcnaughton mattjmcnaughton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Probably a good idea to have someone more involved with the conformance work review this as well, but it looks good to me :)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 15, 2019
@mgdevstack
Copy link
Contributor Author

mgdevstack commented Aug 15, 2019

To gain attention for reviewing :)
/cc @johnbelamaric @spiffxp

@mattjmcnaughton
Copy link
Contributor

/assign @ixdy

@johnbelamaric
Copy link
Member

/approve

Copy link
Member

@oomichi oomichi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

jig.CheckServiceReachability(ns, nodePortService, execPod)

if nodePortCounts := len(nodePortService.Spec.Ports); nodePortCounts != 2 {
e2elog.Failf("new service should have two Ports but found %d Ports", nodePortCounts)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Here can be framework.ExpectEqual(len(nodePortService.Spec.Ports), 2)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Client: c,
Name: j.Name,
Image: framework.ServeHostnameImage,
Command: []string{"/agnhost", "serve-hostname", "--http=false", "--tcp", "--udp"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I am wondering we can merge this new function into the above existing function because the difference is just this command here. But at this time, it is fine and we can take care later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, I was in the same mindset to have single function and leverage flags as args but to keep PR simple, I have not introduced here. As you mentioned, I can create another PR to refactor it.

Following is raw code.

var ServeHostNameImageDefaultFlags = map[string]string{
	HTTP: "--http",
	TCP:  "--tcp",
	UDP:  "--udp",
}


func enableServeHostNameImageCmdFlags(enableFlags ...string) (enabledFlags []string){
	gomega.Expect(len(enableFlags)).NotTo(gomega.BeNumerically(">", 2), "HTTP only or TCP/UDP requests can be served but not both simultaneously")
	var flags = make(map[string]string,len(ServeHostNameImageDefaultFlags))
	for _,f := range enableFlags{
		switch f{
		case TCP, UDP:
			framework.ExpectNotEqual(flags[f],ServeHostNameImageDefaultFlags[HTTP], "HTTP flag can not be enabled along with TCP/UDP")
			flags[f] = "--http=false"
			flags[f] = ServeHostNameImageDefaultFlags[f]
		case HTTP:
			if flags[TCP] != "" || flags[UDP] != ""{
				framework.Failf("TCP/UDP flag is enabled so HTTP flag can not be enabled")
			}
			flags[f] = ServeHostNameImageDefaultFlags[f]
		default:
			framework.Failf("Unexpected protocol flags are passed. Valid protocol flags are HTTP, TCP and UDP")
		}
	}
	for _, f := range flags{
                enabledFlags = append(enableFlags, f)
	}
    return
}

flags := enableServeHostNameImageCmdFlags(TCP, UDP)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgdevstack could you please create a follow up issue for this, so we dont forget?
once we get that we can cancel the hold on this.

@spiffxp spiffxp added this to To Triage in conformance-definition Aug 21, 2019
@spiffxp spiffxp moved this from To Triage to Needs Review in conformance-definition Aug 21, 2019
}
for _, port := range newService.Spec.Ports {
for _, port := range nodePortService.Spec.Ports {
if port.NodePort == 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: framework.ExpectNotEqual(port.NodePort, 0, errorMessage...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@adelina-t
Copy link
Contributor

That seems unrelated test failure.

/test pull-kubernetes-e2e-aks-engine-azure-windows

Yes, it is unrelated. Because of an image change for redis, that is unsupported by windows, the guestbook application cannot run, thus the test will fail. It was supposed to be removed from windows e2e presubmit, but seems it was an oversight that I shall fix ASAP.

I ran the aks-engine-azure-windows job on this PR because I wanted to see if the changes don't impact Windows.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

4 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@mgdevstack
Copy link
Contributor Author

E2E non-related to this PR are failing on Azure job which requires fix mentioned in #81419 (comment) and milestone is not added for this release i.e. 1.16 so holding this PR to stop repeated retest.
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 6, 2019
@k8s-ci-robot
Copy link
Contributor

@mgdevstack: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-aks-engine-azure-windows e8ce310eb881003401f2bf08bfef9da56243a5a9 link /test pull-kubernetes-e2e-aks-engine-azure-windows

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@timothysc timothysc removed their request for review September 10, 2019 20:52
@smarterclayton smarterclayton moved this from Needs Approval to Needs Review in conformance-definition Sep 12, 2019
@johnbelamaric
Copy link
Member

@mgdevstack please rebase and resolve conflicts

@johnbelamaric johnbelamaric moved this from Needs Review to In Progress in conformance-definition Sep 26, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 28, 2019
Copy link
Contributor

@alejandrox1 alejandrox1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/milestone v1.17

Client: c,
Name: j.Name,
Image: framework.ServeHostnameImage,
Command: []string{"/agnhost", "serve-hostname", "--http=false", "--tcp", "--udp"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgdevstack could you please create a follow up issue for this, so we dont forget?
once we get that we can cancel the hold on this.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 29, 2019
@alejandrox1
Copy link
Contributor

/milestone v1.17

@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Sep 29, 2019
@timothysc timothysc removed the area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework label Sep 30, 2019
@timothysc
Copy link
Member

/assign @johnbelamaric

@mgdevstack
Copy link
Contributor Author

/hold cancel
As per #81419 (comment) tracking issue under #83347

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 1, 2019
@k8s-ci-robot k8s-ci-robot merged commit 78940cd into kubernetes:master Oct 1, 2019
conformance-definition automation moved this from In Progress to Done Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/conformance Issues or PRs related to kubernetes conformance tests area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

Update "service using same port but different protocol" e2e to test service reachability