Skip to content

Commit d9c9a2f

Browse files
committed
remove non systemd tests
1 parent 84081ed commit d9c9a2f

File tree

11 files changed

+11
-94
lines changed

11 files changed

+11
-94
lines changed

manifests/broker.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
# Set the name of the service.
7171
#
7272
# @param manage_service
73-
# Install the init.d or systemd service.
73+
# Install the systemd service.
7474
#
7575
# @param service_ensure
7676
# Set the ensure state of the service.

manifests/consumer.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
# Set the name of the service.
7171
#
7272
# @param manage_service
73-
# Install the init.d or systemd service.
73+
# Install the systemd service.
7474
#
7575
# @param service_ensure
7676
# Set the ensure state of the service.

manifests/mirror.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
# Set the name of the service.
7777
#
7878
# @param manage_service
79-
# Install the init.d or systemd service.
79+
# Install the systemd service.
8080
#
8181
# @param service_ensure
8282
# Set the ensure state of the service.

manifests/producer.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
# Set the name of the service.
7474
#
7575
# @param manage_service
76-
# Install the init.d or systemd service.
76+
# Install systemd service.
7777
#
7878
# @param service_ensure
7979
# Set the ensure state of the service.

spec/acceptance/broker_spec.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,6 @@ class { 'kafka::broker':
197197
apply_manifest(pp, catch_changes: true)
198198
end
199199

200-
describe file('/etc/init.d/kafka'), if: (fact('service_provider') == 'upstart' && fact('osfamily') == 'Debian') do
201-
it { is_expected.to be_file }
202-
it { is_expected.to be_owned_by 'root' }
203-
it { is_expected.to be_grouped_into 'root' }
204-
it { is_expected.to contain %r{^# Provides:\s+kafka$} }
205-
it { is_expected.to contain 'export KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote"' }
206-
it { is_expected.to contain 'export KAFKA_HEAP_OPTS="-Xmx512M -Xmx512M"' }
207-
it { is_expected.to contain 'export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:/tmp/log4j.properties"' }
208-
end
209-
210200
describe file('/etc/systemd/system/kafka.service'), if: (fact('operatingsystemmajrelease') == '7' && fact('osfamily') == 'RedHat') do
211201
it { is_expected.to be_file }
212202
it { is_expected.to be_owned_by 'root' }

spec/acceptance/consumer_spec.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,6 @@ class { 'kafka::consumer':
140140
apply_manifest(pp, catch_failures: true)
141141
end
142142

143-
describe file('/etc/init.d/kafka-consumer'), if: (fact('service_provider') == 'upstart' && fact('osfamily') == 'Debian') do
144-
it { is_expected.to be_file }
145-
it { is_expected.to be_owned_by 'root' }
146-
it { is_expected.to be_grouped_into 'root' }
147-
it { is_expected.to contain %r{^# Provides:\s+kafka-consumer$} }
148-
it { is_expected.to contain 'export KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9993"' }
149-
it { is_expected.to contain 'export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:/opt/kafka/config/log4j.properties"' }
150-
end
151-
152143
describe file('/etc/systemd/system/kafka-consumer.service'), if: (fact('operatingsystemmajrelease') == '7' && fact('osfamily') == 'RedHat') do
153144
it { is_expected.to be_file }
154145
it { is_expected.to be_owned_by 'root' }

spec/acceptance/mirror_spec.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,6 @@ class { 'kafka::mirror':
220220
apply_manifest(pp, catch_changes: true)
221221
end
222222

223-
describe file('/etc/init.d/kafka-mirror'), if: (fact('service_provider') == 'upstart' && fact('osfamily') == 'Debian') do
224-
it { is_expected.to be_file }
225-
it { is_expected.to be_owned_by 'root' }
226-
it { is_expected.to be_grouped_into 'root' }
227-
it { is_expected.to contain %r{^# Provides:\s+kafka-mirror$} }
228-
it { is_expected.to contain 'export KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9991"' }
229-
it { is_expected.to contain 'export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:/opt/kafka/config/log4j.properties"' }
230-
end
231-
232223
describe file('/etc/systemd/system/kafka-mirror.service'), if: (fact('operatingsystemmajrelease') == '7' && fact('osfamily') == 'RedHat') do
233224
it { is_expected.to be_file }
234225
it { is_expected.to be_owned_by 'root' }

spec/classes/broker_spec.rb

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,41 +52,26 @@
5252
context 'manage_service false' do
5353
let(:params) { super().merge(manage_service: false) }
5454

55-
it { is_expected.not_to contain_file('/etc/init.d/kafka') }
5655
it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service') }
5756
it { is_expected.not_to contain_service('kafka') }
5857
end
5958

6059
context 'defaults' do
61-
if os_facts['service_provider'] == 'systemd'
62-
it { is_expected.to contain_file('/etc/init.d/kafka').with_ensure('absent') }
63-
it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=} }
64-
it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=} }
65-
else
66-
it { is_expected.to contain_file('/etc/init.d/kafka') }
67-
end
68-
60+
it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=} }
61+
it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=} }
6962
it { is_expected.to contain_service('kafka') }
7063
end
7164

7265
context 'limit_nofile set' do
7366
let(:params) { super().merge(limit_nofile: '65536') }
7467

75-
if os_facts['service_provider'] == 'systemd'
76-
it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=65536$} }
77-
else
78-
it { is_expected.to contain_file('/etc/init.d/kafka').with_content %r{ulimit -n 65536$} }
79-
end
68+
it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=65536$} }
8069
end
8170

8271
context 'limit_core set' do
8372
let(:params) { super().merge(limit_core: 'infinity') }
8473

85-
if os_facts['service_provider'] == 'systemd'
86-
it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=infinity$} }
87-
else
88-
it { is_expected.to contain_file('/etc/init.d/kafka').with_content %r{ulimit -c infinity$} }
89-
end
74+
it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=infinity$} }
9075
end
9176

9277
context 'service_requires set', if: os_facts['service_provider'] == 'systemd' do

spec/classes/consumer_spec.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@
5151

5252
describe 'kafka::consumer::service' do
5353
context 'defaults' do
54-
if os_facts['service_provider'] == 'systemd'
55-
it { is_expected.to contain_file('/etc/systemd/system/kafka-consumer.service') }
56-
else
57-
it { is_expected.to contain_file('/etc/init.d/kafka-consumer') }
58-
end
59-
54+
it { is_expected.to contain_file('/etc/systemd/system/kafka-consumer.service') }
6055
it { is_expected.to contain_service('kafka-consumer') }
6156
end
6257
end

spec/classes/mirror_spec.rb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,7 @@
4848

4949
describe 'kafka::mirror::service' do
5050
context 'defaults' do
51-
if os_facts['service_provider'] == 'systemd'
52-
it { is_expected.to contain_file('/etc/init.d/kafka-mirror').with_ensure('absent') }
53-
it { is_expected.to contain_file('/etc/systemd/system/kafka-mirror.service').with_content %r{/opt/kafka/config/(?=.*consumer)|(?=.*producer).propertie} }
54-
else
55-
it { is_expected.to contain_file('/etc/init.d/kafka-mirror') }
56-
it { is_expected.to contain_file('/etc/init.d/kafka-mirror').with_content %r{/opt/kafka/config/(?=.*consumer)|(?=.*producer).properties} }
57-
end
58-
51+
it { is_expected.to contain_file('/etc/systemd/system/kafka-mirror.service').with_content %r{/opt/kafka/config/(?=.*consumer)|(?=.*producer).propertie} }
5952
it { is_expected.to contain_service('kafka-mirror') }
6053
end
6154
end

0 commit comments

Comments
 (0)