hammer_cli_foreman 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of hammer_cli_foreman might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/config/foreman.yml +4 -0
- data/doc/host_create.md +4 -4
- data/doc/release_notes.md +24 -6
- data/lib/hammer_cli_foreman/associating_commands.rb +54 -0
- data/lib/hammer_cli_foreman/commands.rb +28 -7
- data/lib/hammer_cli_foreman/exception_handler.rb +18 -0
- data/lib/hammer_cli_foreman/exceptions.rb +1 -1
- data/lib/hammer_cli_foreman/host.rb +11 -6
- data/lib/hammer_cli_foreman/id_resolver.rb +10 -2
- data/lib/hammer_cli_foreman/partition_table.rb +1 -0
- data/lib/hammer_cli_foreman/smart_class_parameter.rb +5 -1
- data/lib/hammer_cli_foreman/smart_variable.rb +1 -1
- data/lib/hammer_cli_foreman/template.rb +29 -5
- data/lib/hammer_cli_foreman/testing/api_expectations.rb +6 -6
- data/lib/hammer_cli_foreman/user.rb +2 -1
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ca/hammer-cli-foreman.edit.po +2622 -0
- data/locale/ca/hammer-cli-foreman.po +2544 -0
- data/locale/ca/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/de/hammer-cli-foreman.edit.po +2613 -0
- data/locale/de/hammer-cli-foreman.po +132 -122
- data/locale/de/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en/hammer-cli-foreman.edit.po +2575 -0
- data/locale/en/hammer-cli-foreman.po +157 -8
- data/locale/en/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en_GB/hammer-cli-foreman.edit.po +2582 -0
- data/locale/en_GB/hammer-cli-foreman.po +151 -141
- data/locale/en_GB/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/es/hammer-cli-foreman.edit.po +2625 -0
- data/locale/es/hammer-cli-foreman.po +110 -100
- data/locale/es/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/fr/hammer-cli-foreman.edit.po +2626 -0
- data/locale/fr/hammer-cli-foreman.po +110 -100
- data/locale/fr/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/hammer-cli-foreman.pot +390 -190
- data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/it/hammer-cli-foreman.edit.po +2601 -0
- data/locale/it/hammer-cli-foreman.po +139 -129
- data/locale/it/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ja/hammer-cli-foreman.edit.po +2601 -0
- data/locale/ja/hammer-cli-foreman.po +140 -130
- data/locale/ja/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ko/hammer-cli-foreman.edit.po +2599 -0
- data/locale/ko/hammer-cli-foreman.po +138 -128
- data/locale/ko/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/pt_BR/hammer-cli-foreman.edit.po +2628 -0
- data/locale/pt_BR/hammer-cli-foreman.po +112 -102
- data/locale/pt_BR/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ru/hammer-cli-foreman.edit.po +2602 -0
- data/locale/ru/hammer-cli-foreman.po +265 -254
- data/locale/ru/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_CN/hammer-cli-foreman.edit.po +2599 -0
- data/locale/zh_CN/hammer-cli-foreman.po +136 -126
- data/locale/zh_CN/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_TW/hammer-cli-foreman.edit.po +2599 -0
- data/locale/zh_TW/hammer-cli-foreman.po +137 -127
- data/locale/zh_TW/hammer-cli-foreman.po.time_stamp +0 -0
- data/test/data/README.md +6 -1
- data/test/functional/commands/list_test.rb +141 -0
- data/test/functional/organization_test.rb +71 -0
- data/test/functional/smart_class_parameter_test.rb +61 -0
- data/test/functional/template_test.rb +80 -0
- data/test/functional/test_helper.rb +3 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-InfoCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-DeleteCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-SetCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-SetCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-CreateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-DeleteParameterCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-DeleteParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-InfoCommand-output.xml +21 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-SetParameterCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-SetParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ExceptionHandler.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Host-CreateCommand-parameters.xml +46 -0
- data/test/reports/TEST-HammerCLIForeman-Host-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Host-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-DeleteParameterCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Host-DeleteParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-InfoCommand-output.xml +85 -0
- data/test/reports/TEST-HammerCLIForeman-Host-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Host-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-ListCommand-output.xml +21 -0
- data/test/reports/TEST-HammerCLIForeman-Host-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Host-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-PuppetRunCommand-output.xml +9 -0
- data/test/reports/TEST-HammerCLIForeman-Host-PuppetRunCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-SetParameterCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Host-SetParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-StatusCommand-output.xml +9 -0
- data/test/reports/TEST-HammerCLIForeman-Host-StatusCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-UpdateCommand-parameters.xml +40 -0
- data/test/reports/TEST-HammerCLIForeman-Host-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-DeleteCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-DeleteParameterCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-DeleteParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-InfoCommand-output.xml +29 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-InfoCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-ListCommand-output.xml +27 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-SetParameterCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-SetParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-UpdateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-CreateCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Location-DeleteCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Location-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Location-InfoCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Location-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Location-ListCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Location-UpdateCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-CreateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-InfoCommand-output.xml +23 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-UpdateCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-DeleteParameterCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-DeleteParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-InfoCommand-output.xml +27 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-ListCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-SetParameterCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-SetParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-UpdateCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-CreateCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-DeleteCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-InfoCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-ListCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-UpdateCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-CreateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-DumpCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-DumpCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-InfoCommand-output.xml +19 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-UpdateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-CreateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-InfoCommand-output.xml +21 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-ListCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-CreateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-InfoCommand-output.xml +43 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-ListCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-CreateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Template-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-DeleteCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Template-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-DumpCommand-parameters.xml +12 -0
- data/test/reports/TEST-HammerCLIForeman-Template-DumpCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Template-InfoCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Template-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListKindsCommand-parameters.xml +9 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListKindsCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-UpdateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Template-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-CreateCommand-parameters.xml +19 -0
- data/test/reports/TEST-HammerCLIForeman-User-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-DeleteCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-User-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-InfoCommand-output.xml +23 -0
- data/test/reports/TEST-HammerCLIForeman-User-InfoCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-User-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-ListCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-User-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-User-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-UpdateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-User-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User.xml +7 -0
- data/test/reports/TEST-MiniTest-Spec.xml +7 -0
- data/test/unit/commands_test.rb +9 -9
- data/test/unit/data/test_api.json +43 -0
- data/test/unit/exception_handler_test.rb +20 -1
- data/test/unit/host_test.rb +12 -0
- data/test/unit/id_resolver_test.rb +18 -2
- data/test/unit/user_test.rb +1 -1
- metadata +561 -46
File without changes
|
data/test/data/README.md
CHANGED
@@ -7,11 +7,16 @@
|
|
7
7
|
```bash
|
8
8
|
$ APIPIE_RECORD=examples rake test:functionals
|
9
9
|
```
|
10
|
-
1. on the **Foreman instance** generate API documentation cache. It will land in `/usr/share/foreman/public/apipie-cache/apidoc.json`
|
10
|
+
1. on the **Foreman instance** generate API documentation cache. It will land in `/usr/share/foreman/public/apipie-cache/apidoc/v2.en.json`
|
11
11
|
|
12
12
|
```bash
|
13
13
|
$ FOREMAN_APIPIE_LANGS=en foreman-rake apipie:cache
|
14
14
|
```
|
15
|
+
1. when running from **git**, run a similar command and it will land in `$FOREMAN_CHECKOUT/public/apipie-cache/apidoc/v2.en.json`
|
16
|
+
|
17
|
+
```bash
|
18
|
+
$ FOREMAN_APIPIE_LANGS=en rake apipie:cache
|
19
|
+
```
|
15
20
|
1. in **hammer-cli-foreman** in `test/unit/data/` Create directory with name matching the Foreman version in `test/unit/data/` (e.g. `test/unit/data/1.10`)
|
16
21
|
1. copy the API cache from the Foreman instance into the newly created directory and name it as `foreman_api.json`
|
17
22
|
1. update the following line in `test/unit/test_helper.rb` to match the new default Foreman version
|
@@ -0,0 +1,141 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'test_helper')
|
2
|
+
|
3
|
+
describe HammerCLIForeman::ListCommand do
|
4
|
+
class TestList < HammerCLIForeman::ListCommand
|
5
|
+
resource :domains
|
6
|
+
|
7
|
+
option '--page', 'PAGE', ''
|
8
|
+
option '--per-page', 'PER_PAGE', ''
|
9
|
+
end
|
10
|
+
|
11
|
+
class TestListWithOutput < TestList
|
12
|
+
output do
|
13
|
+
field :id, "Id"
|
14
|
+
field :name, "Name"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def build_items(cnt)
|
19
|
+
(1..cnt).map do |i|
|
20
|
+
{:id => i, :name => "Item #{i}"}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def expect_paged_call(page, per_page, item_cnt, response_metadata={})
|
25
|
+
api_expects(:domains, :index, "List records page #{page}") do |par|
|
26
|
+
par["page"].to_i == page && par["per_page"].to_i == per_page
|
27
|
+
end.returns(index_response(build_items(item_cnt), response_metadata))
|
28
|
+
end
|
29
|
+
|
30
|
+
let(:per_page_all) { HammerCLIForeman::ListCommand::RETRIEVE_ALL_PER_PAGE }
|
31
|
+
|
32
|
+
after do
|
33
|
+
HammerCLI::Settings.clear
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "api interaction" do
|
37
|
+
context "without per_page in settings" do
|
38
|
+
it "fetches only first page when there's not enough records" do
|
39
|
+
expect_paged_call(1, 1000, 10)
|
40
|
+
result = run_cmd([], {}, TestList)
|
41
|
+
result.exit_code.must_equal HammerCLI::EX_OK
|
42
|
+
end
|
43
|
+
|
44
|
+
it "fetches all records" do
|
45
|
+
expect_paged_call(1, per_page_all, 1000)
|
46
|
+
expect_paged_call(2, per_page_all, 1000)
|
47
|
+
expect_paged_call(3, per_page_all, 10)
|
48
|
+
|
49
|
+
result = run_cmd([], {}, TestList)
|
50
|
+
result.exit_code.must_equal HammerCLI::EX_OK
|
51
|
+
end
|
52
|
+
|
53
|
+
it "uses --per-page value" do
|
54
|
+
per_page = 10
|
55
|
+
expect_paged_call(1, per_page, 10)
|
56
|
+
result = run_cmd(["--per-page=#{per_page}"], {}, TestList)
|
57
|
+
result.exit_code.must_equal HammerCLI::EX_OK
|
58
|
+
end
|
59
|
+
|
60
|
+
it "uses both --per-page and --page value" do
|
61
|
+
per_page = 10
|
62
|
+
expect_paged_call(2, per_page, 10)
|
63
|
+
result = run_cmd(["--per-page=#{per_page}", '--page=2'], {}, TestList)
|
64
|
+
result.exit_code.must_equal HammerCLI::EX_OK
|
65
|
+
end
|
66
|
+
|
67
|
+
it "sets per_page to 20 when only --page is used" do
|
68
|
+
expect_paged_call(2, 20, 10)
|
69
|
+
result = run_cmd(['--page=2'], {}, TestList)
|
70
|
+
result.exit_code.must_equal HammerCLI::EX_OK
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
context "with per_page in settings" do
|
75
|
+
let(:per_page_in_settings) { 30 }
|
76
|
+
before do
|
77
|
+
HammerCLI::Settings.load({ :ui => { :per_page => per_page_in_settings } })
|
78
|
+
end
|
79
|
+
|
80
|
+
it "gives preference to --per-page option over per_page setting" do
|
81
|
+
per_page = 10
|
82
|
+
expect_paged_call(1, per_page, 10)
|
83
|
+
result = run_cmd(["--per-page=#{per_page}"], {}, TestList)
|
84
|
+
result.exit_code.must_equal HammerCLI::EX_OK
|
85
|
+
end
|
86
|
+
|
87
|
+
it "respects per_page setting when the adapter allows pagination by default" do
|
88
|
+
expect_paged_call(1, per_page_in_settings, 30)
|
89
|
+
result = run_cmd([], { :adapter => :base, :interactive => false }, TestList)
|
90
|
+
result.exit_code.must_equal HammerCLI::EX_OK
|
91
|
+
end
|
92
|
+
|
93
|
+
it "fetches all records when the adapter doesn't allow pagination by default" do
|
94
|
+
expect_paged_call(1, per_page_all, 1000)
|
95
|
+
expect_paged_call(2, per_page_all, 10)
|
96
|
+
result = run_cmd([], { :adapter => :csv, :interactive => false }, TestList)
|
97
|
+
result.exit_code.must_equal HammerCLI::EX_OK
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe "pagination output" do
|
103
|
+
let(:row_data) { ['1', 'Item 1'] }
|
104
|
+
let(:header) { ['ID', 'NAME'] }
|
105
|
+
let(:pagination) { ['Page 1 of 2 (use --page and --per-page for navigation)'] }
|
106
|
+
let(:output_without_pagination) { IndexMatcher.new([header, row_data]) }
|
107
|
+
let(:output_with_pagination) { IndexMatcher.new([header, row_data, pagination]) }
|
108
|
+
let(:pagination_line_re) { /Page [1-9] of [0-9]/ }
|
109
|
+
|
110
|
+
it 'prints all rows by default' do
|
111
|
+
expected_result = success_result(output_without_pagination)
|
112
|
+
expect_paged_call(1, per_page_all, 1)
|
113
|
+
|
114
|
+
result = run_cmd([], {}, TestListWithOutput)
|
115
|
+
assert_cmd(expected_result, result)
|
116
|
+
result.out.wont_match pagination_line_re
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'prints one page when --per-page is used' do
|
120
|
+
expected_result = success_result(output_with_pagination)
|
121
|
+
expect_paged_call(1, 1, 1, :total => 2, :subtotal => 2, :per_page => 1, :page => 1)
|
122
|
+
|
123
|
+
result = run_cmd(['--per-page=1'], {}, TestListWithOutput)
|
124
|
+
assert_cmd(expected_result, result)
|
125
|
+
end
|
126
|
+
|
127
|
+
context 'with per_page in settings' do
|
128
|
+
before do
|
129
|
+
HammerCLI::Settings.load({ :ui => { :per_page => '1' } })
|
130
|
+
end
|
131
|
+
|
132
|
+
it 'prints one page when per_page is set in the config' do
|
133
|
+
expected_result = success_result(output_with_pagination)
|
134
|
+
expect_paged_call(1, 1, 1, :total => 2, :subtotal => 2, :per_page => 1, :page => 1)
|
135
|
+
|
136
|
+
result = run_cmd([], {}, TestListWithOutput)
|
137
|
+
assert_cmd(expected_result, result)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
@@ -138,3 +138,74 @@ describe "parameters" do
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
end
|
141
|
+
|
142
|
+
describe 'associating commands' do
|
143
|
+
def failure_test(message, &block)
|
144
|
+
error = Errno::ECONNREFUSED.new 'connect(2) for "testhost" port 3000'
|
145
|
+
block.call.raises(error)
|
146
|
+
result = run_cmd(@cmd + @params)
|
147
|
+
expected = common_error_result(
|
148
|
+
@cmd,
|
149
|
+
error.message,
|
150
|
+
message
|
151
|
+
)
|
152
|
+
assert_cmd(expected, result)
|
153
|
+
end
|
154
|
+
|
155
|
+
describe 'add domain' do
|
156
|
+
before do
|
157
|
+
@cmd = %w(organization add-domain)
|
158
|
+
@params = %w(--id=1 --domain-id=5)
|
159
|
+
end
|
160
|
+
|
161
|
+
it "should output success message" do
|
162
|
+
api_expects(:organizations, :show, 'Find organization') do |par|
|
163
|
+
par[:id] == '1'
|
164
|
+
end.returns({:id => 1, 'domains' => [{'id' => '1'}]})
|
165
|
+
api_expects(:organizations, :update, 'Update organization') do |par|
|
166
|
+
par['id'] == '1' &&
|
167
|
+
par['organization']['domain_ids'] == ['1', '5']
|
168
|
+
end
|
169
|
+
result = run_cmd(@cmd + @params)
|
170
|
+
expected = success_result("The domain has been associated\n")
|
171
|
+
assert_cmd(expected, result)
|
172
|
+
end
|
173
|
+
|
174
|
+
it "should output failure message" do
|
175
|
+
failure_test "Could not associate the domain" do
|
176
|
+
api_expects(:organizations, :show, 'Find organization') do |par|
|
177
|
+
par[:id] == '1'
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
describe 'remove domain' do
|
184
|
+
before do
|
185
|
+
@cmd = %w(organization remove-domain)
|
186
|
+
@params = %w(--id=1 --domain-id=5)
|
187
|
+
end
|
188
|
+
|
189
|
+
it "should output success message" do
|
190
|
+
domains = ['1', '5'].map { |x| { 'id' => x } }
|
191
|
+
api_expects(:organizations, :show, 'Find organization') do |par|
|
192
|
+
par[:id] == '1'
|
193
|
+
end.returns({:id => 1, 'domains' => domains})
|
194
|
+
api_expects(:organizations, :update, 'Update organization') do |par|
|
195
|
+
par['id'] == '1' &&
|
196
|
+
par['organization']['domain_ids'] == ['1']
|
197
|
+
end
|
198
|
+
result = run_cmd(@cmd + @params)
|
199
|
+
expected = success_result("The domain has been disassociated\n")
|
200
|
+
assert_cmd(expected, result)
|
201
|
+
end
|
202
|
+
|
203
|
+
it "should output failure message" do
|
204
|
+
failure_test "Could not disassociate the domain" do
|
205
|
+
api_expects(:organizations, :show, 'Find organization') do |par|
|
206
|
+
par[:id] == '1'
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
@@ -19,3 +19,64 @@ describe 'sc-params update' do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
end
|
22
|
+
|
23
|
+
describe 'sc-params add-override-value' do
|
24
|
+
let(:cmd) { %w(sc-param add-override-value) }
|
25
|
+
let(:override_value) { 'something' }
|
26
|
+
let(:match) { 'domain = example.com' }
|
27
|
+
let(:puppet_class) { { 'name' => 'motd', 'id' => '1' } }
|
28
|
+
let(:parameter) { { 'name' => 'content', 'id' => '2' } }
|
29
|
+
let(:base) { [
|
30
|
+
'--puppet-class', puppet_class['name'],
|
31
|
+
'--smart-class-parameter', parameter['name'],
|
32
|
+
'--match', match
|
33
|
+
] }
|
34
|
+
|
35
|
+
it 'allows to set value' do
|
36
|
+
params = ['--value', override_value]
|
37
|
+
expected_result = success_result("Override value created\n")
|
38
|
+
|
39
|
+
prepare_api_expectations = proc do
|
40
|
+
expectations = []
|
41
|
+
expectations << api_expects(:puppetclasses, :index, 'Find puppet class') do |par|
|
42
|
+
par[:search] == %Q(name = "#{puppet_class['name']}")
|
43
|
+
end.returns(index_response('motd' => [puppet_class]))
|
44
|
+
|
45
|
+
expectations << api_expects(:smart_class_parameters, :index, 'Find smart parameter') do |par|
|
46
|
+
par[:search] == %Q(key = "#{parameter['name']}") &&
|
47
|
+
par[:puppetclass_id] == puppet_class['id']
|
48
|
+
end.returns(index_response([parameter]))
|
49
|
+
|
50
|
+
expectations << api_expects(:override_values, :create, 'Create override value') do |par|
|
51
|
+
val = par['override_value']
|
52
|
+
par['smart_class_parameter_id'] == parameter['id'] &&
|
53
|
+
val['match'] == match &&
|
54
|
+
val['value'] == override_value
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
expectations = prepare_api_expectations.call()
|
59
|
+
result = run_cmd(cmd + base + params)
|
60
|
+
assert_cmd(expected_result, result)
|
61
|
+
assert expectations.all?(&:verified?)
|
62
|
+
|
63
|
+
expectations = prepare_api_expectations.call()
|
64
|
+
result = run_cmd(cmd + base + params + ['--use-puppet-default', false])
|
65
|
+
assert_cmd(expected_result, result)
|
66
|
+
assert expectations.all?(&:verified?)
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'does not allow to use puppet default and value at the same time' do
|
70
|
+
params = ['--value', 'something', '--use-puppet-default', true]
|
71
|
+
|
72
|
+
expected_result = usage_error_result(
|
73
|
+
cmd,
|
74
|
+
"Cannot use --value when --use-puppet-default is true",
|
75
|
+
'Could not create the override value'
|
76
|
+
)
|
77
|
+
|
78
|
+
api_expects_no_call
|
79
|
+
result = run_cmd(cmd + base + params)
|
80
|
+
assert_cmd(expected_result, result)
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
|
+
|
3
|
+
describe 'template' do
|
4
|
+
describe 'clone' do
|
5
|
+
before do
|
6
|
+
@cmd = %w(template clone)
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should print error on missing --id' do
|
10
|
+
params = ['--new-name=zzz']
|
11
|
+
|
12
|
+
expected_result = CommandExpectation.new
|
13
|
+
expected_result.expected_err =
|
14
|
+
['Could not clone the config template:',
|
15
|
+
" Missing arguments for 'id'",
|
16
|
+
''].join("\n")
|
17
|
+
expected_result.expected_exit_code = HammerCLI::EX_USAGE
|
18
|
+
|
19
|
+
api_expects_no_call
|
20
|
+
|
21
|
+
result = run_cmd(@cmd + params)
|
22
|
+
|
23
|
+
assert_cmd(expected_result, result)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should print error on missing --new-name' do
|
27
|
+
params = ['--id=1']
|
28
|
+
|
29
|
+
expected_result = usage_error_result(
|
30
|
+
@cmd,
|
31
|
+
'Option --new-name is required',
|
32
|
+
'Could not clone the config template')
|
33
|
+
|
34
|
+
api_expects_no_call
|
35
|
+
|
36
|
+
result = run_cmd(@cmd + params)
|
37
|
+
|
38
|
+
assert_cmd(expected_result, result)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should clone a template by id' do
|
42
|
+
params = ['--id=1', '--new-name=zzz']
|
43
|
+
|
44
|
+
api_expects(:config_templates, :clone, 'Clone template') do |par|
|
45
|
+
par['id'] == '1' && par['config_template']['name'] == 'zzz'
|
46
|
+
end.returns(:name => 'A', :value => '1')
|
47
|
+
|
48
|
+
result = run_cmd(@cmd + params)
|
49
|
+
|
50
|
+
assert_cmd(success_result("Config template cloned\n"), result)
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'should clone a template by name' do
|
54
|
+
params = ['--name=old', '--new-name=zzz']
|
55
|
+
|
56
|
+
api_expects(:config_templates, :index, 'Attempt find template') do |par|
|
57
|
+
par[:search] == 'name = "old"'
|
58
|
+
end.returns(
|
59
|
+
index_response(
|
60
|
+
[{
|
61
|
+
'snippet' => false,
|
62
|
+
'audit_comment' => nil,
|
63
|
+
'created_at' => '2016-02-29 14:32:57 UTC',
|
64
|
+
'updated_at' => '2016-02-29 14:32:57 UTC',
|
65
|
+
'id' => 1,
|
66
|
+
'name' => 'zzz',
|
67
|
+
'template_kind_id' => 7,
|
68
|
+
'template_kind_name' => 'user_data'
|
69
|
+
}]))
|
70
|
+
|
71
|
+
api_expects(:config_templates, :clone, 'Clone template') do |par|
|
72
|
+
par['id'] == 1 && par['config_template']['name'] == 'zzz'
|
73
|
+
end.returns(:name => 'A', :value => '1')
|
74
|
+
|
75
|
+
result = run_cmd(@cmd + params)
|
76
|
+
|
77
|
+
assert_cmd(success_result("Config template cloned\n"), result)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -1,7 +1,10 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), '../test_helper')
|
2
2
|
|
3
3
|
require 'hammer_cli/testing/command_assertions'
|
4
|
+
require 'hammer_cli/testing/output_matchers'
|
5
|
+
|
4
6
|
require 'hammer_cli_foreman/testing/api_expectations'
|
5
7
|
|
6
8
|
include HammerCLI::Testing::CommandAssertions
|
9
|
+
include HammerCLI::Testing::OutputMatchers
|
7
10
|
include HammerCLIForeman::Testing::APIExpectations
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<testsuite name="HammerCLIForeman::Architecture::CreateCommand::parameters" tests="2" time="0.010592708" failures="0" errors="0" skipped="0" assertions="2">
|
3
|
+
<testcase name="test_0002_should fail with name missing" time="0.008160524" assertions="1">
|
4
|
+
</testcase>
|
5
|
+
<testcase name="test_0001_should accept name" time="0.002136914" assertions="1">
|
6
|
+
</testcase>
|
7
|
+
<system-out>
|
8
|
+
</system-out>
|
9
|
+
<system-err>
|
10
|
+
</system-err>
|
11
|
+
</testsuite>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<testsuite name="HammerCLIForeman::Architecture::DeleteCommand::parameters" tests="3" time="0.005292196" failures="0" errors="0" skipped="0" assertions="3">
|
3
|
+
<testcase name="test_0003_should fail with name or id missing" time="0.00155957" assertions="1">
|
4
|
+
</testcase>
|
5
|
+
<testcase name="test_0002_should accept id" time="0.001930339" assertions="1">
|
6
|
+
</testcase>
|
7
|
+
<testcase name="test_0001_should accept name" time="0.001509438" assertions="1">
|
8
|
+
</testcase>
|
9
|
+
<system-out>
|
10
|
+
</system-out>
|
11
|
+
<system-err>
|
12
|
+
</system-err>
|
13
|
+
</testsuite>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<testsuite name="HammerCLIForeman::Architecture::InfoCommand::output" tests="3" time="0.008668972" failures="0" errors="0" skipped="0" assertions="5">
|
3
|
+
<testcase name="test_0001_should print 1 records" time="0.003258728" assertions="1">
|
4
|
+
</testcase>
|
5
|
+
<testcase name="test_0002_should print column Name" time="0.002410385" assertions="2">
|
6
|
+
</testcase>
|
7
|
+
<testcase name="test_0003_should print column Id" time="0.002710322" assertions="2">
|
8
|
+
</testcase>
|
9
|
+
<system-out>
|
10
|
+
</system-out>
|
11
|
+
<system-err>
|
12
|
+
</system-err>
|
13
|
+
</testsuite>
|