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: use self.machine.write() where possible #1861

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

jelly
Copy link
Member

@jelly jelly commented Oct 14, 2024

No description provided.

@jelly jelly requested a review from martinpitt October 15, 2024 07:09
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Sorry.. while we are at it, let's clean this up properly, before it bites us.

test/check-machines-create Show resolved Hide resolved
Comment on lines +1603 to +1604
self.machine.write("/etc/hosts", "127.0.0.42 mirror.i3d.net", append=True)
self.machine.write("/etc/hosts", "::1 mirror.i3d.net", append=True)
Copy link
Member

Choose a reason for hiding this comment

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

Same here, /etc/hosts isn't already auto-restored. Of course you can't call self.write_file() twice on the same file, so please join the two commands into one with appending both lines.

Copy link
Member

Choose a reason for hiding this comment

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

You mentioned in chat that /etc/hosts is already restored indirectly, via setup_mock_server(). That wasn't obvious, sorry.

@jelly jelly merged commit 4f34304 into cockpit-project:main Oct 15, 2024
28 checks passed
@jelly jelly deleted the machine-write branch October 15, 2024 08:59
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.

2 participants