Skip to content

Commit 265f522

Browse files
committed
Add a test for removing an allowed MySQL host, and remove un-needed -h flag to the psql command
1 parent 4c4daae commit 265f522

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Diff for: functional-test.pl

+15-1
Original file line numberDiff line numberDiff line change
@@ -2184,6 +2184,20 @@ package virtual_server;
21842184
'grep' => 'Allowed mysql hosts:.*1\\.2\\.3\\.4',
21852185
},
21862186

2187+
# Remove the allowed database host
2188+
{ 'command' => 'modify-database-hosts.pl',
2189+
'args' => [ [ 'domain', $test_domain ],
2190+
[ 'type', 'mysql' ],
2191+
[ 'remove-host', '1.2.3.4' ] ],
2192+
},
2193+
2194+
# Make sure the allowed DB is gone
2195+
{ 'command' => 'list-domains.pl',
2196+
'args' => [ [ 'domain', $test_domain ],
2197+
[ 'multiline' ] ],
2198+
'antigrep' => 'Allowed mysql hosts:.*1\\.2\\.3\\.4',
2199+
},
2200+
21872201
$config{'postgres'} ?
21882202
(
21892203
# Create a PostgreSQL database
@@ -12867,7 +12881,7 @@ sub postgresql_login_commands
1286712881

1286812882
# Check PostgreSQL login
1286912883
{ 'command' => 'su - '.$user.' -c '.
12870-
quotemeta('psql -U '.$user.' -h localhost '.
12884+
quotemeta('psql -U '.$user.' '.
1287112885
'-c "'.($sql || 'select 666').'" '.$db),
1287212886
$sql ? ( ) : $failmode ? ( 'antigrep' => 666 ) : ( 'grep' => 666 ),
1287312887
'ignorefail' => $failmode,

0 commit comments

Comments
 (0)