summaryrefslogtreecommitdiffstats
path: root/src/bin/scripts/t/070_dropuser.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/scripts/t/070_dropuser.pl')
-rw-r--r--src/bin/scripts/t/070_dropuser.pl23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/bin/scripts/t/070_dropuser.pl b/src/bin/scripts/t/070_dropuser.pl
new file mode 100644
index 0000000..2e858c5
--- /dev/null
+++ b/src/bin/scripts/t/070_dropuser.pl
@@ -0,0 +1,23 @@
+use strict;
+use warnings;
+
+use PostgresNode;
+use TestLib;
+use Test::More tests => 11;
+
+program_help_ok('dropuser');
+program_version_ok('dropuser');
+program_options_handling_ok('dropuser');
+
+my $node = get_new_node('main');
+$node->init;
+$node->start;
+
+$node->safe_psql('postgres', 'CREATE ROLE regress_foobar1');
+$node->issues_sql_like(
+ [ 'dropuser', 'regress_foobar1' ],
+ qr/statement: DROP ROLE regress_foobar1/,
+ 'SQL DROP ROLE run');
+
+$node->command_fails([ 'dropuser', 'regress_nonexistent' ],
+ 'fails with nonexistent user');