File tree Expand file tree Collapse file tree 4 files changed +31
-8
lines changed Expand file tree Collapse file tree 4 files changed +31
-8
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ corosync::config_validate_cmd : " /usr/sbin/corosync -c % -t"
Original file line number Diff line number Diff line change
1
+ ---
2
+ corosync::config_validate_cmd : " /usr/sbin/corosync -c % -t"
Original file line number Diff line number Diff line change 11
11
{
12
12
"operatingsystem" : " RedHat" ,
13
13
"operatingsystemrelease" : [
14
- " 7"
14
+ " 7" ,
15
+ " 8" ,
16
+ " 9"
15
17
]
16
18
},
17
19
{
18
20
"operatingsystem" : " CentOS" ,
19
21
"operatingsystemrelease" : [
20
- " 7"
22
+ " 7" ,
23
+ " 8" ,
24
+ " 9"
21
25
]
22
26
},
23
27
{
Original file line number Diff line number Diff line change 17
17
)
18
18
end
19
19
20
- it 'validates the corosync configuration' do
21
- is_expected . to contain_file ( '/etc/corosync/corosync.conf' ) . with_validate_cmd (
22
- '/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t'
23
- )
24
- end
25
-
26
20
context 'validates the corosncy configuration when config_validate_cmd is set' do
27
21
let ( :params ) do
28
22
super ( ) . merge (
730
724
731
725
it_configures 'corosync'
732
726
727
+ # Check the correct validation command is used for each OS
728
+ it 'validates the corosync configuration' do
729
+ case os_facts [ :os ] [ 'family' ]
730
+ when 'RedHat'
731
+ case os_facts [ :os ] [ 'release' ] [ 'major' ] . to_i
732
+ when 0 ..7
733
+ is_expected . to contain_file ( '/etc/corosync/corosync.conf' ) . with_validate_cmd (
734
+ '/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t'
735
+ )
736
+ else
737
+ is_expected . to contain_file ( '/etc/corosync/corosync.conf' ) . with_validate_cmd (
738
+ '/usr/sbin/corosync -c % -t'
739
+ )
740
+ end
741
+ else
742
+ is_expected . to contain_file ( '/etc/corosync/corosync.conf' ) . with_validate_cmd (
743
+ '/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t'
744
+ )
745
+ end
746
+ end
747
+
733
748
# Check default package installations per platform
734
749
case os_facts [ :os ] [ 'family' ]
735
750
when 'RedHat'
You can’t perform that action at this time.
0 commit comments