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

Add Linux Client tests #10

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Dec 3, 2020

This is a very basic version, but shows some general concepts. The goal is to allow discussion on how to replace the bats tests.

Copy link
Member Author

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Other thoughts I had were to add a fixture apypie which would provide an authenticated API client instance. That can be used to build up fixtures such as a content view.

Comment on lines +17 to +24
host = testinfra.get_host(request.param)

subman = host.package("subscription-manager")
if not subman.is_installed:
print('Installing subscription-manager')
host.run('yum -y install subscription-manager')

return host
Copy link
Member Author

Choose a reason for hiding this comment

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

This is just an example. I also considered making it an explicit parameter on the CLI pytest invocation and spawn them on demand here so they wouldn't be reused between tests. That's probably a much cleaner implementation.


```
podman run --rm --detach --label smoker-linux-client --name centos-7 centos:7 /sbin/init
podman run --rm --detach --label smoker-linux-client --name centos-8 centos:8 /sbin/init
Copy link
Member Author

Choose a reason for hiding this comment

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

I noticed that not all container images have systemd installed by default.

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.

1 participant