-
Notifications
You must be signed in to change notification settings - Fork 436
test/e2e: add tests around ssh/accessed annotation #390
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
Conversation
/retest |
test/e2e/mcd_test.go
Outdated
if err != nil { | ||
t.Errorf("cannot get node %q: %v", nodeName, err) | ||
} | ||
sshAnnotation, ok := node.ObjectMeta.Annotations["machineconfiguration.openshift.io/ssh"] |
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.
nit: It may be worth using the constants: https://github.com/openshift/machine-config-operator/blob/master/pkg/daemon/constants.go#L34-L37
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.
done
test/e2e/mcd_test.go
Outdated
t.Errorf("node %q has ssh/accessed annotation but it shouldn't", nodeName) | ||
} | ||
|
||
cmd := exec.Command("ssh", "-oStrictHostKeyChecking=no", "core@"+nodeIP, "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.
Let's be nice to people who are running this locally and also add -oUserKnownHostsFile=/dev/null
to not add junk to their ~/.ssh/known_hosts
.
tests are flaking like crazy now, I'll stop retesting but I need to investigate why ssh fails to connect to the node from within the test container (which I've spotted on an early run) |
It looks like the e2e suite does this: |
@cgwalters thanks a lot! |
9c456c5
to
f06b54d
Compare
updated |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ashcrow, cgwalters, runcom 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 |
New changes are detected. LGTM label has been removed. |
|
alright, now that I was on it, I've added another test and a todo as well along with some refactor. |
I should have remembered; we dropped direct ssh to masters/nodes by default. See |
|
- add ssh/accessed annotation test - add test no accessed on reboot Signed-off-by: Antonio Murdaca <[email protected]>
holding cause we're discussing ssh tests and testing in general on Slack/emails I might pull off the second test from here cause it doesn't need ssh connections /hold |
/retest |
well, the bastion host env isn't really helping either, damn |
This openshift/release#2817 should unblock us here |
/retest |
listOptions := metav1.ListOptions{ | ||
LabelSelector: labels.SelectorFromSet(labels.Set{"k8s-app": "machine-config-daemon"}).String(), | ||
} | ||
|
||
err = wait.Poll(3*time.Second, 5*time.Minute, func() (bool, error) { | ||
mcdList, err := k.CoreV1().Pods("openshift-machine-config-operator").List(listOptions) | ||
var seen int |
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.
note to self, this has to be moved within the wait
call to be right
@runcom: PR needs rebase. 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. |
@runcom: The following tests failed, say
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. |
In an effort to clean up the MCO repo, closing old open PRs with no activity. Feel free to reopen. |
Testing we correctly add the ssh accessed annotation on any given node accessed with ssh, there are other permutation of the test to be added though (annotation also on degraded etc etc, I'm working on that but I'd love #387 to land first so I can use that code to create MCs and degrade machines)
Signed-off-by: Antonio Murdaca [email protected]