redhat_subscription: Add server_prefix and server_port as supported arguments (#2779)

* Add server_prefix and server_port as supported arguments for the redhat_subscription module.

* Adjust the argument sequence in the test case to be consistent with the original code in line 364 in redhat_subscription.py and add the changelog fragment.

* Grammatical changes such as adding full stops and using 'an HTTP' instead of 'a HTTP'.

* Commit the suggested changelog update.

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Fix typo.

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Amin Vakil <info@aminvakil.com>
This commit is contained in:
Tong He 2021-06-16 03:01:54 -04:00 committed by GitHub
commit 2f2f384b4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 3 deletions

View file

@ -258,6 +258,47 @@ TEST_CASES = [
'msg': "System successfully registered to 'None'."
}
],
# Test of registration with arguments that are not part of register options but needs to be configured
[
{
'state': 'present',
'username': 'admin',
'password': 'admin',
'org_id': 'admin',
'force_register': 'true',
'server_prefix': '/rhsm',
'server_port': '443'
},
{
'id': 'test_arguments_not_in_register_options',
'run_command.calls': [
(
['/testbin/subscription-manager', 'identity'],
{'check_rc': False},
(0, 'This system already registered.', '')
),
(
['/testbin/subscription-manager', 'config',
'--server.port=443',
'--server.prefix=/rhsm'
],
{'check_rc': True},
(0, '', '')
),
(
['/testbin/subscription-manager', 'register',
'--force',
'--org', 'admin',
'--username', 'admin',
'--password', 'admin'],
{'check_rc': True, 'expand_user_and_vars': False},
(0, '', '')
)
],
'changed': True,
'msg': "System successfully registered to 'None'."
}
],
# Test of registration using username, password and proxy options
[
{