hammer_cli_foreman 2.3.2 → 2.4.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 +6 -3
- data/lib/hammer_cli_foreman/architecture.rb +5 -5
- data/lib/hammer_cli_foreman/bookmark.rb +6 -6
- data/lib/hammer_cli_foreman/command_extensions/status.rb +1 -1
- data/lib/hammer_cli_foreman/compute_profile.rb +5 -5
- data/lib/hammer_cli_foreman/config_group.rb +5 -5
- data/lib/hammer_cli_foreman/hosts/common_update_options.rb +1 -1
- 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 -9
- data/lib/hammer_cli_foreman/option_builders.rb +2 -21
- data/lib/hammer_cli_foreman/settings.rb +3 -3
- data/lib/hammer_cli_foreman/usergroup.rb +5 -5
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/test/functional/architecture_test.rb +49 -0
- data/test/functional/bookmark_test.rb +20 -0
- data/test/functional/compute_profile_test.rb +43 -0
- data/test/functional/config_group_test.rb +50 -0
- data/test/functional/filter_test.rb +114 -47
- data/test/functional/host_test.rb +63 -2
- data/test/functional/mail_notification_test.rb +20 -0
- data/test/functional/model_test.rb +50 -0
- data/test/functional/operating_system_test.rb +51 -0
- data/test/functional/settings_test.rb +21 -0
- data/test/functional/status_test.rb +79 -13
- data/test/functional/usergroup_test.rb +51 -0
- data/test/reports/TEST-Minitest-Result.xml +4344 -0
- data/test/unit/apipie_resource_mock.rb +21 -0
- data/test/unit/architecture_test.rb +10 -1
- data/test/unit/bookmark_test.rb +99 -0
- data/test/unit/compute_profile_test.rb +87 -0
- data/test/unit/config_group_test.rb +10 -0
- data/test/unit/mail_notification_test.rb +53 -0
- data/test/unit/model_test.rb +10 -0
- data/test/unit/operating_system_test.rb +14 -1
- data/test/unit/settings_test.rb +4 -0
- data/test/unit/usergroup_test.rb +10 -0
- metadata +119 -101
@@ -237,6 +237,27 @@ module ResourceMocks
|
|
237
237
|
)
|
238
238
|
end
|
239
239
|
|
240
|
+
def self.bookmarks
|
241
|
+
ResourceMocks.mock_action_calls(
|
242
|
+
[:bookmarks, :index, []],
|
243
|
+
[:bookmarks, :show, {}]
|
244
|
+
)
|
245
|
+
end
|
246
|
+
|
247
|
+
def self.mail_notifications
|
248
|
+
ResourceMocks.mock_action_calls(
|
249
|
+
[:mail_notifications, :index, []],
|
250
|
+
[:mail_notifications, :show, {}]
|
251
|
+
)
|
252
|
+
end
|
253
|
+
|
254
|
+
def self.compute_profiles
|
255
|
+
ResourceMocks.mock_action_calls(
|
256
|
+
[:compute_profiles, :index, []],
|
257
|
+
[:compute_profiles, :show, {}]
|
258
|
+
)
|
259
|
+
end
|
260
|
+
|
240
261
|
def self.parameters_index
|
241
262
|
ResourceMocks.mock_action_call(:parameters, :index, [])
|
242
263
|
end
|
@@ -17,6 +17,8 @@ describe HammerCLIForeman::Architecture do
|
|
17
17
|
context "parameters" do
|
18
18
|
it_should_accept "no arguments"
|
19
19
|
it_should_accept_search_params
|
20
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
21
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
20
22
|
end
|
21
23
|
|
22
24
|
context "output" do
|
@@ -37,6 +39,8 @@ describe HammerCLIForeman::Architecture do
|
|
37
39
|
context "parameters" do
|
38
40
|
it_should_accept "id", ["--id=1"]
|
39
41
|
it_should_accept "name", ["--name=arch"]
|
42
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
43
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
40
44
|
# it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
|
41
45
|
end
|
42
46
|
|
@@ -57,6 +61,8 @@ describe HammerCLIForeman::Architecture do
|
|
57
61
|
|
58
62
|
context "parameters" do
|
59
63
|
it_should_accept "name", ["--name=arch"]
|
64
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
65
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
60
66
|
# it_should_fail_with "name missing", []
|
61
67
|
# TODO: temporarily disabled, parameters are checked in the api
|
62
68
|
end
|
@@ -71,6 +77,8 @@ describe HammerCLIForeman::Architecture do
|
|
71
77
|
context "parameters" do
|
72
78
|
it_should_accept "name", ["--name=arch"]
|
73
79
|
it_should_accept "id", ["--id=1"]
|
80
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
81
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
74
82
|
# it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
|
75
83
|
end
|
76
84
|
|
@@ -84,9 +92,10 @@ describe HammerCLIForeman::Architecture do
|
|
84
92
|
context "parameters" do
|
85
93
|
it_should_accept "name", ["--name=arch", "--new-name=arch2"]
|
86
94
|
it_should_accept "id", ["--id=1", "--new-name=arch2"]
|
95
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
96
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
87
97
|
# it_should_fail_with "no params", [] # TODO: temporarily disabled, parameters are checked in the id resolver
|
88
98
|
# it_should_fail_with "name or id missing", ["--new-name=arch2"] # TODO: temporarily disabled, parameters are checked in the id resolver
|
89
99
|
end
|
90
|
-
|
91
100
|
end
|
92
101
|
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
4
|
+
require File.join(File.dirname(__FILE__), 'apipie_resource_mock')
|
5
|
+
|
6
|
+
require 'hammer_cli_foreman/bookmark'
|
7
|
+
|
8
|
+
describe HammerCLIForeman::Bookmark do
|
9
|
+
include CommandTestHelper
|
10
|
+
|
11
|
+
context 'ListCommand' do
|
12
|
+
before :each do
|
13
|
+
ResourceMocks.bookmarks
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:cmd) { HammerCLIForeman::Bookmark::ListCommand.new('', ctx) }
|
17
|
+
|
18
|
+
context 'parameters' do
|
19
|
+
it_should_accept 'no arguments'
|
20
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
21
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'output' do
|
25
|
+
let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
|
26
|
+
|
27
|
+
it_should_print_n_records
|
28
|
+
it_should_print_column 'Id'
|
29
|
+
it_should_print_column 'Name'
|
30
|
+
it_should_print_column 'Controller'
|
31
|
+
it_should_print_column 'Search Query'
|
32
|
+
it_should_print_column 'Public'
|
33
|
+
it_should_print_column 'Owner Id'
|
34
|
+
it_should_print_column 'Owner Type'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'InfoCommand' do
|
39
|
+
let(:cmd) { HammerCLIForeman::Bookmark::InfoCommand.new('', ctx) }
|
40
|
+
|
41
|
+
context 'parameters' do
|
42
|
+
it_should_accept 'id', ['--id=1']
|
43
|
+
it_should_accept 'name', ['--name=active']
|
44
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
45
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
46
|
+
end
|
47
|
+
|
48
|
+
context 'output' do
|
49
|
+
with_params ['--id=1'] do
|
50
|
+
it_should_print_n_records 1
|
51
|
+
it_should_print_column 'Id'
|
52
|
+
it_should_print_column 'Name'
|
53
|
+
it_should_print_column 'Controller'
|
54
|
+
it_should_print_column 'Search Query'
|
55
|
+
it_should_print_column 'Public'
|
56
|
+
it_should_print_column 'Owner Id'
|
57
|
+
it_should_print_column 'Owner Type'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
context 'CreateCommand' do
|
63
|
+
let(:cmd) { HammerCLIForeman::Bookmark::CreateCommand.new('', ctx) }
|
64
|
+
|
65
|
+
context 'parameters' do
|
66
|
+
it_should_accept 'name, public, controller, query',
|
67
|
+
['--name=active', '--public=1', '--controller=hosts',
|
68
|
+
'--query=last_report > "35 minutes ago" and (status.applied > 0 or status.restarted > 0)']
|
69
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
70
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
context 'DeleteCommand' do
|
76
|
+
let(:cmd) { HammerCLIForeman::Bookmark::DeleteCommand.new('', ctx) }
|
77
|
+
|
78
|
+
context 'parameters' do
|
79
|
+
it_should_accept 'id', ['--id=1']
|
80
|
+
it_should_accept 'name', ['--name=active']
|
81
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
82
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
context 'UpdateCommand' do
|
87
|
+
let(:cmd) { HammerCLIForeman::Bookmark::UpdateCommand.new('', ctx) }
|
88
|
+
|
89
|
+
context 'parameters' do
|
90
|
+
it_should_accept 'id', ['--id=1']
|
91
|
+
it_should_accept 'name', ['--name=active']
|
92
|
+
it_should_accept 'name, public, controller, query',
|
93
|
+
['--name=active', '--public=1', '--controller=hosts',
|
94
|
+
'--query=last_report > "35 minutes ago" and (status.applied > 0 or status.restarted > 0)']
|
95
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
96
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
4
|
+
require File.join(File.dirname(__FILE__), 'apipie_resource_mock')
|
5
|
+
|
6
|
+
require 'hammer_cli_foreman/compute_profile'
|
7
|
+
|
8
|
+
describe HammerCLIForeman::ComputeProfile do
|
9
|
+
include CommandTestHelper
|
10
|
+
|
11
|
+
context 'ListCommand' do
|
12
|
+
before :each do
|
13
|
+
ResourceMocks.compute_profiles
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:cmd) { HammerCLIForeman::ComputeProfile::ListCommand.new('', ctx) }
|
17
|
+
|
18
|
+
context 'parameters' do
|
19
|
+
it_should_accept 'no arguments'
|
20
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
21
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'output' do
|
25
|
+
let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
|
26
|
+
|
27
|
+
it_should_print_n_records
|
28
|
+
it_should_print_column 'Id'
|
29
|
+
it_should_print_column 'Name'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'InfoCommand' do
|
34
|
+
let(:cmd) { HammerCLIForeman::ComputeProfile::InfoCommand.new('', ctx) }
|
35
|
+
|
36
|
+
context 'parameters' do
|
37
|
+
it_should_accept 'id', ['--id=1']
|
38
|
+
it_should_accept 'name', ['--name=test']
|
39
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
40
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'output' do
|
44
|
+
with_params ['--id=1'] do
|
45
|
+
it_should_print_n_records 1
|
46
|
+
it_should_print_column 'Id'
|
47
|
+
it_should_print_column 'Name'
|
48
|
+
it_should_print_column 'Created at'
|
49
|
+
it_should_print_column 'Updated at'
|
50
|
+
it_should_print_column 'Compute attributes'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
context 'CreateCommand' do
|
56
|
+
let(:cmd) { HammerCLIForeman::ComputeProfile::CreateCommand.new('', ctx) }
|
57
|
+
|
58
|
+
context 'parameters' do
|
59
|
+
it_should_accept 'name', ['--name=test']
|
60
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
61
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
context 'DeleteCommand' do
|
67
|
+
let(:cmd) { HammerCLIForeman::ComputeProfile::DeleteCommand.new('', ctx) }
|
68
|
+
|
69
|
+
context 'parameters' do
|
70
|
+
it_should_accept 'id', ['--id=1']
|
71
|
+
it_should_accept 'name', ['--name=test']
|
72
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
73
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context 'UpdateCommand' do
|
78
|
+
let(:cmd) { HammerCLIForeman::ComputeProfile::UpdateCommand.new('', ctx) }
|
79
|
+
|
80
|
+
context 'parameters' do
|
81
|
+
it_should_accept 'id', ['--id=1']
|
82
|
+
it_should_accept 'name', ['--name=test']
|
83
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
84
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -16,6 +16,8 @@ describe HammerCLIForeman::ConfigGroup do
|
|
16
16
|
context "parameters" do
|
17
17
|
it_should_accept "no arguments"
|
18
18
|
it_should_accept_search_params
|
19
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
20
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
19
21
|
end
|
20
22
|
|
21
23
|
context "output" do
|
@@ -31,6 +33,8 @@ describe HammerCLIForeman::ConfigGroup do
|
|
31
33
|
context "parameters" do
|
32
34
|
it_should_accept "id", ["--id=1"]
|
33
35
|
it_should_accept "name", ["--name=group_x"]
|
36
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
37
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
34
38
|
end
|
35
39
|
|
36
40
|
context "output" do
|
@@ -48,6 +52,8 @@ describe HammerCLIForeman::ConfigGroup do
|
|
48
52
|
|
49
53
|
context "parameters" do
|
50
54
|
it_should_accept "name, puppetclass ids", ["--name=first_group", "--puppet-class-ids=1,2"]
|
55
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
56
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
51
57
|
end
|
52
58
|
end
|
53
59
|
|
@@ -57,6 +63,8 @@ describe HammerCLIForeman::ConfigGroup do
|
|
57
63
|
context "parameters" do
|
58
64
|
it_should_accept "name", ["--name=group_x"]
|
59
65
|
it_should_accept "id", ["--id=1"]
|
66
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
67
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
60
68
|
end
|
61
69
|
end
|
62
70
|
|
@@ -67,6 +75,8 @@ describe HammerCLIForeman::ConfigGroup do
|
|
67
75
|
context "parameters" do
|
68
76
|
it_should_accept "name", ["--name=group_x"]
|
69
77
|
it_should_accept "id", ["--id=1"]
|
78
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
79
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
70
80
|
end
|
71
81
|
end
|
72
82
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
4
|
+
require File.join(File.dirname(__FILE__), 'apipie_resource_mock')
|
5
|
+
|
6
|
+
require 'hammer_cli_foreman/mail_notification'
|
7
|
+
|
8
|
+
describe HammerCLIForeman::MailNotification do
|
9
|
+
include CommandTestHelper
|
10
|
+
|
11
|
+
context 'ListCommand' do
|
12
|
+
before :each do
|
13
|
+
ResourceMocks.mail_notifications
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:cmd) { HammerCLIForeman::MailNotification::ListCommand.new('', ctx) }
|
17
|
+
|
18
|
+
context 'parameters' do
|
19
|
+
it_should_accept 'no arguments'
|
20
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
21
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'output' do
|
25
|
+
let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
|
26
|
+
|
27
|
+
it_should_print_n_records
|
28
|
+
it_should_print_column 'Id'
|
29
|
+
it_should_print_column 'Name'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'InfoCommand' do
|
34
|
+
let(:cmd) { HammerCLIForeman::MailNotification::InfoCommand.new('', ctx) }
|
35
|
+
|
36
|
+
context 'parameters' do
|
37
|
+
it_should_accept 'id', ['--id=1']
|
38
|
+
it_should_accept 'name', ['--name=test']
|
39
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
40
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'output' do
|
44
|
+
with_params ['--id=1'] do
|
45
|
+
it_should_print_n_records 1
|
46
|
+
it_should_print_column 'Id'
|
47
|
+
it_should_print_column 'Name'
|
48
|
+
it_should_print_column 'Description'
|
49
|
+
it_should_print_column 'Subscription type'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/test/unit/model_test.rb
CHANGED
@@ -17,6 +17,8 @@ describe HammerCLIForeman::Model do
|
|
17
17
|
context "parameters" do
|
18
18
|
it_should_accept "no arguments"
|
19
19
|
it_should_accept_search_params
|
20
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
21
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
20
22
|
end
|
21
23
|
|
22
24
|
context "output" do
|
@@ -38,6 +40,8 @@ describe HammerCLIForeman::Model do
|
|
38
40
|
context "parameters" do
|
39
41
|
it_should_accept "id", ["--id=1"]
|
40
42
|
it_should_accept "name", ["--name=model"]
|
43
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
44
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
41
45
|
# it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
|
42
46
|
end
|
43
47
|
|
@@ -63,6 +67,8 @@ describe HammerCLIForeman::Model do
|
|
63
67
|
|
64
68
|
context "parameters" do
|
65
69
|
it_should_accept "name", ["--name=model", "--info=description", "--vendor-class=class", "--hardware-model=model"]
|
70
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
71
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
66
72
|
# it_should_fail_with "name missing", ["--info=description", "--vendor-class=class", "--hardware-model=model"]
|
67
73
|
# TODO: temporarily disabled, parameters are checked in the api
|
68
74
|
end
|
@@ -77,6 +83,8 @@ describe HammerCLIForeman::Model do
|
|
77
83
|
context "parameters" do
|
78
84
|
it_should_accept "name", ["--name=model"]
|
79
85
|
it_should_accept "id", ["--id=1"]
|
86
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
87
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
80
88
|
# it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
|
81
89
|
end
|
82
90
|
|
@@ -90,6 +98,8 @@ describe HammerCLIForeman::Model do
|
|
90
98
|
context "parameters" do
|
91
99
|
it_should_accept "name", ["--name=model", "--new-name=model2", "--info=description", "--vendor-class=class", "--hardware-model=model"]
|
92
100
|
it_should_accept "id", ["--id=1", "--new-name=model2", "--info=description", "--vendor-class=class", "--hardware-model=model"]
|
101
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
102
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
93
103
|
# it_should_fail_with "no params", []
|
94
104
|
# it_should_fail_with "name or id missing", ["--new-name=model2", "--info=description", "--vendor-class=class", "--hardware-model=model"]
|
95
105
|
# TODO: temporarily disabled, parameters are checked in the id resolver
|
@@ -18,6 +18,8 @@ describe HammerCLIForeman::OperatingSystem do
|
|
18
18
|
context "parameters" do
|
19
19
|
it_should_accept "no arguments"
|
20
20
|
it_should_accept_search_params
|
21
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
22
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
21
23
|
end
|
22
24
|
|
23
25
|
context "output" do
|
@@ -40,6 +42,8 @@ describe HammerCLIForeman::OperatingSystem do
|
|
40
42
|
context "parameters" do
|
41
43
|
it_should_accept "id", ["--id=1"]
|
42
44
|
it_should_accept "title", ["--title=Rhel 6.5"]
|
45
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
46
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
43
47
|
# it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
|
44
48
|
end
|
45
49
|
|
@@ -70,6 +74,8 @@ describe HammerCLIForeman::OperatingSystem do
|
|
70
74
|
|
71
75
|
context "parameters" do
|
72
76
|
it_should_accept "name, major, minor, family, release name", ["--name=media", "--major=1", "--minor=2", "--family=Red Hat", "--release-name=awesome"]
|
77
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
78
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
73
79
|
# it_should_fail_with "name missing", ["--major=1", "--minor=2", "--family=Red Hat", "--release-name=awesome"]
|
74
80
|
# TODO: temporarily disabled, parameters are checked in the api
|
75
81
|
end
|
@@ -87,6 +93,8 @@ describe HammerCLIForeman::OperatingSystem do
|
|
87
93
|
context "parameters" do
|
88
94
|
it_should_accept "id", ["--id=1"]
|
89
95
|
it_should_accept "title", ["--title=Rhel 6.5"]
|
96
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
97
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
90
98
|
# it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
|
91
99
|
# TODO: temporarily disabled, parameters are checked in the id resolver
|
92
100
|
end
|
@@ -102,6 +110,8 @@ describe HammerCLIForeman::OperatingSystem do
|
|
102
110
|
it_should_accept "id", ["--id=1"]
|
103
111
|
it_should_accept "title", ["--title=Rhel 6.5"]
|
104
112
|
it_should_accept "name, major, minor, family, release name", ["--id=83", "--name=os", "--major=1", "--minor=2", "--family=Red Hat", "--release-name=awesome"]
|
113
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
114
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
105
115
|
# it_should_fail_with "no params", []
|
106
116
|
# it_should_fail_with "label or id missing", ["--name=os", "--major=1", "--minor=2", "--family=Red Hat", "--release-name=awesome"]
|
107
117
|
# TODO: temporarily disabled, parameters are checked in the id resolver
|
@@ -126,6 +136,8 @@ describe HammerCLIForeman::OperatingSystem do
|
|
126
136
|
it_should_accept "name, value and os id", ["--name=domain", "--value=val", "--operatingsystem-id=1"]
|
127
137
|
it_should_accept "name, value and os title", ["--name=domain", "--value=val", "--operatingsystem=Rhel 6.5"]
|
128
138
|
it_should_accept "name, value, type and os id", ["--name=domain", "--value=val", "--parameter-type=string", "--operatingsystem-id=1"]
|
139
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
140
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
129
141
|
# it_should_fail_with "name missing", ["--value=val", "--operatingsystem-id=id"]
|
130
142
|
# it_should_fail_with "value missing", ["--name=name", "--operatingsystem-id=id"]
|
131
143
|
# it_should_fail_with "os id missing", ["--name=name", "--value=val"]
|
@@ -142,11 +154,12 @@ describe HammerCLIForeman::OperatingSystem do
|
|
142
154
|
context "parameters" do
|
143
155
|
it_should_accept "name and os id", ["--name=domain", "--operatingsystem-id=1"]
|
144
156
|
it_should_accept "name and os title", ["--name=domain", "--operatingsystem=Rhel 6.5"]
|
157
|
+
it_should_fail_with 'organization param', ['--organization-id=1']
|
158
|
+
it_should_fail_with 'location param', ['--location-id=1']
|
145
159
|
# it_should_fail_with "name missing", ["--operatingsystem-id=id"]
|
146
160
|
# it_should_fail_with "os id missing", ["--name=name"]
|
147
161
|
# TODO: temporarily disabled, parameters are checked in the id resolver
|
148
162
|
end
|
149
163
|
|
150
164
|
end
|
151
|
-
|
152
165
|
end
|