Skip to content

Conversation

@susesgartner
Copy link
Contributor

Update to the ssh tests to fix flakeyness and add the audit log testing.

Update to the ssh tests to fix flakeyness and add the audit log testing.
Copy link
Contributor

@igomez06 igomez06 left a comment

Choose a reason for hiding this comment

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

My question is should the SSH tests themselves even be here in shepherd? Would it make sense to have them in rancher/rancher with _test.go file written for them?

Copy link
Contributor

@markusewalker markusewalker left a comment

Choose a reason for hiding this comment

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

Left some comments. Thinking further on Israel's comments, I actually think it does make more sense to have the actual test be in rancher/rancher. We can talk offline further about it if you would like.

sudo install -m o+w /dev/null /var/lib/rancher/k3s/server/audit.yaml
sudo chmod o+w /etc/systemd/system/k3s.service
sed -i '$d' /etc/systemd/system/k3s.service
sudo echo -e " '--kube-apiserver-arg=audit-log-path=/var/lib/rancher/k3s/server/logs/audit.log' \ \n '--kube-apiserver-arg=audit-policy-file=/var/lib/rancher/k3s/server/audit.yaml'" >> /etc/systemd/system/k3s.service
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a clarifying question, what's the need for the spaces in the beginning of this command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That appears to be a copy paste error on my part.

if newNode.State.Name == runningState {
return false, nil
}
return true, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

nit; please put this on a new line for code readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll be running our linter against this today once i get it running in vscode and it will catch that


auditLogPath := rancherDir + cluster.Labels[providerLabel]
auditLogFile := ""
if cluster.Labels[providerLabel] == "rke2" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you put rke2 in a const block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, once my other PR gets merged I plan to rebase and expand those constant files see defaults package in this PR

auditLogPath = auditLogPath + "/etc/config-files/" + auditLogFile
}

if cluster.Labels[providerLabel] == "k3s" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above.

return err
}

dirPath := filepath.Join(user.HomeDir, "go/src/github.com/susesgartner/rancher/tests/framework/extensions/provisioning")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is pointing to your forked repo, this needs to be using the official repo.

@susesgartner
Copy link
Contributor Author

It would probably be a good idea to have some design discussions around the SSH tests. I'm not against moving them but I am not perfectly clear on how we plan to run these tests as part of other tests (their current use) given our current testing architecture.

Copy link
Contributor

@slickwarren slickwarren left a comment

Choose a reason for hiding this comment

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

lgtm, but if it makes sense to move it we can do that too. Perhaps makes more sense to fix this for now, and move it later.

@igomez06
Copy link
Contributor

igomez06 commented Mar 6, 2024

lgtm, but if it makes sense to move it we can do that too. Perhaps makes more sense to fix this for now, and move it later.

I agree with Caleb, we can get this fixed now. But ultimately we should move these out of here and in rancher/rancher testing. I could be a part of the design discussion if you guys want.

Copy link
Contributor

@igomez06 igomez06 left a comment

Choose a reason for hiding this comment

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

Do we have a test run to run the new audit log, plus check flakiness? Once that is done I'll give my approval

@susesgartner
Copy link
Contributor Author

I'll get this run ASAP and send you the job. Dealing with 1 bit of flakeyness I discovered with the a few of the SSH tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants