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

test: add test for global DNS configuration #1226

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

mkowalski
Copy link
Member

Is this a BUG FIX or a FEATURE ?:

/kind enhancement

What this PR does / why we need it:

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. kind/enhancement labels Jan 31, 2024
@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. size/M labels Jan 31, 2024
Signed-off-by: Mat Kowalski <mko@redhat.com>
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Jan 31, 2024
@mkowalski
Copy link
Member Author

/test pull-kubernetes-nmstate-unit-test

It may be a valid issue

 /home/prow/go/pkg/mod/github.com/golangci/golangci-lint@v1.55.2/pkg/golinters/musttag.go:4:2: unrecognized import path "go.tmz.dev/musttag": reading https://go.tmz.dev/musttag?go-get=1: 404 Not Found 

Copy link
Member

@cathay4t cathay4t left a comment

Choose a reason for hiding this comment

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

Not sure related or not. It is known that nmstate will always use global DNS for:

---
dns-resolver:
  config:
    server:
    - 2001:4860:4860::8888
    - 8.8.8.8
    - 2606:4700:4700::1111

With a rollback triggered by bad config, you may verify whether global DNS is reverted or not. Of course, you need mark it as known to be fail.

@mkowalski
Copy link
Member Author

But those servers are good, so they will not trigger the revert. If I read the current code correctly, we want the test to contain hardcoded wrong DNS server, that's why I used 192.168.100.3

@mkowalski
Copy link
Member Author

/retest

@mkowalski
Copy link
Member Author

/test pull-kubernetes-nmstate-unit-test

@mkowalski
Copy link
Member Author

/retest

@mkowalski
Copy link
Member Author

/hold

This test is expected to fail until we have NM fixed. Currently it configures 192.168.100.3 (fake) and never rolls it back

Handler E2E Test Suite: [It] rollback when name servers (configured globally) are wrong after state configuration should rollback to previous name servers expand_less 	14m8s
{Timed out after 480.000s.
should eventually lose wrong name server
Expected
    <[]string | len:1, cap:1>: ["192.168.100.3"]
not to contain element matching
    <string>: 192.168.100.3 failed [FAILED] Timed out after 480.000s.
should eventually lose wrong name server
Expected
    <[]string | len:1, cap:1>: ["192.168.100.3"]
not to contain element matching
    <string>: 192.168.100.3
In [It] at: /tmp/knmstate/kubernetes-nmstate/test/e2e/handler/rollback_test.go:262 @ 02/03/24 21:59:26.922
}

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 4, 2024
@mkowalski
Copy link
Member Author

/retest

@mkowalski
Copy link
Member Author

/retest

go: downloading golang.org/x/mod v0.4.2
/home/prow/go/pkg/mod/k8s.io/apimachinery@v0.23.0/pkg/api/resource/amount.go:23:2: unrecognized import path "gopkg.in/inf.v0": reading https://gopkg.in/inf.v0?go-get=1: 502 Bad Gateway
	server response: Cannot obtain refs from GitHub: timeout
/home/prow/go/pkg/mod/sigs.k8s.io/structured-merge-diff/v4@v4.1.2/value/value.go:26:2: unrecognized import path "gopkg.in/yaml.v2": reading https://gopkg.in/yaml.v2?go-get=1: 502 Bad Gateway
	server response: Cannot obtain refs from GitHub: timeout
/home/prow/go/pkg/mod/sigs.k8s.io/controller-tools@v0.8.0/pkg/schemapatcher/gen.go:24:2: unrecognized import path "gopkg.in/yaml.v3": reading https://gopkg.in/yaml.v3?go-get=1: 502 Bad Gateway
	server response: Cannot obtain refs from GitHub: timeout
make: *** [Makefile:134: gen-k8s] Error 1

@mkowalski
Copy link
Member Author

/retest

1 similar comment
@qinqon
Copy link
Member

qinqon commented Mar 1, 2024

/retest

@qinqon
Copy link
Member

qinqon commented Mar 1, 2024

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 1, 2024
@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qinqon

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 Mar 1, 2024
@mkowalski
Copy link
Member Author

/retest

@mkowalski
Copy link
Member Author

/hold cancel

That should actually work

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 9, 2024
@kubevirt-bot kubevirt-bot merged commit a12e1f7 into nmstate:main Aug 9, 2024
8 checks passed
@mkowalski mkowalski deleted the add-global-dns-test branch August 14, 2024 14:40
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. kind/enhancement lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants