-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic Foreman tests to replace fb-test-foreman.bats
Additionally replaces fb-test-katello.bats
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import pytest | ||
|
||
from urllib.parse import urlparse | ||
|
||
|
||
def test_foreman_version(api, variables): | ||
try: | ||
expected_foreman_version = variables['expected_foreman_version'] | ||
except KeyError: | ||
pytest.skip("'expected_foreman_version' is not set") | ||
else: | ||
status = api.resource('home').call('status') | ||
assert status['version'] == expected_foreman_version | ||
|
||
|
||
def test_ping(api): | ||
ping = api.resource('ping').call('ping')['results'] | ||
|
||
assert ping['foreman']['database']['active'] | ||
|
||
if 'katello' in ping: | ||
assert ping['katello']['status'] == 'ok' | ||
try: | ||
assert ping['katello']['status'] == 'ok' | ||
except KeyError: | ||
pytest.skip("'katello plugin' is not present") | ||
|
||
|
||
def test_check_smart_proxy_registered(api, base_url): | ||
hostname = urlparse(base_url).hostname | ||
assert api.resource('smart_proxies').call('show', {'id': hostname}) |