Remove license code in Quay
No longer needed under Red Hat rules \o/ Fixes https://jira.coreos.com/browse/QUAY-883
This commit is contained in:
parent
041a7fcd36
commit
3586955669
23 changed files with 19 additions and 1471 deletions
|
@ -1,48 +0,0 @@
|
|||
import pytest
|
||||
|
||||
from mock import patch
|
||||
|
||||
from util.config.validators import ConfigValidationException
|
||||
from util.config.validators.validate_license import LicenseValidator
|
||||
from util.morecollections import AttrDict
|
||||
from util.license import License, QUAY_DEPLOYMENTS_ENTITLEMENT, QUAY_ENTITLEMENT
|
||||
|
||||
from test.fixtures import *
|
||||
|
||||
@pytest.mark.parametrize('deployments, allowed_deployments', [
|
||||
(1, 1),
|
||||
(3, 3),
|
||||
(3, 2),
|
||||
(3, 1),
|
||||
])
|
||||
def test_too_many_storage_engines(deployments, allowed_deployments, app):
|
||||
def get_license():
|
||||
decoded = {
|
||||
'expirationDate': '2157-12-1',
|
||||
'subscriptions': {
|
||||
'someSubscription': {
|
||||
'serviceEnd': '2157-12-1',
|
||||
'durationPeriod': 'yearly',
|
||||
'entitlements': {
|
||||
QUAY_ENTITLEMENT: 1,
|
||||
QUAY_DEPLOYMENTS_ENTITLEMENT: allowed_deployments,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
return License(decoded)
|
||||
|
||||
storage_configs = [(str(i), {}) for i in range(0, deployments)]
|
||||
|
||||
with patch('app.config_provider.get_license', get_license):
|
||||
validator = LicenseValidator()
|
||||
|
||||
if allowed_deployments < deployments:
|
||||
with pytest.raises(ConfigValidationException):
|
||||
validator.validate({
|
||||
'DISTRIBUTED_STORAGE_CONFIG': storage_configs,
|
||||
}, None, None)
|
||||
else:
|
||||
validator.validate({
|
||||
'DISTRIBUTED_STORAGE_CONFIG': storage_configs,
|
||||
}, None, None)
|
Reference in a new issue