hammer_cli_foreman 2.5.2 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/release_notes.md +10 -4
- data/lib/hammer_cli_foreman/architecture.rb +5 -5
- data/lib/hammer_cli_foreman/associating_commands.rb +0 -24
- data/lib/hammer_cli_foreman/bookmark.rb +5 -5
- data/lib/hammer_cli_foreman/combination.rb +3 -13
- data/lib/hammer_cli_foreman/command_extensions.rb +0 -2
- data/lib/hammer_cli_foreman/commands.rb +2 -9
- data/lib/hammer_cli_foreman/compute_profile.rb +5 -5
- data/lib/hammer_cli_foreman/host.rb +0 -35
- data/lib/hammer_cli_foreman/hostgroup.rb +2 -53
- data/lib/hammer_cli_foreman/hosts/common_update_options.rb +1 -23
- data/lib/hammer_cli_foreman/id_resolver.rb +0 -61
- data/lib/hammer_cli_foreman/location.rb +0 -6
- data/lib/hammer_cli_foreman/mail_notification.rb +2 -2
- data/lib/hammer_cli_foreman/model.rb +5 -5
- data/lib/hammer_cli_foreman/operating_system.rb +10 -10
- data/lib/hammer_cli_foreman/option_sources/id_params.rb +27 -10
- data/lib/hammer_cli_foreman/option_sources/ids_params.rb +25 -6
- data/lib/hammer_cli_foreman/option_sources.rb +0 -1
- data/lib/hammer_cli_foreman/organization.rb +0 -6
- data/lib/hammer_cli_foreman/references.rb +0 -16
- data/lib/hammer_cli_foreman/settings.rb +3 -3
- data/lib/hammer_cli_foreman/smart_proxy.rb +0 -52
- data/lib/hammer_cli_foreman/usergroup.rb +5 -5
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/lib/hammer_cli_foreman.rb +0 -21
- data/lib/minitest/coverage_reporter.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/test/functional/architecture_test.rb +6 -4
- data/test/functional/bookmark_test.rb +3 -1
- data/test/functional/compute_profile_test.rb +3 -1
- data/test/functional/host_test.rb +0 -1
- data/test/functional/hostgroup/create_test.rb +0 -117
- data/test/functional/hostgroup/update_test.rb +0 -79
- data/test/functional/location_test.rb +0 -3
- data/test/functional/mail_notification_test.rb +3 -1
- data/test/functional/model_test.rb +3 -1
- data/test/functional/operating_system_test.rb +3 -1
- data/test/functional/settings_test.rb +4 -4
- data/test/functional/template_test.rb +4 -37
- data/test/functional/usergroup_test.rb +3 -1
- data/test/unit/apipie_resource_mock.rb +1 -39
- data/test/unit/architecture_test.rb +10 -10
- data/test/unit/bookmark_test.rb +10 -14
- data/test/unit/compute_profile_test.rb +10 -10
- data/test/unit/helpers/command.rb +0 -8
- data/test/unit/host_test.rb +14 -61
- data/test/unit/hostgroup_test.rb +7 -26
- data/test/unit/id_resolver_test.rb +0 -28
- data/test/unit/mail_notification_test.rb +4 -4
- data/test/unit/model_test.rb +47 -47
- data/test/unit/operating_system_test.rb +10 -16
- data/test/unit/option_sources/id_params_test.rb +9 -0
- data/test/unit/option_sources/ids_params_test.rb +9 -0
- data/test/unit/settings_test.rb +4 -4
- data/test/unit/smart_proxy_test.rb +0 -12
- data/test/unit/usergroup_test.rb +10 -10
- metadata +27 -48
- data/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb +0 -29
- data/lib/hammer_cli_foreman/command_extensions/puppet_environments.rb +0 -29
- data/lib/hammer_cli_foreman/config_group.rb +0 -45
- data/lib/hammer_cli_foreman/option_sources/puppet_environment_params.rb +0 -59
- data/lib/hammer_cli_foreman/puppet_class.rb +0 -61
- data/lib/hammer_cli_foreman/puppet_environment.rb +0 -65
- data/lib/hammer_cli_foreman/smart_class_parameter.rb +0 -189
- data/test/functional/config_group_test.rb +0 -50
- data/test/functional/proxy_test.rb +0 -86
- data/test/functional/smart_class_parameter_test.rb +0 -97
- data/test/unit/config_group_test.rb +0 -82
- data/test/unit/puppet_class_test.rb +0 -72
- data/test/unit/puppet_environment_test.rb +0 -114
- data/test/unit/smart_class_parameter_test.rb +0 -113
@@ -1,113 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
|
-
require File.join(File.dirname(__FILE__), 'apipie_resource_mock')
|
3
|
-
|
4
|
-
require 'hammer_cli_foreman/smart_class_parameter'
|
5
|
-
|
6
|
-
describe HammerCLIForeman::SmartClassParameter do
|
7
|
-
|
8
|
-
include CommandTestHelper
|
9
|
-
|
10
|
-
context "ListCommand" do
|
11
|
-
|
12
|
-
before :each do
|
13
|
-
ResourceMocks.smart_class_parameters_index
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:cmd) { HammerCLIForeman::SmartClassParameter::ListCommand.new("", ctx) }
|
17
|
-
|
18
|
-
context "parameters" do
|
19
|
-
it_should_accept "no arguments"
|
20
|
-
it_should_accept "hostgroup id", ["--hostgroup-id=1"]
|
21
|
-
it_should_accept "host id", ["--host-id=1"]
|
22
|
-
it_should_accept "environment id", ["--environment-id=1"]
|
23
|
-
it_should_accept "puppet-class-id", ["--puppet-class-id=1"]
|
24
|
-
it_should_accept_search_params
|
25
|
-
end
|
26
|
-
|
27
|
-
context "output" do
|
28
|
-
let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
|
29
|
-
|
30
|
-
it_should_print_n_records
|
31
|
-
it_should_print_column "Id"
|
32
|
-
it_should_print_column "Class Id"
|
33
|
-
it_should_print_column "Puppet class"
|
34
|
-
it_should_print_column "Parameter"
|
35
|
-
it_should_print_column "Default Value"
|
36
|
-
it_should_print_column "Override"
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
|
-
context "InfoCommand" do
|
43
|
-
|
44
|
-
before :each do
|
45
|
-
ResourceMocks.smart_class_parameters_show
|
46
|
-
end
|
47
|
-
|
48
|
-
let(:cmd) { HammerCLIForeman::SmartClassParameter::InfoCommand.new("", ctx) }
|
49
|
-
|
50
|
-
context "parameters" do
|
51
|
-
it_should_accept "id", ["--id=1"]
|
52
|
-
it_should_accept "name, puppet-class", ["--name=par", "--puppet-class=ntp"]
|
53
|
-
it_should_fail_with "name", ["--name=par"]
|
54
|
-
# it_should_fail_with "no arguments"
|
55
|
-
# TODO: temporarily disabled, parameters are checked in the id resolver
|
56
|
-
end
|
57
|
-
|
58
|
-
context "output" do
|
59
|
-
with_params ["--id=1"] do
|
60
|
-
it_should_print_n_records 1
|
61
|
-
it_should_print_columns ["Description", "Type", "Omit", "Required"]
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
|
67
|
-
context "UpdateCommand" do
|
68
|
-
|
69
|
-
let(:cmd) { HammerCLIForeman::SmartClassParameter::UpdateCommand.new("", ctx) }
|
70
|
-
|
71
|
-
context "parameters" do
|
72
|
-
it_should_accept "id", ["--id=1"]
|
73
|
-
it_should_accept "name, puppet-class", ["--name=par", "--puppet-class=ntp"]
|
74
|
-
it_should_fail_with "name", ["--name=par"]
|
75
|
-
it_should_accept "override", ["--id=1","--override=true"]
|
76
|
-
it_should_accept "description", ["--id=1","--description=descr"]
|
77
|
-
it_should_accept "default-value", ["--id=1","--default-value=1"]
|
78
|
-
it_should_accept "path ", ["--id=1","--path=path"]
|
79
|
-
it_should_accept "validator-type", ["--id=1","--validator-type=list"]
|
80
|
-
it_should_accept "validator-rule ", ["--id=1","--validator-rule=''"]
|
81
|
-
it_should_accept "override-value-order", ["--id=1","--override-value-order=fqdn"]
|
82
|
-
it_should_accept "parameter-type ", ["--id=1","--parameter-type=string"]
|
83
|
-
it_should_accept "required", ["--id=1","--required=true"]
|
84
|
-
|
85
|
-
# it_should_fail_with "no params", []
|
86
|
-
# TODO: temporarily disabled, parameters are checked in the id resolver
|
87
|
-
end
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
context "AddMatcherCommand" do
|
92
|
-
|
93
|
-
let(:cmd) { HammerCLIForeman::SmartClassParameter::AddMatcherCommand.new("", ctx) }
|
94
|
-
|
95
|
-
context "parameters" do
|
96
|
-
it_should_accept "smart-class-parametr-id, match, value", ["--smart-class-parameter-id=1", "--match='domain=my.lan'", "--value=1"]
|
97
|
-
it_should_accept "smart-class-parameter, puppet-class, match, value", ["--smart-class-parameter=par", "--puppet-class=ntp", "--match='domain=my.lan'", "--value=1"]
|
98
|
-
it_should_fail_with "smart-class-parameter, match, value", ["--smart-class-parameter=par", "--match='domain=my.lan'", "--value=1"]
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
context "RemoveMatcherCommand" do
|
103
|
-
|
104
|
-
let(:cmd) { HammerCLIForeman::SmartClassParameter::RemoveMatcherCommand.new("", ctx) }
|
105
|
-
|
106
|
-
context "parameters" do
|
107
|
-
it_should_accept "smart-class-parametr-id, id", ["--smart-class-parameter-id=1", "--id=1"]
|
108
|
-
it_should_accept "smart-class-parameter, puppet-class, id", ["--smart-class-parameter=par", "--puppet-class=ntp", "--id=1"]
|
109
|
-
it_should_fail_with "smart-class-parameter, id", ["--smart-class-parameter=par", "--id=1"]
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
end
|