File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 415415 )
416416 end
417417
418+ it 'does not create /etc/default/chrony' do
419+ is_expected . not_to contain_file ( '/etc/default/chrony' )
420+ end
421+
418422 if ( facts [ :os ] [ 'release' ] [ 'major' ] = '8' )
419423 context 'on RedHat 8 family with default parameters' do
420424 it 'contains an empty OPTIONS line' do
439443 with_content ( %r{^OPTIONS="-4 -u chrony"$} )
440444 end
441445 end
446+ when 'Debian'
447+ it 'does not create /etc/sysconfig/chronyd' do
448+ is_expected . not_to contain_file ( '/etc/sysconfig/chronyd' )
449+ end
450+
451+ context 'with no options parameter' do
452+ it {
453+ is_expected . not_to contain_file ( '/etc/default/chrony' )
454+ }
455+ end
456+
457+ context 'with custom options parameter' do
458+ let ( :params ) { { options : '-4 -u chrony' } }
459+
460+ it 'contains the custom OPTIONS line' do
461+ is_expected . to contain_file ( '/etc/default/chrony' ) .
462+ with_content ( %r{^DAEMON_OPTS="-4 -u chrony"$} ) .
463+ with_ensure ( 'file' ) .
464+ with_owner ( '0' ) .
465+ with_group ( '0' ) .
466+ with_mode ( '0644' )
467+ end
468+ end
442469 else
443- it 'on non-RedHat families' do
470+ it 'on non-RedHat/Debian families' do
444471 is_expected . not_to contain_file ( '/etc/sysconfig/chronyd' )
472+ is_expected . not_to contain_file ( '/etc/default/chrony' )
445473 end
446474 end
447475 end
You can’t perform that action at this time.
0 commit comments