File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 1111 {
1212 "operatingsystem" : " RedHat" ,
1313 "operatingsystemrelease" : [
14- " 7"
14+ " 7" ,
15+ " 8" ,
16+ " 9"
1517 ]
1618 },
1719 {
1820 "operatingsystem" : " CentOS" ,
1921 "operatingsystemrelease" : [
20- " 7"
22+ " 7" ,
23+ " 8" ,
24+ " 9"
2125 ]
2226 },
2327 {
Original file line number Diff line number Diff line change 1717 )
1818 end
1919
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-
2620 context 'validates the corosncy configuration when config_validate_cmd is set' do
2721 let ( :params ) do
2822 super ( ) . merge (
730724
731725 it_configures 'corosync'
732726
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+
733748 # Check default package installations per platform
734749 case os_facts [ :os ] [ 'family' ]
735750 when 'RedHat'
You can’t perform that action at this time.
0 commit comments