From 2641b2a1c3d438144191c3a088e2c9b2b777a74c Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 13 Mar 2017 12:00:22 -0400 Subject: [PATCH] Implement cloudforms license This is a special license that is triggered in the presence of two directories: - /opt/rh/cfme-appliance - /opt/rh/cfme-gemset and the rpms - cfme - cfme-appliance - cfme-gemset All of which I'm assured are responsible for validating that this is indeed an enterprise cloudforms environment. When these are present then a license is used that is near perpetual, allows for a stupid large number of instances, and turns on all features --- awx/main/tests/functional/core/test_licenses.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/awx/main/tests/functional/core/test_licenses.py b/awx/main/tests/functional/core/test_licenses.py index f2c3d9348e..28d293bc35 100644 --- a/awx/main/tests/functional/core/test_licenses.py +++ b/awx/main/tests/functional/core/test_licenses.py @@ -92,3 +92,15 @@ def test_expired_licenses(): assert vdata['compliant'] is False assert vdata['grace_period_remaining'] > 0 + + +@pytest.mark.django_db +def test_cloudforms_license(mocker): + with mocker.patch('awx.main.task_engine.TaskEnhancer._check_cloudforms_subscription', return_value=True): + task_enhancer = TaskEnhancer() + vdata = task_enhancer.validate_enhancements() + assert vdata['compliant'] is True + assert vdata['subscription_name'] == "Cloudforms License" + assert vdata['available_instances'] == 9999999 + assert vdata['license_type'] == 'enterprise' + assert vdata['features']['ha'] is True