File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
spec/unit/puppet/provider/sshd_config_match Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 4242 end
4343 end
4444
45+ context 'with condition containing regex chars' do
46+ let ( :tmptarget ) { aug_fixture ( 'empty' ) }
47+ let ( :target ) { tmptarget . path }
48+
49+ it 'creates simple new entry' do
50+ apply! ( Puppet ::Type . type ( :sshd_config_match ) . new (
51+ name : 'Host *' ,
52+ target : target ,
53+ ensure : :present ,
54+ provider : 'augeas'
55+ ) )
56+
57+ aug_open ( target , 'Sshd.lns' ) do |aug |
58+ expect ( aug . get ( 'Match/Condition/Host' ) ) . to eq ( '*' )
59+ end
60+ end
61+
62+ it 'creates new comment before entry' do
63+ apply! ( Puppet ::Type . type ( :sshd_config_match ) . new (
64+ name : 'Host *' ,
65+ target : target ,
66+ ensure : :present ,
67+ comment : 'manage host *' ,
68+ provider : 'augeas'
69+ ) )
70+
71+ aug_open ( target , 'Sshd.lns' ) do |aug |
72+ expect ( aug . get ( 'Match[Condition/Host]/Settings/#comment' ) ) . to eq ( 'Host *: manage host *' )
73+ end
74+ end
75+ end
76+
4577 context 'with full file' do
4678 let ( :tmptarget ) { aug_fixture ( 'full' ) }
4779 let ( :target ) { tmptarget . path }
You can’t perform that action at this time.
0 commit comments