Skip to content

Commit

Permalink
Reorder the sequence for GetRbacDatabase
Browse files Browse the repository at this point in the history
This removes the need of a reconnect

Change-Id: I8af9cc025f93034170a0bb24a24e7f65ba2d9cb0
Reviewed-on: http://review.couchbase.org/c/kv_engine/+/160286
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
  • Loading branch information
trondn committed Aug 30, 2021
1 parent a1d7dab commit 20512ac
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/testapp/testapp_misc.cc
Expand Up @@ -107,17 +107,18 @@ TEST_P(MiscTest, UpdateUserPermissionsInvalidPayload) {
* add tests to verify the content
*/
TEST_P(MiscTest, GetRbacDatabase) {
auto& conn = getAdminConnection();
// Verify that we need privileges to do this
auto& conn = getConnection();
auto response = conn.execute(BinprotGenericCommand{
cb::mcbp::ClientOpcode::IoctlGet, "rbac.db.dump?domain=external"});
ASSERT_TRUE(response.isSuccess());
ASSERT_FALSE(response.getDataString().empty());
ASSERT_FALSE(response.isSuccess());
ASSERT_EQ(cb::mcbp::Status::Eaccess, response.getStatus());

prepare(conn);
conn.authenticate("@admin", mcd_env->getPassword("@admin"));
response = conn.execute(BinprotGenericCommand{
cb::mcbp::ClientOpcode::IoctlGet, "rbac.db.dump?domain=external"});
ASSERT_FALSE(response.isSuccess());
ASSERT_EQ(cb::mcbp::Status::Eaccess, response.getStatus());
ASSERT_TRUE(response.isSuccess());
ASSERT_FALSE(response.getDataString().empty());
}

TEST_P(MiscTest, Config_Validate_Empty) {
Expand Down

0 comments on commit 20512ac

Please sign in to comment.