File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 6161 fail(' port parameter was not specified and could not be determined from title' )
6262 }
6363
64- if $_host != undef {
65- $_host_port = " ${_host}:${ _port} "
66- } else {
67- $_host_port = String($ _port)
64+ $_host_port = $_host ? {
65+ undef => String($ _port),
66+ Stdlib::IP::Address:: V6 => " [${_host}]:${_port} " ,
67+ default => " ${_host}:${ _port} " ,
6868 }
6969
7070 $protocol = $ssl ? {
Original file line number Diff line number Diff line change 7171 it { is_expected . to contain_concat_fragment ( 'squid_http_port_host:1650' ) . with_content ( %r{^http_port\s +1650$} ) }
7272 end
7373
74+ context 'with IPv6' do
75+ let ( :title ) { 'ipv6_host' }
76+ let ( :params ) do
77+ {
78+ host : '2001:db8::1' ,
79+ port : 1650 ,
80+ }
81+ end
82+
83+ # Wrap IPv6addresses in square brackets
84+ it { is_expected . to contain_concat_fragment ( 'squid_http_port_ipv6_host' ) . with_content ( %r{^http_port\s +\[ 2001:db8::1\] :1650$} ) }
85+ end
86+
7487 context 'without a port specified' do
7588 let ( :title ) { 'garbage' }
7689 let ( :params ) do
You can’t perform that action at this time.
0 commit comments