mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-31 05:19:09 -07:00
redhat_subscription: Add support for Red Hat API token (#5725)
Add support for Red Hat API token fix mixed up fix version
This commit is contained in:
parent
84ebda65f1
commit
4dc897d559
3 changed files with 51 additions and 6 deletions
|
@ -102,6 +102,37 @@ TEST_CASES = [
|
|||
'msg': "System successfully registered to 'satellite.company.com'."
|
||||
}
|
||||
],
|
||||
# Test simple registration using token
|
||||
[
|
||||
{
|
||||
'state': 'present',
|
||||
'server_hostname': 'satellite.company.com',
|
||||
'token': 'fake_token',
|
||||
},
|
||||
{
|
||||
'id': 'test_registeration_token',
|
||||
'run_command.calls': [
|
||||
(
|
||||
['/testbin/subscription-manager', 'identity'],
|
||||
{'check_rc': False},
|
||||
(1, '', '')
|
||||
),
|
||||
(
|
||||
['/testbin/subscription-manager', 'config', '--server.hostname=satellite.company.com'],
|
||||
{'check_rc': True},
|
||||
(0, '', '')
|
||||
),
|
||||
(
|
||||
['/testbin/subscription-manager', 'register',
|
||||
'--token', 'fake_token'],
|
||||
{'check_rc': True, 'expand_user_and_vars': False},
|
||||
(0, '', '')
|
||||
)
|
||||
],
|
||||
'changed': True,
|
||||
'msg': "System successfully registered to 'satellite.company.com'."
|
||||
}
|
||||
],
|
||||
# Test unregistration, when system is unregistered
|
||||
[
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue