Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

runcom
Copy link
Member

@runcom runcom commented Feb 7, 2019

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)

- add ssh/accessed annotation test
- add test no accessed on reboot

Signed-off-by: Antonio Murdaca [email protected]

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 7, 2019
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 7, 2019
@runcom
Copy link
Member Author

runcom commented Feb 7, 2019

/retest

if err != nil {
t.Errorf("cannot get node %q: %v", nodeName, err)
}
sshAnnotation, ok := node.ObjectMeta.Annotations["machineconfiguration.openshift.io/ssh"]
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

done

t.Errorf("node %q has ssh/accessed annotation but it shouldn't", nodeName)
}

cmd := exec.Command("ssh", "-oStrictHostKeyChecking=no", "core@"+nodeIP, "true")
Copy link
Member

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.

@runcom
Copy link
Member Author

runcom commented Feb 7, 2019

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)

@cgwalters
Copy link
Member

need to investigate why ssh fails to connect to the node from within the test container

It looks like the e2e suite does this:
export KUBE_SSH_KEY_PATH=/tmp/cluster/ssh-privatekey

@runcom
Copy link
Member Author

runcom commented Feb 7, 2019

@cgwalters thanks a lot!

@runcom runcom force-pushed the ssh-tests branch 2 times, most recently from 9c456c5 to f06b54d Compare February 7, 2019 22:03
@runcom
Copy link
Member Author

runcom commented Feb 7, 2019

updated

@runcom
Copy link
Member Author

runcom commented Feb 7, 2019

/retest

@cgwalters
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2019
@openshift-ci-robot
Copy link
Contributor

[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:
  • OWNERS [ashcrow,cgwalters,runcom]

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

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2019
@openshift-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@runcom
Copy link
Member Author

runcom commented Feb 8, 2019

This still fails on the ssh command for some reason, need to understand why gotcha

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 8, 2019
@runcom
Copy link
Member Author

runcom commented Feb 8, 2019

alright, now that I was on it, I've added another test and a todo as well along with some refactor.

@runcom runcom changed the title test/e2e: add ssh/accessed annotation test test/e2e: add tests around ssh/accessed annotation Feb 8, 2019
@cgwalters
Copy link
Member

I should have remembered; we dropped direct ssh to masters/nodes by default. See
openshift/release#2469

@ashcrow
Copy link
Member

ashcrow commented Feb 8, 2019

	mcd_test.go:269: error ssh'ing into node ".....": exit status 255, No user exists for uid 1122740000

- add ssh/accessed annotation test
- add test no accessed on reboot

Signed-off-by: Antonio Murdaca <[email protected]>
@runcom
Copy link
Member Author

runcom commented Feb 8, 2019

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

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 8, 2019
@runcom
Copy link
Member Author

runcom commented Feb 8, 2019

/retest

@runcom
Copy link
Member Author

runcom commented Feb 8, 2019

well, the bastion host env isn't really helping either, damn

@runcom
Copy link
Member Author

runcom commented Feb 8, 2019

This openshift/release#2817 should unblock us here

@runcom
Copy link
Member Author

runcom commented Feb 8, 2019

/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
Copy link
Member Author

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

@openshift-ci-robot
Copy link
Contributor

@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.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2019
@openshift-ci-robot
Copy link
Contributor

@runcom: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws b4200fb link /test e2e-aws
ci/prow/e2e-aws-op b4200fb link /test e2e-aws-op
ci/prow/e2e-aws-disruptive b4200fb link /test e2e-aws-disruptive
ci/prow/e2e-gcp-op b4200fb link /test e2e-gcp-op
ci/prow/e2e-aws-upgrade b4200fb link /test e2e-aws-upgrade
ci/prow/e2e-gcp-upgrade b4200fb link /test e2e-gcp-upgrade
ci/prow/e2e-vsphere b4200fb link /test e2e-vsphere
ci/prow/build-rpms-from-tar b4200fb link /test build-rpms-from-tar

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.

@kikisdeliveryservice
Copy link
Contributor

In an effort to clean up the MCO repo, closing old open PRs with no activity.

Feel free to reopen.

@kikisdeliveryservice kikisdeliveryservice added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 3, 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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants