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

[e2e] adding a period to the tested fqdn and improve error readability #44

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

AlonaKaplan
Copy link
Member

@AlonaKaplan AlonaKaplan commented Dec 7, 2022

What this PR does / why we need it:
The PR contains two commits.
The first one is adding a period to the tested fqdn.
According to the nslokkup man page -

If the lookup request contains at least one period but doesn't end with a trailing period, append the domain names in the domain search list to the request until an answer is received.
To avoid this, a period is added to our fqdn.

The second one returns readable nslookup error.

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot kubevirt-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 7, 2022
@kubevirt-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Dec 7, 2022
@kubevirt-bot kubevirt-bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XS labels Dec 7, 2022
@AlonaKaplan
Copy link
Member Author

/test pull-kubesecondarydns-e2e-k8s

@AlonaKaplan
Copy link
Member Author

/test pull-kubesecondarydns-e2e-k8s

@AlonaKaplan
Copy link
Member Author

/test pull-kubesecondarydns-e2e-k8s

@AlonaKaplan
Copy link
Member Author

/test pull-kubesecondarydns-e2e-k8s

@AlonaKaplan AlonaKaplan marked this pull request as ready for review December 7, 2022 12:41
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 7, 2022
@AlonaKaplan AlonaKaplan changed the title Debug [e2e] adding a period to the tested fqdn and improve error readability Dec 7, 2022
The `ShouldNot` description is interpeted before the `Eventually` code is
invoked. Therefore, the `nslookupOutput` will never be presented in this
description.
Changed the `Eventually`to return a more detailed error that contains also
the nslookup command output.

Signed-off-by: Alona Paz <alkaplan@redhat.com>
According to the nslokkup man page -
"If the lookup request contains at least one period but doesn't end with
a trailing period, append the domain names in the domain search list to the
request until an answer is received."
To avoid this, a period is added to our fqdn.

Signed-off-by: Alona Paz <alkaplan@redhat.com>
@@ -88,7 +88,7 @@ var _ = Describe("Virtual Machines Startup", func() {
var nslookupOutput []byte
Eventually(func() error {
var nslookupErr error
nslookupOutput, nslookupErr = exec.Command("nslookup", fmt.Sprintf("-port=%s", dnsPort), fmt.Sprintf("%s.%s.%s.%s", interfaceName, vmiName, testNamespace, domain), dnsIP).CombinedOutput()
nslookupOutput, nslookupErr = exec.Command("nslookup", fmt.Sprintf("-port=%s", dnsPort), fmt.Sprintf("%s.%s.%s.%s.", interfaceName, vmiName, testNamespace, domain), dnsIP).CombinedOutput()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please consider using nosearch instead adding a dot

Copy link
Member Author

Choose a reason for hiding this comment

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

We use dot for the same purpose in the zone file as well. I prefer to stick to this standard.

Copy link
Collaborator

@oshoval oshoval Dec 7, 2022

Choose a reason for hiding this comment

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

Something to consider later - maybe use vm.io instead vm, where there isn't a DOMAIN ?
(if its even allowed basically, and if it fixes the problem as well as the secondary.io did on CI without adding a dot)

@oshoval
Copy link
Collaborator

oshoval commented Dec 7, 2022

You might want to add please what happened on CI when there was no dot
and no DOMAIN

Copy link
Collaborator

@oshoval oshoval left a comment

Choose a reason for hiding this comment

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

Thanks

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 7, 2022
@AlonaKaplan
Copy link
Member Author

You might want to add please what happened on CI when there was no dot and no DOMAIN

** server can't find nic1.vmi-sec-v7tgz.secondary-test-frwp6.vm.kubevirt-prow-jobs.svc.cluster.local: SERVFAIL
kubevirt-prow-jobs.svc.cluster.local domain was appended.

@AlonaKaplan
Copy link
Member Author

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlonaKaplan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2022
@kubevirt-bot kubevirt-bot merged commit 134c9dc into kubevirt:main Dec 7, 2022
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants