Skip to content

Commit bc91dc6

Browse files
ekohlbastelfreak
authored andcommitted
Apply puppet-lint to acceptance test example
1 parent 04e94e3 commit bc91dc6

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

spec/acceptance/class_spec.rb

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ class { 'selinux': mode => 'enforcing' }
1919
selinux::permissive { 'puppet_selinux_test_policy_t': }
2020
2121
selinux::port { 'puppet_selinux_test_policy_port_t/tcp':
22-
seltype => 'puppet_selinux_test_policy_port_t',
23-
port => 55555,
22+
seltype => 'puppet_selinux_test_policy_port_t',
23+
port => 55555,
2424
protocol => 'tcp',
2525
}
2626
}
2727
2828
# just something simple I found via Google:
29-
file {'/tmp/selinux_simple_policy.te':
29+
file { '/tmp/selinux_simple_policy.te':
3030
ensure => 'file',
3131
content => @("EOF")
3232
module puppet_selinux_simple_policy 1.0;
@@ -40,7 +40,7 @@ class file { read getattr };
4040
| EOF
4141
}
4242
43-
file {'/tmp/selinux_test_policy.te':
43+
file { '/tmp/selinux_test_policy.te':
4444
ensure => 'file',
4545
content => @("EOF")
4646
policy_module(puppet_selinux_test_policy, 1.0.0)
@@ -56,48 +56,49 @@ class file { read getattr };
5656
selinux::module { 'puppet_selinux_simple_policy':
5757
source_te => 'file:///tmp/selinux_simple_policy.te',
5858
builder => 'simple',
59-
require => File['/tmp/selinux_simple_policy.te']
59+
require => File['/tmp/selinux_simple_policy.te'],
6060
}
6161
6262
selinux::module { 'puppet_selinux_test_policy':
63-
source_te => 'file:///tmp/selinux_test_policy.te',
64-
builder => 'refpolicy',
65-
require => File['/tmp/selinux_test_policy.te']
63+
source_te => 'file:///tmp/selinux_test_policy.te',
64+
builder => 'refpolicy',
65+
require => File['/tmp/selinux_test_policy.te'],
6666
}
6767
6868
if $have_selinux_ruby_library {
69-
Class['selinux'] ->
70-
7169
file { '/tmp/test_selinux_fcontext':
7270
content => 'TEST',
7371
seltype => 'puppet_selinux_test_policy_exec_t',
72+
require => Class['selinux'],
7473
}
7574
76-
selinux::fcontext {'/tmp/fcontexts_source(/.*)?':
75+
selinux::fcontext { '/tmp/fcontexts_source(/.*)?':
7776
seltype => 'puppet_selinux_test_policy_exec_t',
7877
}
7978
80-
selinux::fcontext::equivalence {'/tmp/fcontexts_equivalent':
79+
selinux::fcontext::equivalence { '/tmp/fcontexts_equivalent':
8180
target => '/tmp/fcontexts_source',
8281
}
8382
8483
file {['/tmp/fcontexts_source', '/tmp/fcontexts_equivalent']:
85-
ensure => 'directory',
84+
ensure => 'directory',
8685
require => [Selinux::Fcontext['/tmp/fcontexts_source(/.*)?'], Selinux::Fcontext::Equivalence['/tmp/fcontexts_equivalent']],
8786
}
8887
89-
file {['/tmp/fcontexts_source/define_test', '/tmp/fcontexts_equivalent/define_test']:
90-
ensure => file,
91-
notify => Exec["/sbin/restorecon -FR /tmp/fcontexts_*"]
88+
file { ['/tmp/fcontexts_source/define_test', '/tmp/fcontexts_equivalent/define_test']:
89+
ensure => file,
90+
notify => Exec['/sbin/restorecon -FR /tmp/fcontexts_*'],
9291
}
93-
exec {'/sbin/restorecon -FR /tmp/fcontexts_*':
94-
# this is needed because puppet creates files with the wrong context as
95-
# it runs unconfined and only becomes idempotent after the second run.
92+
exec { '/sbin/restorecon -FR /tmp/fcontexts_*':
93+
# this is needed because puppet creates files with the wrong context as
94+
# it runs unconfined and only becomes idempotent after the second run.
9695
refreshonly => true,
9796
}
9897
9998
# test purging
100-
resources {['selinux_fcontext', 'selinux_fcontext_equivalence']: purge => true }
99+
resources { ['selinux_fcontext', 'selinux_fcontext_equivalence']:
100+
purge => true,
101+
}
101102
}
102103
EOS
103104
end

0 commit comments

Comments
 (0)