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
This commit is contained in:
Matthew Jones 2017-03-13 12:00:22 -04:00
parent c13242305f
commit 2641b2a1c3

View File

@ -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