hammer_cli_foreman_openscap 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hammer_cli_foreman_openscap.rb +4 -0
- data/lib/hammer_cli_foreman_openscap/arf_report.rb +13 -3
- data/lib/hammer_cli_foreman_openscap/commands.rb +55 -5
- data/lib/hammer_cli_foreman_openscap/id_resolver.rb +2 -1
- data/lib/hammer_cli_foreman_openscap/options/normalizers.rb +14 -0
- data/lib/hammer_cli_foreman_openscap/policy.rb +2 -0
- data/lib/hammer_cli_foreman_openscap/scap_content.rb +3 -4
- data/lib/hammer_cli_foreman_openscap/tailoring_file.rb +65 -0
- data/lib/hammer_cli_foreman_openscap/version.rb +1 -1
- data/test/compliance_resource_mock.rb +12 -0
- data/test/data/1.14/foreman_api.json +1 -0
- data/test/data/1.15/foreman_api.json +1 -0
- data/test/data/tailoring.xml +31 -0
- data/test/functional/tailoring_file_test.rb +60 -0
- data/test/functional/test_helper.rb +15 -0
- data/test/test_helper.rb +25 -8
- data/test/unit/arf_report_test.rb +18 -1
- data/test/unit/policy_test.rb +2 -1
- data/test/unit/scap_content_test.rb +2 -1
- data/test/unit/tailoring_file_test.rb +56 -0
- data/test/unit/test_helper.rb +3 -0
- metadata +23 -7
data/test/unit/policy_test.rb
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
|
2
|
+
require 'hammer_cli_foreman_openscap/tailoring_file'
|
|
3
|
+
|
|
4
|
+
describe HammerCLIForemanOpenscap::TailoringFile do
|
|
5
|
+
include CommandTestHelper
|
|
6
|
+
|
|
7
|
+
context "ListCommand" do
|
|
8
|
+
let(:cmd) { HammerCLIForemanOpenscap::TailoringFile::ListCommand.new "", ctx }
|
|
9
|
+
|
|
10
|
+
before :each do
|
|
11
|
+
ComplianceResourceMock.tailoring_files_list
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
context "parameters" do
|
|
15
|
+
it_should_accept "no arguments"
|
|
16
|
+
it_should_accept_search_params
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
context "output" do
|
|
20
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
|
21
|
+
it_should_print_n_records
|
|
22
|
+
it_should_print_columns ["Id", "Name"]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
context "DeleteCommand" do
|
|
27
|
+
let(:cmd) { HammerCLIForemanOpenscap::TailoringFile::DeleteCommand.new("", ctx) }
|
|
28
|
+
|
|
29
|
+
context "parameters" do
|
|
30
|
+
it_should_accept "id", ["--id=1"]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
context "UpdateCommand" do
|
|
35
|
+
let(:cmd) { HammerCLIForemanOpenscap::TailoringFile::UpdateCommand.new("", ctx) }
|
|
36
|
+
|
|
37
|
+
context "parameters" do
|
|
38
|
+
it_should_accept "id", ["--id=1"]
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
context "InfoCommand" do
|
|
43
|
+
let(:cmd) { HammerCLIForemanOpenscap::TailoringFile::InfoCommand.new("", ctx) }
|
|
44
|
+
|
|
45
|
+
context "parameters" do
|
|
46
|
+
it_should_accept "id", ["--id=1"]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
context "output" do
|
|
50
|
+
with_params ["--id=1"] do
|
|
51
|
+
it_should_print_n_records 1
|
|
52
|
+
it_should_print_columns ["Id", "Name", "Created at", "Original filename", "Tailoring file profiles", "Organizations"]
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hammer_cli_foreman_openscap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Foreman team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-03-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: hammer_cli_foreman
|
|
@@ -39,15 +39,24 @@ files:
|
|
|
39
39
|
- lib/hammer_cli_foreman_openscap/error.rb
|
|
40
40
|
- lib/hammer_cli_foreman_openscap/exception_handler.rb
|
|
41
41
|
- lib/hammer_cli_foreman_openscap/id_resolver.rb
|
|
42
|
+
- lib/hammer_cli_foreman_openscap/options/normalizers.rb
|
|
42
43
|
- lib/hammer_cli_foreman_openscap/policy.rb
|
|
43
44
|
- lib/hammer_cli_foreman_openscap/scap_content.rb
|
|
45
|
+
- lib/hammer_cli_foreman_openscap/tailoring_file.rb
|
|
44
46
|
- lib/hammer_cli_foreman_openscap/version.rb
|
|
45
47
|
- test/compliance_resource_mock.rb
|
|
46
48
|
- test/data/1.11/foreman_api.json
|
|
49
|
+
- test/data/1.14/foreman_api.json
|
|
50
|
+
- test/data/1.15/foreman_api.json
|
|
51
|
+
- test/data/tailoring.xml
|
|
52
|
+
- test/functional/tailoring_file_test.rb
|
|
53
|
+
- test/functional/test_helper.rb
|
|
47
54
|
- test/test_helper.rb
|
|
48
55
|
- test/unit/arf_report_test.rb
|
|
49
56
|
- test/unit/policy_test.rb
|
|
50
57
|
- test/unit/scap_content_test.rb
|
|
58
|
+
- test/unit/tailoring_file_test.rb
|
|
59
|
+
- test/unit/test_helper.rb
|
|
51
60
|
homepage:
|
|
52
61
|
licenses:
|
|
53
62
|
- GPL-3
|
|
@@ -68,14 +77,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
68
77
|
version: '0'
|
|
69
78
|
requirements: []
|
|
70
79
|
rubyforge_project:
|
|
71
|
-
rubygems_version: 2.4.
|
|
80
|
+
rubygems_version: 2.4.5
|
|
72
81
|
signing_key:
|
|
73
82
|
specification_version: 4
|
|
74
83
|
summary: Foreman OpenSCAP commands for Hammer
|
|
75
84
|
test_files:
|
|
76
|
-
- test/compliance_resource_mock.rb
|
|
77
|
-
- test/test_helper.rb
|
|
78
|
-
- test/data/1.11/foreman_api.json
|
|
79
|
-
- test/unit/arf_report_test.rb
|
|
80
85
|
- test/unit/scap_content_test.rb
|
|
86
|
+
- test/unit/tailoring_file_test.rb
|
|
87
|
+
- test/unit/test_helper.rb
|
|
81
88
|
- test/unit/policy_test.rb
|
|
89
|
+
- test/unit/arf_report_test.rb
|
|
90
|
+
- test/test_helper.rb
|
|
91
|
+
- test/functional/tailoring_file_test.rb
|
|
92
|
+
- test/functional/test_helper.rb
|
|
93
|
+
- test/data/1.14/foreman_api.json
|
|
94
|
+
- test/data/1.11/foreman_api.json
|
|
95
|
+
- test/data/1.15/foreman_api.json
|
|
96
|
+
- test/data/tailoring.xml
|
|
97
|
+
- test/compliance_resource_mock.rb
|