diff --git a/contrib/basebackup_to_shell/t/001_basic.pl b/contrib/basebackup_to_shell/t/001_basic.pl
index 57534b62c8..d246a01cfa 100644
--- a/contrib/basebackup_to_shell/t/001_basic.pl
+++ b/contrib/basebackup_to_shell/t/001_basic.pl
@@ -17,11 +17,12 @@ if (!defined $gzip || $gzip eq '')
 }
 
 my $node = PostgreSQL::Test::Cluster->new('primary');
-$node->init('allows_streaming' => 1);
+$node->init('allows_streaming' => 1),
+  auth_extra       => [ '--create-role', 'backupuser' ]);
 $node->append_conf('postgresql.conf',
 				   "shared_preload_libraries = 'basebackup_to_shell'");
 $node->start;
-$node->safe_psql('postgres', 'CREATE USER backupuser REPLICATION');
+$node->safe_psql('postgres', 'ALTER USER backupuser REPLICATION');
 $node->safe_psql('postgres', 'CREATE ROLE trustworthy');
 
 # For nearly all pg_basebackup invocations some options should be specified,
