hammer_cli_foreman 3.7.0 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/host_create.md +0 -6
- data/doc/release_notes.md +15 -0
- data/lib/hammer_cli_foreman/command_extensions/ping.rb +14 -0
- data/lib/hammer_cli_foreman/compute_resource/register_compute_resources.rb +0 -1
- data/lib/hammer_cli_foreman/ping.rb +6 -0
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/cs_CZ/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/ka/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/associating_commands_test.rb +2 -2
- data/test/functional/commands/list_test.rb +4 -4
- data/test/functional/ping_test.rb +25 -0
- data/test/functional/report_template_test.rb +4 -4
- data/test/functional/virtual_machine_test.rb +4 -4
- data/test/test_helper.rb +0 -1
- data/test/unit/api/interactive_basic_auth_test.rb +2 -2
- data/test/unit/api/oauth/oauth_authentication_code_grant_test.rb +2 -2
- data/test/unit/api/oauth/oauth_password_grant_test.rb +2 -2
- data/test/unit/api/session_authenticator_wrapper_test.rb +6 -6
- data/test/unit/architecture_test.rb +12 -12
- data/test/unit/audit_test.rb +6 -6
- data/test/unit/auth_source_external.rb +5 -5
- data/test/unit/auth_source_ldap_test.rb +12 -12
- data/test/unit/bookmark_test.rb +12 -12
- data/test/unit/commands_test.rb +5 -5
- data/test/unit/common_parameter_test.rb +10 -10
- data/test/unit/compute_profile_test.rb +12 -12
- data/test/unit/compute_resource_test.rb +18 -18
- data/test/unit/config_report_test.rb +7 -7
- data/test/unit/domain_test.rb +16 -16
- data/test/unit/exception_handler_test.rb +1 -1
- data/test/unit/external_usergroup_test.rb +15 -15
- data/test/unit/fact_test.rb +3 -3
- data/test/unit/filter_test.rb +18 -18
- data/test/unit/helpers/command.rb +1 -1
- data/test/unit/helpers/resource_disabled.rb +1 -1
- data/test/unit/host_test.rb +35 -35
- data/test/unit/hostgroup_test.rb +18 -18
- data/test/unit/image_test.rb +15 -15
- data/test/unit/location_test.rb +12 -12
- data/test/unit/mail_notification_test.rb +6 -6
- data/test/unit/media_test.rb +12 -12
- data/test/unit/model_test.rb +12 -12
- data/test/unit/operating_system_test.rb +16 -16
- data/test/unit/option_builders_test.rb +2 -2
- data/test/unit/organization_test.rb +12 -12
- data/test/unit/output/formatters_test.rb +4 -4
- data/test/unit/param_filters_test.rb +2 -2
- data/test/unit/partition_table_test.rb +14 -14
- data/test/unit/realm_test.rb +12 -12
- data/test/unit/role_test.rb +14 -14
- data/test/unit/settings_test.rb +5 -5
- data/test/unit/smart_proxy_test.rb +14 -14
- data/test/unit/subnet_test.rb +12 -12
- data/test/unit/template_test.rb +16 -16
- data/test/unit/user_test.rb +12 -12
- data/test/unit/usergroup_test.rb +12 -12
- metadata +31 -30
- data/lib/hammer_cli_foreman/compute_resource/rackspace.rb +0 -25
@@ -125,7 +125,7 @@ describe HammerCLIForeman::ExceptionHandler do
|
|
125
125
|
_(err_code).must_equal HammerCLI::EX_SOFTWARE
|
126
126
|
end
|
127
127
|
|
128
|
-
|
128
|
+
describe "redirects" do
|
129
129
|
let(:response) { HammerCLIForeman.foreman_api.api.send(:create_fake_response, 301, '', 'GET', 'http://foreman.example.com/api/architectures') }
|
130
130
|
it "should detect http to https redirection error" do
|
131
131
|
response.headers[:location] = 'https://foreman.example.com/api/architectures'
|
@@ -7,19 +7,19 @@ require 'hammer_cli_foreman/usergroup'
|
|
7
7
|
describe HammerCLIForeman::ExternalUsergroup do
|
8
8
|
include CommandTestHelper
|
9
9
|
|
10
|
-
|
10
|
+
describe "ListCommand" do
|
11
11
|
let(:cmd) { HammerCLIForeman::ExternalUsergroup::ListCommand.new("", ctx) }
|
12
12
|
|
13
13
|
before :each do
|
14
14
|
ResourceMocks.mock_action_call(:external_usergroups, :index, [])
|
15
15
|
end
|
16
16
|
|
17
|
-
|
17
|
+
describe "parameters" do
|
18
18
|
it_should_accept "user group name", ["--user-group=cr"]
|
19
19
|
it_should_accept "user group id", ["--user-group-id=1"]
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
describe "output" do
|
23
23
|
let(:expected_record_count) { count_records(cmd.resource.call(:index, :usergroup_id => 1)) }
|
24
24
|
|
25
25
|
with_params ["--user-group-id=1"] do
|
@@ -31,19 +31,19 @@ describe HammerCLIForeman::ExternalUsergroup do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
describe "InfoCommand" do
|
35
35
|
let(:cmd) { HammerCLIForeman::ExternalUsergroup::InfoCommand.new("", ctx) }
|
36
36
|
|
37
37
|
before :each do
|
38
38
|
ResourceMocks.mock_action_call(:external_usergroups, :show, {})
|
39
39
|
end
|
40
40
|
|
41
|
-
|
41
|
+
describe "parameters" do
|
42
42
|
it_should_accept "user group name and external usergroup's id", ["--user-group=cr", "--id=1"]
|
43
43
|
it_should_accept "user group id and external usergroup's id", ["--user-group-id=1", "--id=1"]
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
describe "output" do
|
47
47
|
with_params ["--user-group-id=1", "--id=1"] do
|
48
48
|
it_should_print_column "Name"
|
49
49
|
it_should_print_column "Auth source"
|
@@ -51,19 +51,19 @@ describe HammerCLIForeman::ExternalUsergroup do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
|
54
|
+
describe "RefreshExternalUsergroupsCommand" do
|
55
55
|
let(:cmd) { HammerCLIForeman::ExternalUsergroup::RefreshExternalUsergroupsCommand.new("", ctx) }
|
56
56
|
|
57
57
|
before :each do
|
58
58
|
ResourceMocks.mock_action_call(:external_usergroups, :refresh, [])
|
59
59
|
end
|
60
60
|
|
61
|
-
|
61
|
+
describe "parameters" do
|
62
62
|
it_should_accept "user group name and external usergroup's id", ["--user-group=cr", "--id=1"]
|
63
63
|
it_should_accept "user group id and external usergroup's id", ["--user-group-id=1", "--id=1"]
|
64
64
|
end
|
65
65
|
|
66
|
-
|
66
|
+
describe "output" do
|
67
67
|
with_params ["--user-group-id=1", "--id=1"] do
|
68
68
|
it_should_print_column "Name"
|
69
69
|
it_should_print_column "Auth source"
|
@@ -71,30 +71,30 @@ describe HammerCLIForeman::ExternalUsergroup do
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
|
74
|
+
describe "CreateCommand" do
|
75
75
|
let(:cmd) { HammerCLIForeman::ExternalUsergroup::CreateCommand.new("", ctx) }
|
76
76
|
|
77
|
-
|
77
|
+
describe "parameters" do
|
78
78
|
# it_should_fail_with "no name", ["--auth-source-id=1", "--user-group-id=1"]
|
79
79
|
it_should_accept "all required params", ["--name=aabbcc123", "--auth-source-id=1", "--user-group-id=1"]
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
83
|
|
84
|
-
|
84
|
+
describe "DeleteCommand" do
|
85
85
|
let(:cmd) { HammerCLIForeman::ExternalUsergroup::DeleteCommand.new("", ctx) }
|
86
86
|
|
87
|
-
|
87
|
+
describe "parameters" do
|
88
88
|
it_should_accept "id and user group's id", ["--id=1", "--user-group-id=1"]
|
89
89
|
it_should_accept "id and user group's name", ["--id=1", "--user-group=ec2"]
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
93
|
|
94
|
-
|
94
|
+
describe "UpdateCommand" do
|
95
95
|
let(:cmd) { HammerCLIForeman::ExternalUsergroup::UpdateCommand.new("", ctx) }
|
96
96
|
|
97
|
-
|
97
|
+
describe "parameters" do
|
98
98
|
it_should_accept "id and user group's id", ["--id=1", "--user-group-id=1"]
|
99
99
|
it_should_accept "id and user group's name", ["--id=1", "--user-group=ec2"]
|
100
100
|
it_should_accept "all available params", ["--id=1", "--name=img", "--auth-source-id=1", "--user-group-id=1"]
|
data/test/unit/fact_test.rb
CHANGED
@@ -7,7 +7,7 @@ describe HammerCLIForeman::Fact do
|
|
7
7
|
|
8
8
|
include CommandTestHelper
|
9
9
|
|
10
|
-
|
10
|
+
describe "ListCommand" do
|
11
11
|
|
12
12
|
let(:cmd) { HammerCLIForeman::Fact::ListCommand.new("", ctx) }
|
13
13
|
|
@@ -15,12 +15,12 @@ describe HammerCLIForeman::Fact do
|
|
15
15
|
ResourceMocks.facts_index
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
describe "parameters" do
|
19
19
|
it_should_accept "no arguments"
|
20
20
|
it_should_accept_search_params
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
describe "output" do
|
24
24
|
it_should_print_column "Host"
|
25
25
|
it_should_print_column "Fact"
|
26
26
|
it_should_print_column "Value"
|
data/test/unit/filter_test.rb
CHANGED
@@ -8,7 +8,7 @@ describe HammerCLIForeman::Filter do
|
|
8
8
|
include CommandTestHelper
|
9
9
|
|
10
10
|
|
11
|
-
|
11
|
+
describe "ListCommand" do
|
12
12
|
|
13
13
|
let(:cmd) { HammerCLIForeman::Filter::ListCommand.new("", ctx) }
|
14
14
|
|
@@ -16,12 +16,12 @@ describe HammerCLIForeman::Filter do
|
|
16
16
|
ResourceMocks.mock_action_call(:filters, :index, [])
|
17
17
|
end
|
18
18
|
|
19
|
-
|
19
|
+
describe "parameters" do
|
20
20
|
it_should_accept "no arguments"
|
21
21
|
it_should_accept_search_params
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
describe "output" do
|
25
25
|
it_should_print_column "Id"
|
26
26
|
it_should_print_column "Resource type"
|
27
27
|
it_should_print_column "Search"
|
@@ -31,7 +31,7 @@ describe HammerCLIForeman::Filter do
|
|
31
31
|
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
describe "InfoCommand" do
|
35
35
|
|
36
36
|
let(:cmd) { HammerCLIForeman::Filter::InfoCommand.new("", ctx) }
|
37
37
|
|
@@ -39,11 +39,11 @@ describe HammerCLIForeman::Filter do
|
|
39
39
|
ResourceMocks.mock_action_call(:filters, :show, {})
|
40
40
|
end
|
41
41
|
|
42
|
-
|
42
|
+
describe "parameters" do
|
43
43
|
it_should_accept "id", ["--id=1"]
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
describe "output" do
|
47
47
|
with_params ["--id=1"] do
|
48
48
|
it_should_print_n_records 1
|
49
49
|
it_should_print_column "Id"
|
@@ -57,7 +57,7 @@ describe HammerCLIForeman::Filter do
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
|
60
|
+
describe "CreateCommand" do
|
61
61
|
let(:cmd) { HammerCLIForeman::Filter::CreateCommand.new("", ctx) }
|
62
62
|
|
63
63
|
before do
|
@@ -65,7 +65,7 @@ describe HammerCLIForeman::Filter do
|
|
65
65
|
cmd.stubs(:option_override).returns(false)
|
66
66
|
end
|
67
67
|
|
68
|
-
|
68
|
+
describe "parameters" do
|
69
69
|
it_should_accept "role id and permission ids", ["--role-id=1", "--permission-ids=1,2"]
|
70
70
|
it_should_accept "role name and permission ids", ["--role=role", "--permission-ids=1,2"]
|
71
71
|
it_should_accept "role name, permission ids, search", ["--role=role", "--permission-ids=1,2", "--search='name=*'"]
|
@@ -73,16 +73,16 @@ describe HammerCLIForeman::Filter do
|
|
73
73
|
|
74
74
|
end
|
75
75
|
|
76
|
-
|
76
|
+
describe "DeleteCommand" do
|
77
77
|
|
78
78
|
let(:cmd) { HammerCLIForeman::Filter::DeleteCommand.new("", ctx) }
|
79
79
|
|
80
|
-
|
80
|
+
describe "parameters" do
|
81
81
|
it_should_accept "id", ["--id=1"]
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
|
85
|
+
describe "UpdateCommand" do
|
86
86
|
let(:cmd) { HammerCLIForeman::Filter::UpdateCommand.new("", ctx) }
|
87
87
|
|
88
88
|
before do
|
@@ -90,7 +90,7 @@ describe HammerCLIForeman::Filter do
|
|
90
90
|
cmd.stubs(:option_override).returns(false)
|
91
91
|
end
|
92
92
|
|
93
|
-
|
93
|
+
describe "parameters" do
|
94
94
|
it_should_accept "id, role id and permission ids", ["--id=1", "--role-id=1", "--permission-ids=1,2"]
|
95
95
|
it_should_accept "id, role name and permission ids", ["--id=1", "--role=role", "--permission-ids=1,2"]
|
96
96
|
it_should_accept "id, role name, permission ids, search", ["--id=1", "--role=role", "--permission-ids=1,2", "--search='name=*'"]
|
@@ -99,7 +99,7 @@ describe HammerCLIForeman::Filter do
|
|
99
99
|
end
|
100
100
|
|
101
101
|
|
102
|
-
|
102
|
+
describe "AvailablePermissionsCommand" do
|
103
103
|
|
104
104
|
let(:cmd) { HammerCLIForeman::Filter::AvailablePermissionsCommand.new("", ctx) }
|
105
105
|
|
@@ -107,12 +107,12 @@ describe HammerCLIForeman::Filter do
|
|
107
107
|
ResourceMocks.mock_action_call(:permissions, :index, [])
|
108
108
|
end
|
109
109
|
|
110
|
-
|
110
|
+
describe "parameters" do
|
111
111
|
it_should_accept "no arguments"
|
112
112
|
it_should_accept "pagination options", ["--page=2", "--per-page=10"]
|
113
113
|
end
|
114
114
|
|
115
|
-
|
115
|
+
describe "output" do
|
116
116
|
it_should_print_column "Id"
|
117
117
|
it_should_print_column "Name"
|
118
118
|
it_should_print_column "Resource"
|
@@ -120,7 +120,7 @@ describe HammerCLIForeman::Filter do
|
|
120
120
|
|
121
121
|
end
|
122
122
|
|
123
|
-
|
123
|
+
describe "AvailableResourcesCommand" do
|
124
124
|
|
125
125
|
let(:cmd) { HammerCLIForeman::Filter::AvailableResourcesCommand.new("", ctx) }
|
126
126
|
|
@@ -128,11 +128,11 @@ describe HammerCLIForeman::Filter do
|
|
128
128
|
ResourceMocks.mock_action_call(:permissions, :resource_types, [])
|
129
129
|
end
|
130
130
|
|
131
|
-
|
131
|
+
describe "parameters" do
|
132
132
|
it_should_accept "no arguments"
|
133
133
|
end
|
134
134
|
|
135
|
-
|
135
|
+
describe "output" do
|
136
136
|
it_should_print_column "Name"
|
137
137
|
end
|
138
138
|
|
@@ -4,7 +4,7 @@ module ResourceDisabled
|
|
4
4
|
|
5
5
|
def it_should_fail_when_disabled
|
6
6
|
arguments = @with_params ? @with_params.dup : []
|
7
|
-
|
7
|
+
describe "resource disabled" do
|
8
8
|
|
9
9
|
it "should return error" do
|
10
10
|
cmd.class.resource.stubs(:call).raises(RestClient::ResourceNotFound)
|
data/test/unit/host_test.rb
CHANGED
@@ -7,19 +7,19 @@ describe HammerCLIForeman::Host do
|
|
7
7
|
|
8
8
|
include CommandTestHelper
|
9
9
|
|
10
|
-
|
10
|
+
describe "ListCommand" do
|
11
11
|
before do
|
12
12
|
ResourceMocks.mock_action_call(:hosts, :index, [])
|
13
13
|
end
|
14
14
|
|
15
15
|
let(:cmd) { HammerCLIForeman::Host::ListCommand.new("", ctx) }
|
16
16
|
|
17
|
-
|
17
|
+
describe "parameters" do
|
18
18
|
it_should_accept "no arguments"
|
19
19
|
it_should_accept_search_params
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
describe "output" do
|
23
23
|
let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
|
24
24
|
|
25
25
|
it_should_print_n_records
|
@@ -28,20 +28,20 @@ describe HammerCLIForeman::Host do
|
|
28
28
|
|
29
29
|
end
|
30
30
|
|
31
|
-
|
31
|
+
describe "InfoCommand" do
|
32
32
|
before do
|
33
33
|
ResourceMocks.hosts_show
|
34
34
|
end
|
35
35
|
|
36
36
|
let(:cmd) { HammerCLIForeman::Host::InfoCommand.new("", ctx) }
|
37
37
|
|
38
|
-
|
38
|
+
describe "parameters" do
|
39
39
|
it_should_accept "id", ["--id=1"]
|
40
40
|
it_should_accept "name", ["--name=host"]
|
41
41
|
# it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
|
42
42
|
end
|
43
43
|
|
44
|
-
|
44
|
+
describe "output" do
|
45
45
|
with_params ["--id=1"] do
|
46
46
|
it_should_print_n_records 1
|
47
47
|
it_should_print_columns ["Id", "Name", "Organization", "Location"]
|
@@ -53,7 +53,7 @@ describe HammerCLIForeman::Host do
|
|
53
53
|
|
54
54
|
end
|
55
55
|
|
56
|
-
|
56
|
+
describe "StatusCommand" do
|
57
57
|
|
58
58
|
let(:cmd) { HammerCLIForeman::Host::StatusCommand.new("", ctx) }
|
59
59
|
|
@@ -62,14 +62,14 @@ describe HammerCLIForeman::Host do
|
|
62
62
|
ResourceMocks.mock_action_call(:hosts, :get_status, { 'status_label' => 'No reports' } )
|
63
63
|
end
|
64
64
|
|
65
|
-
|
65
|
+
describe "parameters" do
|
66
66
|
it_should_accept "name", ["--name=host"]
|
67
67
|
it_should_accept "id", ["--id=1"]
|
68
68
|
# it_should_fail_with "no arguments"
|
69
69
|
# TODO: temporarily disabled, parameters are checked in the id resolver
|
70
70
|
end
|
71
71
|
|
72
|
-
|
72
|
+
describe "output" do
|
73
73
|
with_params ["--id=1"] do
|
74
74
|
it_should_print_columns ["Status", "Power"]
|
75
75
|
|
@@ -82,7 +82,7 @@ describe HammerCLIForeman::Host do
|
|
82
82
|
|
83
83
|
end
|
84
84
|
|
85
|
-
|
85
|
+
describe "FactsCommand" do
|
86
86
|
|
87
87
|
let(:cmd) { HammerCLIForeman::Host::FactsCommand.new("", ctx) }
|
88
88
|
|
@@ -90,14 +90,14 @@ describe HammerCLIForeman::Host do
|
|
90
90
|
ResourceMocks.facts_index
|
91
91
|
end
|
92
92
|
|
93
|
-
|
93
|
+
describe "parameters" do
|
94
94
|
it_should_accept "name", ["--name=host"]
|
95
95
|
it_should_accept "id", ["--id=1"]
|
96
96
|
# it_should_fail_with "no arguments"
|
97
97
|
# TODO: temporarily disabled, parameters are checked in the id resolver
|
98
98
|
end
|
99
99
|
|
100
|
-
|
100
|
+
describe "output" do
|
101
101
|
with_params ["--name=my5name.mydomain.net"] do
|
102
102
|
it_should_print_column "Fact"
|
103
103
|
it_should_print_column "Value"
|
@@ -105,19 +105,19 @@ describe HammerCLIForeman::Host do
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
-
|
108
|
+
describe "ConfigReportsCommand" do
|
109
109
|
before do
|
110
110
|
ResourceMocks.mock_action_call(:config_reports, :index, [])
|
111
111
|
end
|
112
112
|
|
113
113
|
let(:cmd) { HammerCLIForeman::Host::ConfigReportsCommand.new("", ctx) }
|
114
114
|
|
115
|
-
|
115
|
+
describe "parameters" do
|
116
116
|
it_should_accept "id", ["--id=1"]
|
117
117
|
it_should_accept "name", ["--name=my.test.host.org"]
|
118
118
|
end
|
119
119
|
|
120
|
-
|
120
|
+
describe "output" do
|
121
121
|
with_params ["--id=1"] do
|
122
122
|
let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
|
123
123
|
|
@@ -136,11 +136,11 @@ describe HammerCLIForeman::Host do
|
|
136
136
|
|
137
137
|
end
|
138
138
|
|
139
|
-
|
139
|
+
describe "DeleteCommand" do
|
140
140
|
|
141
141
|
let(:cmd) { HammerCLIForeman::Host::DeleteCommand.new("", ctx) }
|
142
142
|
|
143
|
-
|
143
|
+
describe "parameters" do
|
144
144
|
it_should_accept "name", ["--name=host"]
|
145
145
|
it_should_accept "id", ["--id=1"]
|
146
146
|
# it_should_fail_with "name or id missing", []
|
@@ -149,7 +149,7 @@ describe HammerCLIForeman::Host do
|
|
149
149
|
|
150
150
|
end
|
151
151
|
|
152
|
-
|
152
|
+
describe "CreateCommand" do
|
153
153
|
|
154
154
|
let(:cmd) { HammerCLIForeman::Host::CreateCommand.new("", ctx) }
|
155
155
|
|
@@ -157,7 +157,7 @@ describe HammerCLIForeman::Host do
|
|
157
157
|
HammerCLIForeman::Hosts::CommonUpdateOptions.stubs(:ask_password).returns("password")
|
158
158
|
end
|
159
159
|
|
160
|
-
|
160
|
+
describe "parameters" do
|
161
161
|
taxonomies = ["--organization-id=1", "--location-id=1"]
|
162
162
|
it_should_accept "name, architecture_id, domain_id, operatingsystem_id and more",
|
163
163
|
["--name=host", "--architecture-id=1", "--domain-id=1", "--operatingsystem-id=1",
|
@@ -199,7 +199,7 @@ describe HammerCLIForeman::Host do
|
|
199
199
|
end
|
200
200
|
end
|
201
201
|
|
202
|
-
|
202
|
+
describe "UpdateCommand" do
|
203
203
|
|
204
204
|
let(:cmd) { HammerCLIForeman::Host::UpdateCommand.new("", ctx) }
|
205
205
|
|
@@ -207,7 +207,7 @@ describe HammerCLIForeman::Host do
|
|
207
207
|
HammerCLIForeman::Hosts::CommonUpdateOptions.stubs(:ask_password).returns("password")
|
208
208
|
end
|
209
209
|
|
210
|
-
|
210
|
+
describe "parameters" do
|
211
211
|
it_should_accept "name", ["--name=host", "--new-name=host2"]
|
212
212
|
it_should_accept "id and more", ["--id=1", "--new-name=host2", "--architecture-id=1",
|
213
213
|
"--domain-id=1", "--operatingsystem-id=1",
|
@@ -253,7 +253,7 @@ describe HammerCLIForeman::Host do
|
|
253
253
|
end
|
254
254
|
|
255
255
|
|
256
|
-
|
256
|
+
describe "SetParameterCommand" do
|
257
257
|
|
258
258
|
before :each do
|
259
259
|
ResourceMocks.parameters_index
|
@@ -261,7 +261,7 @@ describe HammerCLIForeman::Host do
|
|
261
261
|
|
262
262
|
let(:cmd) { HammerCLIForeman::Host::SetParameterCommand.new("", ctx) }
|
263
263
|
|
264
|
-
|
264
|
+
describe "parameters" do
|
265
265
|
it_should_accept "name, value and host name", ["--name=name", "--value=val", "--host=name"]
|
266
266
|
it_should_accept "name, value and host id", ["--name=name", "--value=val", "--host-id=1"]
|
267
267
|
it_should_accept "name, value, type and host id", ["--name=name", "--parameter-type=integer", "--value=1", "--host-id=1"]
|
@@ -274,11 +274,11 @@ describe HammerCLIForeman::Host do
|
|
274
274
|
end
|
275
275
|
|
276
276
|
|
277
|
-
|
277
|
+
describe "DeleteParameterCommand" do
|
278
278
|
|
279
279
|
let(:cmd) { HammerCLIForeman::Host::DeleteParameterCommand.new("", ctx) }
|
280
280
|
|
281
|
-
|
281
|
+
describe "parameters" do
|
282
282
|
it_should_accept "name and host name", ["--name=name", "--host=name"]
|
283
283
|
it_should_accept "name and host id", ["--name=name", "--host-id=1"]
|
284
284
|
# it_should_fail_with "name missing", ["--host=name"]
|
@@ -288,9 +288,9 @@ describe HammerCLIForeman::Host do
|
|
288
288
|
|
289
289
|
end
|
290
290
|
|
291
|
-
|
291
|
+
describe "StartCommand" do
|
292
292
|
let(:cmd) { HammerCLIForeman::Host::StartCommand.new("", ctx) }
|
293
|
-
|
293
|
+
describe "parameters" do
|
294
294
|
it_should_accept "name", ["--name=host"]
|
295
295
|
it_should_accept "id", ["--id=1"]
|
296
296
|
# it_should_fail_with "empty params", []
|
@@ -298,9 +298,9 @@ describe HammerCLIForeman::Host do
|
|
298
298
|
end
|
299
299
|
end
|
300
300
|
|
301
|
-
|
301
|
+
describe "StopCommand" do
|
302
302
|
let(:cmd) { HammerCLIForeman::Host::StopCommand.new("", ctx) }
|
303
|
-
|
303
|
+
describe "parameters" do
|
304
304
|
it_should_accept "name", ["--name=host"]
|
305
305
|
it_should_accept "id", ["--id=1"]
|
306
306
|
it_should_accept "id and force", ["--id=1", "--force"]
|
@@ -309,9 +309,9 @@ describe HammerCLIForeman::Host do
|
|
309
309
|
end
|
310
310
|
end
|
311
311
|
|
312
|
-
|
312
|
+
describe "RebootCommand" do
|
313
313
|
let(:cmd) { HammerCLIForeman::Host::RebootCommand.new("", ctx) }
|
314
|
-
|
314
|
+
describe "parameters" do
|
315
315
|
it_should_accept "name", ["--name=host"]
|
316
316
|
it_should_accept "id", ["--id=1"]
|
317
317
|
# it_should_fail_with "empty params", []
|
@@ -319,11 +319,11 @@ describe HammerCLIForeman::Host do
|
|
319
319
|
end
|
320
320
|
end
|
321
321
|
|
322
|
-
|
322
|
+
describe "RebuildConfigCommand" do
|
323
323
|
|
324
324
|
let(:cmd) { HammerCLIForeman::Host::RebuildConfigCommand.new("", ctx) }
|
325
325
|
|
326
|
-
|
326
|
+
describe "parameters" do
|
327
327
|
it_should_accept "name", ["--name=host"]
|
328
328
|
it_should_accept "id", ["--id=1"]
|
329
329
|
# it_should_fail_with "no arguments"
|
@@ -333,9 +333,9 @@ describe HammerCLIForeman::Host do
|
|
333
333
|
end
|
334
334
|
|
335
335
|
|
336
|
-
|
336
|
+
describe "DisassociateCommand" do
|
337
337
|
let(:cmd) { HammerCLIForeman::Host::DisassociateCommand.new("", ctx) }
|
338
|
-
|
338
|
+
describe "parameters" do
|
339
339
|
it_should_accept "name", ["--name=host"]
|
340
340
|
it_should_accept "id", ["--id=1"]
|
341
341
|
end
|