@@ -35,8 +35,17 @@ def skip_fips(host)
3535 on ( host , 'puppet resource package ipa-client ensure=present' )
3636 end
3737
38+ it 'enables ipv6' do
39+ on ( host , 'puppet resource sysctl net.ipv6.conf.all.disable_ipv6 ensure=present value=0 target=/etc/sysctl.conf' )
40+ on ( host , 'puppet resource sysctl net.ipv6.conf.lo.disable_ipv6 ensure=present value=0 target=/etc/sysctl.conf' )
41+ end
42+
43+ it 'configures the firewall' do
44+ on ( host , 'systemctl is-active firewalld.service && firewall-cmd --add-port={{80,443,389,636,88,464,53}/tcp,{88,464,53,123}/udp} --permanent' )
45+ end
46+
3847 it 'should ensure hostname is set to the FQDN' do
39- hostname = pfact_on ( host , 'fqdn' )
48+ hostname = pfact_on ( host , 'networking. fqdn' )
4049 on ( host , "hostnamectl set-hostname #{ hostname } " )
4150
4251 # DBus may need to be restarted after updating, and a reboot is the only way
@@ -52,7 +61,7 @@ def skip_fips(host)
5261 results = apply_manifest_on ( server , manifest )
5362 expect ( results . output ) . to match ( /Notice: Type => NilClass Content => null/ )
5463
55- expect ( pfact_on ( server , 'ipa' ) ) . to be_empty
64+ expect ( pfact_on ( server , 'ipa' ) ) . to be_nil . or be_empty
5665 end
5766 end
5867
@@ -65,7 +74,7 @@ def skip_fips(host)
6574 results = apply_manifest_on ( server , manifest )
6675 expect ( results . output ) . to match ( /Notice: Type => NilClass Content => null/ )
6776
68- expect ( pfact_on ( server , 'ipa' ) ) . to be_empty
77+ expect ( pfact_on ( server , 'ipa' ) ) . to be_nil . or be_empty
6978 end
7079 end
7180
@@ -74,7 +83,7 @@ def skip_fips(host)
7483 it 'ipa fact should contain domain and IPA server' do
7584 # ipa-server-install installs both the IPA server and client.
7685 # The fact uses the client env.
77- fqdn = pfact_on ( server , 'fqdn' )
86+ fqdn = pfact_on ( server , 'networking. fqdn' )
7887
7988 cmd = [
8089 'umask 0022 &&' ,
@@ -96,7 +105,8 @@ def skip_fips(host)
96105
97106 results = pfact_on ( server , 'ipa' )
98107
99- expect ( results ) . to_not be_empty
108+ expect ( results ) . to be_a ( Hash )
109+ expect ( results ) . not_to be_empty
100110 expect ( results [ 'connected' ] ) . to eq true
101111 expect ( results [ 'server' ] ) . to eq fqdn
102112 expect ( results [ 'domain' ] ) . to eq ipa_domain
@@ -109,7 +119,8 @@ def skip_fips(host)
109119
110120 results = pfact_on ( server , 'ipa' )
111121
112- expect ( results ) . to_not be_empty
122+ expect ( results ) . to be_a ( Hash )
123+ expect ( results ) . not_to be_empty
113124 expect ( results [ 'connected' ] ) . to eq false
114125 end
115126
@@ -126,16 +137,17 @@ def skip_fips(host)
126137
127138 context 'prior to registration' do
128139 it 'should not have an IPA fact' do
129- expect ( pfact_on ( client , 'ipa' ) ) . to be_empty
140+ expect ( pfact_on ( client , 'ipa' ) ) . to be_nil . or be_empty
130141 end
131142 end
132143
133144 context 'after registration' do
134145 let ( :ipa_server ) {
135- pfact_on ( hosts_with_role ( hosts , 'server' ) . first , 'fqdn' )
146+ pfact_on ( hosts_with_role ( hosts , 'server' ) . first , 'networking. fqdn' )
136147 }
137148
138149 it 'should register with the IPA server' do
150+ os = fact_on ( client , 'os' )
139151 ipa_command = [
140152 # Unattended installation
141153 'ipa-client-install -U' ,
@@ -152,14 +164,17 @@ def skip_fips(host)
152164 # Admin password
153165 "--password='#{ admin_password } '" ,
154166 ] . join ( ' ' )
167+ # Force ntpd support on EL7
168+ ipa_command += ' --force-ntpd' if os . dig ( 'release' , 'major' ) == '7'
155169
156170 on ( client , ipa_command )
157171 end
158172
159173 it 'should have the IPA fact populated' do
160174 results = pfact_on ( client , 'ipa' )
161175
162- expect ( results ) . to_not be_empty
176+ expect ( results ) . to be_a ( Hash )
177+ expect ( results ) . not_to be_empty
163178 expect ( results [ 'connected' ] ) . to eq true
164179 expect ( results [ 'server' ] ) . to eq ipa_server
165180 expect ( results [ 'domain' ] ) . to eq ipa_domain
@@ -174,7 +189,8 @@ def skip_fips(host)
174189
175190 results = pfact_on ( client , 'ipa' )
176191
177- expect ( results ) . to_not be_empty
192+ expect ( results ) . to be_a ( Hash )
193+ expect ( results ) . not_to be_empty
178194 expect ( results [ 'connected' ] ) . to eq false
179195 end
180196
0 commit comments