mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Merge branch 'release_3.1.2' into devel
* release_3.1.2: (33 commits) updating changelog for 3.1.2 Add back SRC_ONLY_PKGS Fix ubuntu 14 restart service list pt 2 Make sure the insight playbook fetch doesn't quote user and pass Add requirements/vendor to gitignore Conditionally install from local python dependencies in spec file Remove requirements/vendor on make clean. Update brew-srpm target to generate local requirements files Get offline pip installs working Add clean-dist target Navigate back to the jobDetails state when the user clicks outside the host event modal. Don't use jinja quote filter on insights username or password fix legacy standard out Fixed permissions typo add test, restore old behavior in api test create _survey_element_validation and use it for updating extra_vars Do not set the default if the field was not passed in to kwargs_extra_vars Remove log aggregator port required mark. Modify according to review feedback. Host Event json should be read-only ...
This commit is contained in:
@@ -4,6 +4,7 @@ import json
|
||||
from awx.main.tasks import RunJob
|
||||
from awx.main.models import (
|
||||
Job,
|
||||
JobTemplate,
|
||||
WorkflowJobTemplate
|
||||
)
|
||||
|
||||
@@ -78,6 +79,18 @@ def test_job_args_unredacted_passwords(job):
|
||||
assert extra_vars['secret_key'] == 'my_password'
|
||||
|
||||
|
||||
def test_update_kwargs_survey_invalid_default(survey_spec_factory):
|
||||
spec = survey_spec_factory('var2')
|
||||
spec['spec'][0]['required'] = False
|
||||
spec['spec'][0]['min'] = 3
|
||||
spec['spec'][0]['default'] = 1
|
||||
jt = JobTemplate(name="test-jt", survey_spec=spec, survey_enabled=True, extra_vars="var2: 2")
|
||||
defaulted_extra_vars = jt._update_unified_job_kwargs()
|
||||
assert 'extra_vars' in defaulted_extra_vars
|
||||
# Make sure we did not set the invalid default of 1
|
||||
assert json.loads(defaulted_extra_vars['extra_vars'])['var2'] == 2
|
||||
|
||||
|
||||
class TestWorkflowSurveys:
|
||||
def test_update_kwargs_survey_defaults(self, survey_spec_factory):
|
||||
"Assure that the survey default over-rides a JT variable"
|
||||
|
||||
@@ -147,7 +147,17 @@ def test_https_logging_handler_splunk_auth_info():
|
||||
('http://localhost', None, 'http://localhost'),
|
||||
('http://localhost', 80, 'http://localhost'),
|
||||
('http://localhost', 8080, 'http://localhost:8080'),
|
||||
('https://localhost', 443, 'https://localhost:443')
|
||||
('https://localhost', 443, 'https://localhost:443'),
|
||||
('ftp://localhost', 443, 'ftp://localhost:443'),
|
||||
('https://localhost:550', 443, 'https://localhost:550'),
|
||||
('https://localhost:yoho/foobar', 443, 'https://localhost:443/foobar'),
|
||||
('https://localhost:yoho/foobar', None, 'https://localhost:yoho/foobar'),
|
||||
('http://splunk.server:8088/services/collector/event', 80,
|
||||
'http://splunk.server:8088/services/collector/event'),
|
||||
('http://splunk.server/services/collector/event', 80,
|
||||
'http://splunk.server/services/collector/event'),
|
||||
('http://splunk.server/services/collector/event', 8088,
|
||||
'http://splunk.server:8088/services/collector/event'),
|
||||
])
|
||||
def test_https_logging_handler_http_host_format(host, port, normalized):
|
||||
handler = HTTPSHandler(host=host, port=port)
|
||||
|
||||
Reference in New Issue
Block a user