Skip to content

Commit

Permalink
Add basic Foreman tests to replace fb-test-foreman.bats
Browse files Browse the repository at this point in the history
Additionally replaces fb-test-katello.bats
  • Loading branch information
ehelms committed Dec 15, 2020
1 parent fbf21f9 commit cd2fa49
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_foreman.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pytest

from urllib.parse import urlparse


def test_foreman_version(api, variables):
if 'foreman_version' not in variables:
pytest.skip("'foreman_version' is not set")

status = api.resource('home').call('status')

assert status['version'] == variables['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'


def test_check_smart_proxy_registered(api, base_url):
hostname = urlparse(base_url).hostname
assert api.resource('smart_proxies').call('show', {'id': hostname})
1 change: 1 addition & 0 deletions variables.json.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"foreman_version": "2.4.0-develop",
"username": "admin",
"password": "changeme",
"clients": [
Expand Down

0 comments on commit cd2fa49

Please sign in to comment.