You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2017/11/06 22:09:56 UTC
[1/7] mesos git commit: MesosTidy: Added some `google-*` checks to
the default set of checks.
Repository: mesos
Updated Branches:
refs/heads/master 0735c2d18 -> a94e3cd0f
MesosTidy: Added some `google-*` checks to the default set of checks.
Review: https://reviews.apache.org/r/63565
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6fd1399c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6fd1399c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6fd1399c
Branch: refs/heads/master
Commit: 6fd1399c2ed9999936681cf7b16951498c3b96eb
Parents: 0735c2d
Author: Michael Park <mp...@apache.org>
Authored: Sat Nov 4 15:21:07 2017 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Mon Nov 6 13:56:56 2017 -0800
----------------------------------------------------------------------
support/mesos-tidy.sh | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/6fd1399c/support/mesos-tidy.sh
----------------------------------------------------------------------
diff --git a/support/mesos-tidy.sh b/support/mesos-tidy.sh
index 875108a..c33dfe0 100755
--- a/support/mesos-tidy.sh
+++ b/support/mesos-tidy.sh
@@ -21,10 +21,38 @@ set -o pipefail
MESOS_DIR=$(git rev-parse --show-toplevel)
+DEFAULT_CHECKS=
+
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'clang-diagnostic-*'
+
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'clang-analyzer-*'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-core.CallAndMessage'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-core.NonNullParamChecker'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-core.NullDereference'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-cplusplus.NewDelete'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-optin.cplusplus.VirtualCall'
+
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'google-*'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-build-using-namespace'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-default-arguments'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-explicit-constructor'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-global-names-in-headers'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-readability-namespace-comments'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-runtime-int'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-runtime-member-string-references'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-readability-casting'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-runtime-references'
+
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'mesos-*'
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'-mesos-this-capture'
+
+DEFAULT_CHECKS=${DEFAULT_CHECKS},'readability-redundant-string-cstr'
+
# Configure how checks are run. These variables can be overridden by setting the
# respective environment variables before invoking this script.
# TODO(bbannier): Enable more upstream checks by default, e.g., from the Google set.
-CHECKS=${CHECKS:-'-*,mesos-*,readability-redundant-string-cstr'}
+CHECKS=${CHECKS:-${DEFAULT_CHECKS}}
# Check for unstaged or uncommitted changes.
if ! $(git diff-index --quiet HEAD --); then
[3/7] mesos git commit: Flattened unnecessary `Optional>`
to simply `Shared`.
Posted by mp...@apache.org.
Flattened unnecessary `Optional<Shared<T>>` to simply `Shared<T>`.
Since `Shared` is already nullable, avoiding the null state of
a `Shared` and wrapping it in an `Optional` doesn't add anything.
We should just use `Shared` as it is, and make use of the null state.
Review: https://reviews.apache.org/r/63591
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f9776ccb
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f9776ccb
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f9776ccb
Branch: refs/heads/master
Commit: f9776ccb47aecdee89bedcf7ef7ec4944e1855eb
Parents: 02bfc1b
Author: Michael Park <mp...@apache.org>
Authored: Mon Nov 6 10:45:59 2017 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Mon Nov 6 13:57:05 2017 -0800
----------------------------------------------------------------------
include/mesos/slave/containerizer.hpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/f9776ccb/include/mesos/slave/containerizer.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/slave/containerizer.hpp b/include/mesos/slave/containerizer.hpp
index 838a8c3..c34f129 100644
--- a/include/mesos/slave/containerizer.hpp
+++ b/include/mesos/slave/containerizer.hpp
@@ -72,7 +72,7 @@ struct ContainerIO
{
switch (type_) {
case Type::FD:
- return process::Subprocess::FD(*fd_->get());
+ return process::Subprocess::FD(*fd_);
case Type::PATH:
return process::Subprocess::PATH(path_.get());
default:
@@ -115,11 +115,11 @@ struct ContainerIO
IO(Type _type, const std::string& _path)
: type_(_type),
- fd_(None()),
+ fd_(),
path_(_path) {}
Type type_;
- Option<process::Shared<FDWrapper>> fd_;
+ process::Shared<FDWrapper> fd_;
Option<std::string> path_;
};
[2/7] mesos git commit: MesosTidy: Added braces around statements.
Posted by mp...@apache.org.
MesosTidy: Added braces around statements.
```
src/slave/containerizer/containerizer.cpp:94:35: warning: statement
should be inside braces [google-readability-braces-around-statements]
```
Review: https://reviews.apache.org/r/63566
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/02bfc1be
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/02bfc1be
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/02bfc1be
Branch: refs/heads/master
Commit: 02bfc1bef13136f3a8958f191215b2792f8ed02c
Parents: 6fd1399
Author: Michael Park <mp...@apache.org>
Authored: Sun Nov 5 00:07:45 2017 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Mon Nov 6 13:57:04 2017 -0800
----------------------------------------------------------------------
src/examples/docker_no_executor_framework.cpp | 6 ++++--
src/slave/containerizer/containerizer.cpp | 9 +++++----
2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/02bfc1be/src/examples/docker_no_executor_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/docker_no_executor_framework.cpp b/src/examples/docker_no_executor_framework.cpp
index 8e1844e..1fa408d 100644
--- a/src/examples/docker_no_executor_framework.cpp
+++ b/src/examples/docker_no_executor_framework.cpp
@@ -143,11 +143,13 @@ public:
cout << "Task " << taskId << " is in state " << status.state() << endl;
- if (status.state() == TASK_FINISHED)
+ if (status.state() == TASK_FINISHED) {
tasksFinished++;
+ }
- if (tasksFinished == totalTasks)
+ if (tasksFinished == totalTasks) {
driver->stop();
+ }
}
virtual void frameworkMessage(SchedulerDriver* driver,
http://git-wip-us.apache.org/repos/asf/mesos/blob/02bfc1be/src/slave/containerizer/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/containerizer.cpp b/src/slave/containerizer/containerizer.cpp
index 15ae0b3..935dfc9 100644
--- a/src/slave/containerizer/containerizer.cpp
+++ b/src/slave/containerizer/containerizer.cpp
@@ -91,14 +91,15 @@ Try<Resources> Containerizer::resources(const Flags& flags)
bool hasPorts = false;
foreach (const Resource& resource, resourceList) {
- if (resource.name() == "cpus")
+ if (resource.name() == "cpus") {
hasCpus = true;
- else if (resource.name() == "mem")
+ } else if (resource.name() == "mem") {
hasMem = true;
- else if (resource.name() == "disk")
+ } else if (resource.name() == "disk") {
hasDisk = true;
- else if (resource.name() == "ports")
+ } else if (resource.name() == "ports") {
hasPorts = true;
+ }
}
if (!hasCpus) {
[6/7] mesos git commit: MesosTidy: removed redundant `get()` on smart
pointers in mesos.
Posted by mp...@apache.org.
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/authorization_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/authorization_tests.cpp b/src/tests/authorization_tests.cpp
index f65bf2f..f2e86e2 100644
--- a/src/tests/authorization_tests.cpp
+++ b/src/tests/authorization_tests.cpp
@@ -85,7 +85,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsUser)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -99,7 +99,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -113,7 +113,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsUser)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "foo" can run as "root" since the ACLs are permissive.
@@ -129,7 +129,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsUser)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "foo" can run as "root" since the ACLs are permissive.
@@ -144,7 +144,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -158,7 +158,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsUser)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -191,7 +191,7 @@ TYPED_TEST(AuthorizationTest, NoPrincipalRunAsUser)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -205,7 +205,7 @@ TYPED_TEST(AuthorizationTest, NoPrincipalRunAsUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -219,7 +219,7 @@ TYPED_TEST(AuthorizationTest, NoPrincipalRunAsUser)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -252,7 +252,7 @@ TYPED_TEST(AuthorizationTest, PrincipalRunAsAnyUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -265,7 +265,7 @@ TYPED_TEST(AuthorizationTest, PrincipalRunAsAnyUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -298,7 +298,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsAnyUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -311,7 +311,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsAnyUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -324,7 +324,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsAnyUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -337,7 +337,7 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalRunAsAnyUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -380,7 +380,7 @@ TYPED_TEST(AuthorizationTest, OnlySomePrincipalsRunAsSomeUsers)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -392,7 +392,7 @@ TYPED_TEST(AuthorizationTest, OnlySomePrincipalsRunAsSomeUsers)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -404,7 +404,7 @@ TYPED_TEST(AuthorizationTest, OnlySomePrincipalsRunAsSomeUsers)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -416,7 +416,7 @@ TYPED_TEST(AuthorizationTest, OnlySomePrincipalsRunAsSomeUsers)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "baz" cannot run as "user1".
@@ -430,7 +430,7 @@ TYPED_TEST(AuthorizationTest, OnlySomePrincipalsRunAsSomeUsers)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "baz" cannot run as "user2".
@@ -444,7 +444,7 @@ TYPED_TEST(AuthorizationTest, OnlySomePrincipalsRunAsSomeUsers)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -483,7 +483,7 @@ TYPED_TEST(AuthorizationTest, SomePrincipalOnlySomeUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "foo" cannot run as "user2".
@@ -497,7 +497,7 @@ TYPED_TEST(AuthorizationTest, SomePrincipalOnlySomeUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" can run as "user1" and "user2".
@@ -511,7 +511,7 @@ TYPED_TEST(AuthorizationTest, SomePrincipalOnlySomeUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -523,7 +523,7 @@ TYPED_TEST(AuthorizationTest, SomePrincipalOnlySomeUser)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -556,7 +556,7 @@ TYPED_TEST(AuthorizationTest, PrincipalRunAsSomeUserRestrictive)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "foo" cannot run as "user2".
@@ -571,7 +571,7 @@ TYPED_TEST(AuthorizationTest, PrincipalRunAsSomeUserRestrictive)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -585,7 +585,7 @@ TYPED_TEST(AuthorizationTest, PrincipalRunAsSomeUserRestrictive)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -599,7 +599,7 @@ TYPED_TEST(AuthorizationTest, PrincipalRunAsSomeUserRestrictive)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot run as "user2" since no ACL is set.
@@ -615,7 +615,7 @@ TYPED_TEST(AuthorizationTest, PrincipalRunAsSomeUserRestrictive)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -629,7 +629,7 @@ TYPED_TEST(AuthorizationTest, PrincipalRunAsSomeUserRestrictive)
request.mutable_object()->mutable_framework_info()->CopyFrom(frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -643,7 +643,7 @@ TYPED_TEST(AuthorizationTest, PrincipalRunAsSomeUserRestrictive)
request.mutable_object()->mutable_task_info()->CopyFrom(taskInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -670,28 +670,28 @@ TYPED_TEST(AuthorizationTest, AnyPrincipalOfferedRole)
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("foo");
request.mutable_object()->set_value("*");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("foo");
request.mutable_object()->mutable_framework_info()->set_role("*");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("*");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("bar");
request.mutable_object()->mutable_framework_info()->set_role("*");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -720,42 +720,42 @@ TYPED_TEST(AuthorizationTest, SomePrincipalsOfferedRole)
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("foo");
request.mutable_object()->set_value("ads");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("foo");
request.mutable_object()->mutable_framework_info()->set_role("ads");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("ads");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("bar");
request.mutable_object()->mutable_framework_info()->set_role("ads");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("baz");
request.mutable_object()->set_value("ads");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("baz");
request.mutable_object()->mutable_framework_info()->set_role("ads");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -790,14 +790,14 @@ TYPED_TEST(AuthorizationTest, PrincipalOfferedRole)
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("foo");
request.mutable_object()->set_value("analytics");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("foo");
request.mutable_object()->mutable_framework_info()->set_role("analytics");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" cannot be offered "analytics" role's resources.
@@ -806,14 +806,14 @@ TYPED_TEST(AuthorizationTest, PrincipalOfferedRole)
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("analytics");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("bar");
request.mutable_object()->mutable_framework_info()->set_role("analytics");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -841,14 +841,14 @@ TYPED_TEST(AuthorizationTest, PrincipalNotOfferedAnyRoleRestrictive)
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("foo");
request.mutable_object()->set_value("analytics");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("foo");
request.mutable_object()->mutable_framework_info()->set_role("analytics");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" cannot be offered "analytics" role's resources.
@@ -857,14 +857,14 @@ TYPED_TEST(AuthorizationTest, PrincipalNotOfferedAnyRoleRestrictive)
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("analytics");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("bar");
request.mutable_object()->mutable_framework_info()->set_role("analytics");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot be offered "ads" role's resources because no ACL.
@@ -873,14 +873,14 @@ TYPED_TEST(AuthorizationTest, PrincipalNotOfferedAnyRoleRestrictive)
request.set_action(authorization::REGISTER_FRAMEWORK_WITH_ROLE);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("ads");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("bar");
request.mutable_object()->mutable_framework_info()->set_role("ads");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -935,7 +935,7 @@ TYPED_TEST(AuthorizationTest, RegisterFrameworkHierarchical)
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()->mutable_framework_info()->set_role("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -944,7 +944,7 @@ TYPED_TEST(AuthorizationTest, RegisterFrameworkHierarchical)
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()
->mutable_framework_info()->set_role("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -953,7 +953,7 @@ TYPED_TEST(AuthorizationTest, RegisterFrameworkHierarchical)
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()
->mutable_framework_info()->set_role("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `charles` doesn't have permissions for the `king` role, so the first
@@ -964,7 +964,7 @@ TYPED_TEST(AuthorizationTest, RegisterFrameworkHierarchical)
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("charles");
request.mutable_object()->mutable_framework_info()->set_role("king");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -972,7 +972,7 @@ TYPED_TEST(AuthorizationTest, RegisterFrameworkHierarchical)
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("charles");
request.mutable_object()->mutable_framework_info()->set_role("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -981,7 +981,7 @@ TYPED_TEST(AuthorizationTest, RegisterFrameworkHierarchical)
request.mutable_subject()->set_value("charles");
request.mutable_object()
->mutable_framework_info()->set_role("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `j-welby` only has permissions for the role `king` itself, but not
@@ -992,7 +992,7 @@ TYPED_TEST(AuthorizationTest, RegisterFrameworkHierarchical)
request.set_action(authorization::REGISTER_FRAMEWORK);
request.mutable_subject()->set_value("j-welby");
request.mutable_object()->mutable_framework_info()->set_role("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1001,7 +1001,7 @@ TYPED_TEST(AuthorizationTest, RegisterFrameworkHierarchical)
request.mutable_subject()->set_value("j-welby");
request.mutable_object()
->mutable_framework_info()->set_role("king/prince");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -1010,7 +1010,7 @@ TYPED_TEST(AuthorizationTest, RegisterFrameworkHierarchical)
request.mutable_subject()->set_value("j-welby");
request.mutable_object()
->mutable_framework_info()->set_role("king/prince/duke");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -1079,7 +1079,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
request.set_action(authorization::RESERVE_RESOURCES_WITH_ROLE);
request.mutable_subject()->set_value("foo");
request.mutable_object()->set_value("bar");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1090,7 +1090,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("bar");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1098,7 +1098,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
request.set_action(authorization::RESERVE_RESOURCES_WITH_ROLE);
request.mutable_subject()->set_value("foo");
request.mutable_object()->set_value("awesome_role");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1109,14 +1109,14 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("awesome_role");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::RESERVE_RESOURCES_WITH_ROLE);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("awesome_role");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1127,7 +1127,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("awesome_role");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "baz" can only reserve resources for the "ads" role, so request 3
@@ -1137,7 +1137,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
request.set_action(authorization::RESERVE_RESOURCES_WITH_ROLE);
request.mutable_subject()->set_value("baz");
request.mutable_object()->set_value("ads");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1148,7 +1148,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("ads");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1156,7 +1156,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
request.set_action(authorization::RESERVE_RESOURCES_WITH_ROLE);
request.mutable_subject()->set_value("baz");
request.mutable_object()->set_value("awesome_role");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1167,20 +1167,20 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("awesome_role");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::RESERVE_RESOURCES_WITH_ROLE);
request.mutable_subject()->set_value("baz");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::RESERVE_RESOURCES);
request.mutable_subject()->set_value("baz");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "zelda" is not mentioned in the ACLs of the Authorizer, so it
@@ -1191,7 +1191,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
request.set_action(authorization::RESERVE_RESOURCES_WITH_ROLE);
request.mutable_subject()->set_value("zelda");
request.mutable_object()->set_value("ads");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1202,7 +1202,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("ads");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// `elizabeth-ii` has full permissions for the `king` role as well as all
@@ -1217,7 +1217,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1229,7 +1229,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1241,7 +1241,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `charles` doesn't have permissions for the `king` role, so the first
@@ -1256,7 +1256,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("king");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -1268,7 +1268,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1280,7 +1280,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `j-welby` only has permissions for the role `king` itself, but not
@@ -1295,7 +1295,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1307,7 +1307,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("king/prince");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -1319,7 +1319,7 @@ TYPED_TEST(AuthorizationTest, Reserve)
->mutable_reservations()
->Add()
->set_role("king/prince/duke");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -1369,7 +1369,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
request.set_action(authorization::UNRESERVE_RESOURCES_WITH_PRINCIPAL);
request.mutable_subject()->set_value("foo");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1380,7 +1380,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
->mutable_reservations()
->Add()
->set_principal("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" cannot unreserve anyone's
@@ -1390,7 +1390,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
request.set_action(authorization::UNRESERVE_RESOURCES_WITH_PRINCIPAL);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1401,7 +1401,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
->mutable_reservations()
->Add()
->set_principal("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -1409,7 +1409,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
request.set_action(authorization::UNRESERVE_RESOURCES_WITH_PRINCIPAL);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("bar");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1420,7 +1420,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
->mutable_reservations()
->Add()
->set_principal("bar");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can unreserve anyone's resources,
@@ -1430,7 +1430,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
request.set_action(authorization::UNRESERVE_RESOURCES_WITH_PRINCIPAL);
request.mutable_subject()->set_value("ops");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1441,7 +1441,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
->mutable_reservations()
->Add()
->set_principal("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1449,7 +1449,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
request.set_action(authorization::UNRESERVE_RESOURCES_WITH_PRINCIPAL);
request.mutable_subject()->set_value("ops");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1460,14 +1460,14 @@ TYPED_TEST(AuthorizationTest, Unreserve)
->mutable_reservations()
->Add()
->set_principal("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::UNRESERVE_RESOURCES_WITH_PRINCIPAL);
request.mutable_subject()->set_value("ops");
request.mutable_object()->set_value("bar");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1478,14 +1478,14 @@ TYPED_TEST(AuthorizationTest, Unreserve)
->mutable_reservations()
->Add()
->set_principal("bar");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::UNRESERVE_RESOURCES_WITH_PRINCIPAL);
request.mutable_subject()->set_value("ops");
request.mutable_object()->set_value("ops");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1496,7 +1496,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
->mutable_reservations()
->Add()
->set_principal("ops");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "zelda" is not mentioned in the ACLs of the Authorizer, so it
@@ -1507,7 +1507,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
request.set_action(authorization::UNRESERVE_RESOURCES_WITH_PRINCIPAL);
request.mutable_subject()->set_value("zelda");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1518,7 +1518,7 @@ TYPED_TEST(AuthorizationTest, Unreserve)
->mutable_reservations()
->Add()
->set_principal("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -1599,7 +1599,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
request.set_action(authorization::CREATE_VOLUME_WITH_ROLE);
request.mutable_subject()->set_value("foo");
request.mutable_object()->set_value("awesome_role");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1610,7 +1610,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("awesome_role");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can create volumes for the "panda" role,
@@ -1620,7 +1620,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
request.set_action(authorization::CREATE_VOLUME_WITH_ROLE);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("panda");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1631,7 +1631,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("panda");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" cannot create volumes for the "giraffe" role,
@@ -1641,7 +1641,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
request.set_action(authorization::CREATE_VOLUME_WITH_ROLE);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("giraffe");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1652,7 +1652,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("giraffe");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "baz" cannot create volumes for any role,
@@ -1662,7 +1662,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
request.set_action(authorization::CREATE_VOLUME_WITH_ROLE);
request.mutable_subject()->set_value("baz");
request.mutable_object()->set_value("panda");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1673,7 +1673,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("panda");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "zelda" is not mentioned in the ACLs of the Authorizer, so it
@@ -1684,7 +1684,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
request.set_action(authorization::CREATE_VOLUME_WITH_ROLE);
request.mutable_subject()->set_value("zelda");
request.mutable_object()->set_value("panda");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1695,7 +1695,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("panda");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// `elizabeth-ii` has full permissions for the `king` role as well as all
@@ -1710,7 +1710,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1722,7 +1722,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1734,7 +1734,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `charles` doesn't have permissions for the `king` role, so the first
@@ -1749,7 +1749,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("king");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -1761,7 +1761,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1773,7 +1773,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `j-welby` only has permissions for the role `king` itself, but not
@@ -1788,7 +1788,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1800,7 +1800,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("king/prince");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -1812,7 +1812,7 @@ TYPED_TEST(AuthorizationTest, CreateVolume)
->mutable_reservations()
->Add()
->set_role("king/prince/duke");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -1862,7 +1862,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.set_action(authorization::DESTROY_VOLUME_WITH_PRINCIPAL);
request.mutable_subject()->set_value("foo");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1870,7 +1870,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.mutable_subject()->set_value("foo");
request.mutable_object()->mutable_resource()->mutable_disk()
->mutable_persistence()->set_principal("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" cannot destroy anyone's
@@ -1880,7 +1880,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.set_action(authorization::DESTROY_VOLUME_WITH_PRINCIPAL);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1888,7 +1888,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.mutable_subject()->set_value("bar");
request.mutable_object()->mutable_resource()->mutable_disk()
->mutable_persistence()->set_principal("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -1896,7 +1896,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.set_action(authorization::DESTROY_VOLUME_WITH_PRINCIPAL);
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("bar");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1904,7 +1904,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.mutable_subject()->set_value("bar");
request.mutable_object()->mutable_resource()->mutable_disk()
->mutable_persistence()->set_principal("bar");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can destroy anyone's volumes,
@@ -1914,7 +1914,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.set_action(authorization::DESTROY_VOLUME_WITH_PRINCIPAL);
request.mutable_subject()->set_value("ops");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1922,7 +1922,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.mutable_subject()->set_value("ops");
request.mutable_object()->mutable_resource()->mutable_disk()
->mutable_persistence()->set_principal("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -1930,7 +1930,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.set_action(authorization::DESTROY_VOLUME_WITH_PRINCIPAL);
request.mutable_subject()->set_value("ops");
request.mutable_object()->set_value("ops");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1938,14 +1938,14 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.mutable_subject()->set_value("ops");
request.mutable_object()->mutable_resource()->mutable_disk()
->mutable_persistence()->set_principal("ops");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::DESTROY_VOLUME_WITH_PRINCIPAL);
request.mutable_subject()->set_value("ops");
request.mutable_object()->set_value("bar");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1953,7 +1953,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.mutable_subject()->set_value("ops");
request.mutable_object()->mutable_resource()->mutable_disk()
->mutable_persistence()->set_principal("bar");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "zelda" is not mentioned in the ACLs of the Authorizer, so it
@@ -1964,7 +1964,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.set_action(authorization::DESTROY_VOLUME_WITH_PRINCIPAL);
request.mutable_subject()->set_value("zelda");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
authorization::Request request;
@@ -1972,7 +1972,7 @@ TYPED_TEST(AuthorizationTest, DestroyVolume)
request.mutable_subject()->set_value("zelda");
request.mutable_object()->mutable_resource()->mutable_disk()
->mutable_persistence()->set_principal("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -2046,7 +2046,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("foo");
request.mutable_object()->mutable_quota_info()->set_role("prod");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can update quotas for role "dev", so this will pass.
@@ -2055,7 +2055,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("bar");
request.mutable_object()->mutable_quota_info()->set_role("dev");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can only update quotas for role "dev", so this will fail.
@@ -2064,7 +2064,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("bar");
request.mutable_object()->mutable_quota_info()->set_role("prod");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Anyone can update quotas for role "test", so this will pass.
@@ -2072,7 +2072,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
authorization::Request request;
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_object()->mutable_quota_info()->set_role("test");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "jeff" is not mentioned in the ACLs of the `Authorizer`, so it
@@ -2083,7 +2083,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("jeff");
request.mutable_object()->mutable_quota_info()->set_role("prod");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// `elizabeth-ii` has full permissions for the `king` role as well as all
@@ -2094,7 +2094,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()->mutable_quota_info()->set_role("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -2102,7 +2102,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()->mutable_quota_info()->set_role("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -2111,7 +2111,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()
->mutable_quota_info()->set_role("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `charles` doesn't have permissions for the `king` role, so the first
@@ -2122,7 +2122,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("charles");
request.mutable_object()->mutable_quota_info()->set_role("king");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -2130,7 +2130,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("charles");
request.mutable_object()->mutable_quota_info()->set_role("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -2139,7 +2139,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.mutable_subject()->set_value("charles");
request.mutable_object()
->mutable_quota_info()->set_role("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `j-welby` only has permissions for the role `king` itself, but not
@@ -2150,7 +2150,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("j-welby");
request.mutable_object()->mutable_quota_info()->set_role("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -2158,7 +2158,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.set_action(authorization::UPDATE_QUOTA);
request.mutable_subject()->set_value("j-welby");
request.mutable_object()->mutable_quota_info()->set_role("king/prince");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -2167,7 +2167,7 @@ TYPED_TEST(AuthorizationTest, UpdateQuota)
request.mutable_subject()->set_value("j-welby");
request.mutable_object()
->mutable_quota_info()->set_role("king/prince/duke");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -2233,7 +2233,7 @@ TYPED_TEST(AuthorizationTest, ViewFramework)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot view a framework Info running with user "user".
@@ -2244,7 +2244,7 @@ TYPED_TEST(AuthorizationTest, ViewFramework)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can view a frameworkInfo running with user "user".
@@ -2255,7 +2255,7 @@ TYPED_TEST(AuthorizationTest, ViewFramework)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can view a frameworkInfo running with user "bar".
@@ -2266,7 +2266,7 @@ TYPED_TEST(AuthorizationTest, ViewFramework)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -2332,7 +2332,7 @@ TYPED_TEST(AuthorizationTest, ViewContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot view containers running with user "user".
@@ -2343,7 +2343,7 @@ TYPED_TEST(AuthorizationTest, ViewContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can view containers running with user "user".
@@ -2354,7 +2354,7 @@ TYPED_TEST(AuthorizationTest, ViewContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can view containers running with user "bar".
@@ -2365,7 +2365,7 @@ TYPED_TEST(AuthorizationTest, ViewContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -2521,7 +2521,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot view a request with taskInfo and frameworkInfo
@@ -2534,7 +2534,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can view a request with taskInfo and frameworkInfo
@@ -2547,7 +2547,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can view a request with taskInfo and frameworkInfo
@@ -2560,7 +2560,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can view a request with a taskInfo without user
@@ -2573,7 +2573,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" cannot view a request with a taskInfo containing an
@@ -2586,7 +2586,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" can view a request with a taskInfo containing an
@@ -2601,7 +2601,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Checks for the combination Task and FrameworkInfo.
@@ -2616,7 +2616,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot view a request with task and frameworkInfo
@@ -2629,7 +2629,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can view a request with taskInfo and frameworkInfo
@@ -2642,7 +2642,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can view a request with task and frameworkInfo
@@ -2655,7 +2655,7 @@ TYPED_TEST(AuthorizationTest, ViewTask)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -2752,7 +2752,7 @@ TYPED_TEST(AuthorizationTest, ViewExecutor)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot view a request with executorInfo and frameworkInfo
@@ -2765,7 +2765,7 @@ TYPED_TEST(AuthorizationTest, ViewExecutor)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can view a request with executorInfo and frameworkInfo
@@ -2778,7 +2778,7 @@ TYPED_TEST(AuthorizationTest, ViewExecutor)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can view a request with executorInfo and frameworkInfo
@@ -2793,7 +2793,7 @@ TYPED_TEST(AuthorizationTest, ViewExecutor)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can view a request with a executorInfo without user
@@ -2808,7 +2808,7 @@ TYPED_TEST(AuthorizationTest, ViewExecutor)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -2905,7 +2905,7 @@ TYPED_TEST(AuthorizationTest, SandBoxAccess)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot access a sandbox with a request with
@@ -2918,7 +2918,7 @@ TYPED_TEST(AuthorizationTest, SandBoxAccess)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can access a sandbox with a request with
@@ -2931,7 +2931,7 @@ TYPED_TEST(AuthorizationTest, SandBoxAccess)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can access a sandbox with a request with
@@ -2946,7 +2946,7 @@ TYPED_TEST(AuthorizationTest, SandBoxAccess)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can access a sandbox with a request with a
@@ -2962,7 +2962,7 @@ TYPED_TEST(AuthorizationTest, SandBoxAccess)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -3097,7 +3097,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot launch a session with a request with
@@ -3110,7 +3110,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can launch a session with a request with
@@ -3123,7 +3123,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can launch a session with a request with the
@@ -3137,7 +3137,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can launch a session with a request where the
@@ -3152,7 +3152,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can launch a session as user "bar" under parent containers
@@ -3166,7 +3166,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Create CommandInfo with a user not mentioned in the ACLs in
@@ -3203,7 +3203,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
frameworkInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(commandInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot launch a session with a request with
@@ -3219,7 +3219,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
frameworkInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(commandInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot launch a session with a request with
@@ -3234,7 +3234,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
frameworkInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(commandInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can launch a sessions with any combination of requests.
@@ -3248,35 +3248,35 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainerSessions)
executorInfoBar);
request.mutable_object()->mutable_command_info()->MergeFrom(commandInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
request.mutable_object()->mutable_executor_info()->MergeFrom(
executorInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(
commandInfoNoUser);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
request.mutable_object()->mutable_executor_info()->MergeFrom(
executorInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(
commandInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
request.mutable_object()->mutable_executor_info()->MergeFrom(
executorInfoNoUser);
request.mutable_object()->mutable_command_info()->MergeFrom(
commandInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
request.mutable_object()->mutable_executor_info()->MergeFrom(
executorInfoNoUser);
request.mutable_object()->mutable_command_info()->MergeFrom(
commandInfoNoUser);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -3367,7 +3367,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerInput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot attach to the input of a container with a request
@@ -3380,7 +3380,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerInput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can attach to the input of a container with a request with
@@ -3393,7 +3393,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerInput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can attach to the input of a container with a request with
@@ -3407,7 +3407,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerInput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can attach to the input of a container with a request with
@@ -3421,7 +3421,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerInput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -3513,7 +3513,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerOutput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot attach to the output of a container with a request
@@ -3526,7 +3526,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerOutput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can attach to the output of a container with a request with
@@ -3539,7 +3539,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerOutput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can attach to the output of a container with a request with
@@ -3553,7 +3553,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerOutput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can attach to the output of a container with a request with
@@ -3567,7 +3567,7 @@ TYPED_TEST(AuthorizationTest, AttachContainerOutput)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -3701,7 +3701,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot launch a nested container with a request with
@@ -3714,7 +3714,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can launch a nested container with a request with
@@ -3727,7 +3727,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can launch a nested container with a request with the
@@ -3741,7 +3741,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can launch a nested container with a request
@@ -3756,7 +3756,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can launch a nested container as user "bar" under parent
@@ -3770,7 +3770,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Create CommandInfo with a user not mentioned in the ACLs in
@@ -3807,7 +3807,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
frameworkInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(commandInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot launch a nested container with a request with
@@ -3823,7 +3823,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
frameworkInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(commandInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" can launch a nested container with a request with
@@ -3838,7 +3838,7 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
frameworkInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(commandInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can launch nested containers with any combination of
@@ -3853,35 +3853,35 @@ TYPED_TEST(AuthorizationTest, LaunchNestedContainers)
executorInfoBar);
request.mutable_object()->mutable_command_info()->MergeFrom(commandInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
request.mutable_object()->mutable_executor_info()->MergeFrom(
executorInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(
commandInfoNoUser);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
request.mutable_object()->mutable_executor_info()->MergeFrom(
executorInfo);
request.mutable_object()->mutable_command_info()->MergeFrom(
commandInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
request.mutable_object()->mutable_executor_info()->MergeFrom(
executorInfoNoUser);
request.mutable_object()->mutable_command_info()->MergeFrom(
commandInfoBar);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
request.mutable_object()->mutable_executor_info()->MergeFrom(
executorInfoNoUser);
request.mutable_object()->mutable_command_info()->MergeFrom(
commandInfoNoUser);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -3970,7 +3970,7 @@ TYPED_TEST(AuthorizationTest, WaitNestedContainer)
request.mutable_subject()->set_value("foo");
request.mutable_object()->mutable_executor_info()->MergeFrom(executorInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot wait for a nested container with a request
@@ -3983,7 +3983,7 @@ TYPED_TEST(AuthorizationTest, WaitNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can wait for a nested container with a request with
@@ -3996,7 +3996,7 @@ TYPED_TEST(AuthorizationTest, WaitNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can wait for a nested container with a request with
@@ -4010,7 +4010,7 @@ TYPED_TEST(AuthorizationTest, WaitNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can wait for a nested container with a request with
@@ -4024,7 +4024,7 @@ TYPED_TEST(AuthorizationTest, WaitNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -4115,7 +4115,7 @@ TYPED_TEST(AuthorizationTest, KillNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot kill a nested container with a request
@@ -4128,7 +4128,7 @@ TYPED_TEST(AuthorizationTest, KillNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can kill a nested container with a request with
@@ -4141,7 +4141,7 @@ TYPED_TEST(AuthorizationTest, KillNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can kill a nested container with a request with
@@ -4155,7 +4155,7 @@ TYPED_TEST(AuthorizationTest, KillNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can kill a nested container with a request with
@@ -4169,7 +4169,7 @@ TYPED_TEST(AuthorizationTest, KillNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -4257,7 +4257,7 @@ TYPED_TEST(AuthorizationTest, RemoveNestedContainer)
request.mutable_subject()->set_value("foo");
request.mutable_object()->mutable_executor_info()->MergeFrom(executorInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "bar" cannot remove a nested container with a request
@@ -4270,7 +4270,7 @@ TYPED_TEST(AuthorizationTest, RemoveNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Principal "ops" can remove a nested container with a request with
@@ -4283,7 +4283,7 @@ TYPED_TEST(AuthorizationTest, RemoveNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "bar" can remove a nested container with a request with
@@ -4297,7 +4297,7 @@ TYPED_TEST(AuthorizationTest, RemoveNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Principal "ops" can remove nested container with a request with
@@ -4311,7 +4311,7 @@ TYPED_TEST(AuthorizationTest, RemoveNestedContainer)
request.mutable_object()->mutable_framework_info()->MergeFrom(
frameworkInfo);
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
}
@@ -4350,7 +4350,7 @@ TYPED_TEST(AuthorizationTest, OptionalObject)
request.set_action(authorization::TEARDOWN_FRAMEWORK_WITH_PRINCIPAL);
request.mutable_subject()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Check that principal "bar" cannot teardown any framework (i.e., a request
@@ -4360,7 +4360,7 @@ TYPED_TEST(AuthorizationTest, OptionalObject)
request.set_action(authorization::TEARDOWN_FRAMEWORK_WITH_PRINCIPAL);
request.mutable_subject()->set_value("bar");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -4394,14 +4394,14 @@ TYPED_TEST(AuthorizationTest, ViewFlags)
request.set_action(authorization::VIEW_FLAGS);
request.mutable_subject()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::VIEW_FLAGS);
request.mutable_subject()->set_value("bar");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Test that no authorizer is created with invalid flags.
@@ -4447,14 +4447,14 @@ TYPED_TEST(AuthorizationTest, SetLogLevel)
request.set_action(authorization::SET_LOG_LEVEL);
request.mutable_subject()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::SET_LOG_LEVEL);
request.mutable_subject()->set_value("bar");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Test that no authorizer is created with invalid ACLs.
@@ -4581,7 +4581,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Check that principal "bar" cannot see role `foo`.
@@ -4591,7 +4591,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Check that principal "bar" can see role `bar`.
@@ -4601,7 +4601,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("bar");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `elizabeth-ii` has full permissions for the `king` role as well as all
@@ -4612,7 +4612,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()->set_value("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -4620,7 +4620,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()->set_value("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -4628,7 +4628,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()->set_value("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `charles` doesn't have permissions for the `king` role, so the first
@@ -4639,7 +4639,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("charles");
request.mutable_object()->set_value("king");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -4647,7 +4647,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("charles");
request.mutable_object()->set_value("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
@@ -4655,7 +4655,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("charles");
request.mutable_object()->set_value("king/prince/duke");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// `j-welby` only has permissions for the role `king` itself, but not
@@ -4666,14 +4666,14 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("j-welby");
request.mutable_object()->set_value("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
{
authorization::Request request;
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("j-welby");
request.mutable_object()->set_value("king/prince");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
{
@@ -4681,7 +4681,7 @@ TYPED_TEST(AuthorizationTest, ViewRole)
request.set_action(authorization::VIEW_ROLE);
request.mutable_subject()->set_value("j-welby");
request.mutable_object()->set_value("king/prince/duke");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
}
@@ -4748,7 +4748,7 @@ TYPED_TEST(AuthorizationTest, UpdateWeight)
request.set_action(authorization::UPDATE_WEIGHT);
request.mutable_subject()->set_value("foo");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Check that principal "bar" cannot update the weight of role `foo`.
@@ -4758,7 +4758,7 @@ TYPED_TEST(AuthorizationTest, UpdateWeight)
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("foo");
- AWAIT_EXPECT_FALSE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_FALSE(authorizer->authorized(request));
}
// Check that principal "bar" can update the weight of role `bar`.
@@ -4768,7 +4768,7 @@ TYPED_TEST(AuthorizationTest, UpdateWeight)
request.mutable_subject()->set_value("bar");
request.mutable_object()->set_value("bar");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Check that principal "elizabeth-ii" can update the weight of role `king`.
@@ -4777,7 +4777,7 @@ TYPED_TEST(AuthorizationTest, UpdateWeight)
request.set_action(authorization::UPDATE_WEIGHT);
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()->set_value("king");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Check that principal "elizabeth-ii" can update the weight of role
@@ -4787,7 +4787,7 @@ TYPED_TEST(AuthorizationTest, UpdateWeight)
request.set_action(authorization::UPDATE_WEIGHT);
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_object()->set_value("king/prince");
- AWAIT_EXPECT_TRUE(authorizer.get()->authorized(request));
+ AWAIT_EXPECT_TRUE(authorizer->authorized(request));
}
// Check that principal "elizabeth-ii" can update the weight of role
@@ -4797,7 +4797,7 @@ TYPED_TEST(AuthorizationTest, UpdateWeight)
request.set_action(authorization::UPDATE_WEIGHT);
request.mutable_subject()->set_value("elizabeth-ii");
request.mutable_obje
<TRUNCATED>
[7/7] mesos git commit: MesosTidy: removed redundant `get()` on smart
pointers in mesos.
Posted by mp...@apache.org.
MesosTidy: removed redundant `get()` on smart pointers in mesos.
```
3rdparty/libprocess/src/../include/process/owned.hpp:117:7:
warning: redundant get() call on smart pointer
[google-readability-redundant-smartptr-get]
```
Review: https://reviews.apache.org/r/63568
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a94e3cd0
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a94e3cd0
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a94e3cd0
Branch: refs/heads/master
Commit: a94e3cd0fc612a3b68b615368305b256b9064656
Parents: f964e90
Author: Michael Park <mp...@apache.org>
Authored: Mon Nov 6 10:46:05 2017 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Mon Nov 6 13:57:05 2017 -0800
----------------------------------------------------------------------
src/master/http.cpp | 30 +-
src/master/master.cpp | 2 +-
src/slave/http.cpp | 12 +-
src/slave/slave.cpp | 2 +-
src/tests/authorization_tests.cpp | 566 +++++++++----------
src/tests/containerizer/cni_isolator_tests.cpp | 2 +-
.../containerizer/io_switchboard_tests.cpp | 4 +-
.../containerizer/mesos_containerizer_tests.cpp | 4 +-
.../nested_mesos_containerizer_tests.cpp | 2 +-
src/tests/hook_tests.cpp | 8 +-
src/tests/master_tests.cpp | 14 +-
src/tests/partition_tests.cpp | 8 +-
src/tests/reconciliation_tests.cpp | 2 +-
src/tests/slave_recovery_tests.cpp | 12 +-
src/tests/slave_tests.cpp | 16 +-
src/uri/fetchers/hadoop.cpp | 2 +-
16 files changed, 343 insertions(+), 343 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index fa0f60c..1008412 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -320,22 +320,22 @@ struct FullFrameworkWriter {
writer->field("unreachable_tasks", [this](JSON::ArrayWriter* writer) {
foreachvalue (const Owned<Task>& task, framework_->unreachableTasks) {
// Skip unauthorized tasks.
- if (!authorizeTask_->accept(*task.get(), framework_->info)) {
+ if (!authorizeTask_->accept(*task, framework_->info)) {
continue;
}
- writer->element(*task.get());
+ writer->element(*task);
}
});
writer->field("completed_tasks", [this](JSON::ArrayWriter* writer) {
foreach (const Owned<Task>& task, framework_->completedTasks) {
// Skip unauthorized tasks.
- if (!authorizeTask_->accept(*task.get(), framework_->info)) {
+ if (!authorizeTask_->accept(*task, framework_->info)) {
continue;
}
- writer->element(*task.get());
+ writer->element(*task);
}
});
@@ -1744,7 +1744,7 @@ mesos::master::Response::GetFrameworks Master::Http::_getFrameworks(
continue;
}
- getFrameworks.add_completed_frameworks()->CopyFrom(model(*framework.get()));
+ getFrameworks.add_completed_frameworks()->CopyFrom(model(*framework));
}
return getFrameworks;
@@ -3222,13 +3222,13 @@ public:
}
foreachvalue (const Owned<Task>& task, framework->unreachableTasks) {
- frameworkTaskSummaries[frameworkId].count(*task.get());
- slaveTaskSummaries[task->slave_id()].count(*task.get());
+ frameworkTaskSummaries[frameworkId].count(*task);
+ slaveTaskSummaries[task->slave_id()].count(*task);
}
foreach (const Owned<Task>& task, framework->completedTasks) {
- frameworkTaskSummaries[frameworkId].count(*task.get());
- slaveTaskSummaries[task->slave_id()].count(*task.get());
+ frameworkTaskSummaries[frameworkId].count(*task);
+ slaveTaskSummaries[task->slave_id()].count(*task);
}
}
}
@@ -4059,8 +4059,8 @@ Future<Response> Master::Http::tasks(
const Owned<Task>& task,
framework->unreachableTasks) {
// Skip unauthorized tasks or tasks without matching task ID.
- if (!selectTaskId.accept(task.get()->task_id()) ||
- !authorizeTask->accept(*task.get(), framework->info)) {
+ if (!selectTaskId.accept(task->task_id()) ||
+ !authorizeTask->accept(*task, framework->info)) {
continue;
}
@@ -4069,8 +4069,8 @@ Future<Response> Master::Http::tasks(
foreach (const Owned<Task>& task, framework->completedTasks) {
// Skip unauthorized tasks or tasks without matching task ID.
- if (!selectTaskId.accept(task.get()->task_id()) ||
- !authorizeTask->accept(*task.get(), framework->info)) {
+ if (!selectTaskId.accept(task->task_id()) ||
+ !authorizeTask->accept(*task, framework->info)) {
continue;
}
@@ -4207,7 +4207,7 @@ mesos::master::Response::GetTasks Master::Http::_getTasks(
// Unreachable tasks.
foreachvalue (const Owned<Task>& task, framework->unreachableTasks) {
// Skip unauthorized tasks.
- if (!approveViewTask(tasksApprover, *task.get(), framework->info)) {
+ if (!approveViewTask(tasksApprover, *task, framework->info)) {
continue;
}
@@ -4217,7 +4217,7 @@ mesos::master::Response::GetTasks Master::Http::_getTasks(
// Completed tasks.
foreach (const Owned<Task>& task, framework->completedTasks) {
// Skip unauthorized tasks.
- if (!approveViewTask(tasksApprover, *task.get(), framework->info)) {
+ if (!approveViewTask(tasksApprover, *task, framework->info)) {
continue;
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index f349fec..9ac1861 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -8748,7 +8748,7 @@ void Master::removeFramework(Framework* framework)
CHECK(!slaves.registered.contains(task->slave_id()));
// Move task from unreachable map to completed map.
- framework->addCompletedTask(*task.get());
+ framework->addCompletedTask(*task);
framework->unreachableTasks.erase(taskId);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/slave/http.cpp
----------------------------------------------------------------------
diff --git a/src/slave/http.cpp b/src/slave/http.cpp
index f2e06af..cfae997 100644
--- a/src/slave/http.cpp
+++ b/src/slave/http.cpp
@@ -2361,7 +2361,7 @@ Future<Response> Http::_launchNestedContainer(
Framework* framework = slave->getFramework(executor->frameworkId);
CHECK_NOTNULL(framework);
- Try<bool> approved = approver.get()->approved(
+ Try<bool> approved = approver->approved(
ObjectApprover::Object(
executor->info,
framework->info,
@@ -2479,7 +2479,7 @@ Future<Response> Http::waitNestedContainer(
Framework* framework = slave->getFramework(executor->frameworkId);
CHECK_NOTNULL(framework);
- Try<bool> approved = waitApprover.get()->approved(
+ Try<bool> approved = waitApprover->approved(
ObjectApprover::Object(
executor->info,
framework->info,
@@ -2576,7 +2576,7 @@ Future<Response> Http::killNestedContainer(
Framework* framework = slave->getFramework(executor->frameworkId);
CHECK_NOTNULL(framework);
- Try<bool> approved = killApprover.get()->approved(
+ Try<bool> approved = killApprover->approved(
ObjectApprover::Object(
executor->info,
framework->info,
@@ -2635,7 +2635,7 @@ Future<Response> Http::removeNestedContainer(
Framework* framework = slave->getFramework(executor->frameworkId);
CHECK_NOTNULL(framework);
- Try<bool> approved = removeApprover.get()->approved(
+ Try<bool> approved = removeApprover->approved(
ObjectApprover::Object(
executor->info,
framework->info,
@@ -2775,7 +2775,7 @@ Future<Response> Http::attachContainerInput(
Framework* framework = slave->getFramework(executor->frameworkId);
CHECK_NOTNULL(framework);
- Try<bool> approved = attachInputApprover.get()->approved(
+ Try<bool> approved = attachInputApprover->approved(
ObjectApprover::Object(executor->info, framework->info));
if (approved.isError()) {
@@ -3087,7 +3087,7 @@ Future<Response> Http::attachContainerOutput(
Framework* framework = slave->getFramework(executor->frameworkId);
CHECK_NOTNULL(framework);
- Try<bool> approved = attachOutputApprover.get()->approved(
+ Try<bool> approved = attachOutputApprover->approved(
ObjectApprover::Object(
executor->info,
framework->info,
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 79ee163..6cbe209 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -6890,7 +6890,7 @@ Future<bool> Slave::authorizeSandboxAccess(
}
}
- Try<bool> approved = sandboxApprover.get()->approved(object);
+ Try<bool> approved = sandboxApprover->approved(object);
if (approved.isError()) {
return Failure(approved.error());
[4/7] mesos git commit: MesosTidy: Removed redundant `get()` on smart
pointers in libprocess.
Posted by mp...@apache.org.
MesosTidy: Removed redundant `get()` on smart pointers in libprocess.
```
3rdparty/libprocess/src/../include/process/owned.hpp:117:7:
warning: redundant get() call on smart pointer
[google-readability-redundant-smartptr-get]
```
Review: https://reviews.apache.org/r/63567
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f964e909
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f964e909
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f964e909
Branch: refs/heads/master
Commit: f964e909ecd9e9c2c1b38129028b05a8f29470fe
Parents: f9776cc
Author: Michael Park <mp...@apache.org>
Authored: Sun Nov 5 00:42:25 2017 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Mon Nov 6 13:57:05 2017 -0800
----------------------------------------------------------------------
3rdparty/libprocess/include/process/owned.hpp | 6 +++---
3rdparty/libprocess/include/process/shared.hpp | 4 ++--
3rdparty/libprocess/src/tests/owned_tests.cpp | 6 ------
3rdparty/libprocess/src/tests/shared_tests.cpp | 3 ---
4 files changed, 5 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/f964e909/3rdparty/libprocess/include/process/owned.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/owned.hpp b/3rdparty/libprocess/include/process/owned.hpp
index e1ae6dc..cc149e7 100644
--- a/3rdparty/libprocess/include/process/owned.hpp
+++ b/3rdparty/libprocess/include/process/owned.hpp
@@ -114,7 +114,7 @@ T* Owned<T>::operator->() const
template <typename T>
T* Owned<T>::get() const
{
- if (data.get() == nullptr) {
+ if (data == nullptr) {
return nullptr;
} else {
// Static cast to avoid ambiguity in Visual Studio compiler.
@@ -154,7 +154,7 @@ void Owned<T>::swap(Owned<T>& that)
template <typename T>
Shared<T> Owned<T>::share()
{
- if (data.get() == nullptr) {
+ if (data == nullptr) {
// The ownership of this pointer has already been lost.
return Shared<T>(nullptr);
}
@@ -174,7 +174,7 @@ Shared<T> Owned<T>::share()
template <typename T>
T* Owned<T>::release()
{
- if (data.get() == nullptr) {
+ if (data == nullptr) {
// The ownership of this pointer has already been lost.
return nullptr;
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/f964e909/3rdparty/libprocess/include/process/shared.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/shared.hpp b/3rdparty/libprocess/include/process/shared.hpp
index d58c885..6eb6943 100644
--- a/3rdparty/libprocess/include/process/shared.hpp
+++ b/3rdparty/libprocess/include/process/shared.hpp
@@ -115,7 +115,7 @@ const T* Shared<T>::operator->() const
template <typename T>
const T* Shared<T>::get() const
{
- if (data.get() == nullptr) {
+ if (data == nullptr) {
return nullptr;
} else {
return data->t;
@@ -162,7 +162,7 @@ Future<Owned<T>> Shared<T>::own()
// of them is a write, the behavior is undefined. This is similar to
// boost::shared_ptr. For more details, please refer to the boost
// shared_ptr document (section "Thread Safety").
- if (data.get() == nullptr) {
+ if (data == nullptr) {
return Owned<T>(nullptr);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/f964e909/3rdparty/libprocess/src/tests/owned_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/owned_tests.cpp b/3rdparty/libprocess/src/tests/owned_tests.cpp
index f9f4cce..f829693 100644
--- a/3rdparty/libprocess/src/tests/owned_tests.cpp
+++ b/3rdparty/libprocess/src/tests/owned_tests.cpp
@@ -39,13 +39,11 @@ TEST(OwnedTest, Access)
EXPECT_EQ(42, owned->get());
EXPECT_EQ(42, (*owned).get());
- EXPECT_EQ(42, owned.get()->get());
owned->set(10);
EXPECT_EQ(10, owned->get());
EXPECT_EQ(10, (*owned).get());
- EXPECT_EQ(10, owned.get()->get());
}
@@ -68,7 +66,6 @@ TEST(OwnedTest, Share)
EXPECT_EQ(42, owned->get());
EXPECT_EQ(42, (*owned).get());
- EXPECT_EQ(42, owned.get()->get());
Shared<Foo> shared = owned.share();
@@ -77,14 +74,12 @@ TEST(OwnedTest, Share)
EXPECT_EQ(42, shared->get());
EXPECT_EQ(42, (*shared).get());
- EXPECT_EQ(42, shared.get()->get());
{
Shared<Foo> shared2(shared);
EXPECT_EQ(42, shared2->get());
EXPECT_EQ(42, (*shared2).get());
- EXPECT_EQ(42, shared2.get()->get());
EXPECT_FALSE(shared.unique());
EXPECT_FALSE(shared2.unique());
}
@@ -102,7 +97,6 @@ TEST(OwnedTest, Release)
EXPECT_EQ(42, owned->get());
EXPECT_EQ(42, (*owned).get());
- EXPECT_EQ(42, owned.get()->get());
Foo* raw = owned.release();
EXPECT_EQ(nullptr, owned.get());
http://git-wip-us.apache.org/repos/asf/mesos/blob/f964e909/3rdparty/libprocess/src/tests/shared_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/shared_tests.cpp b/3rdparty/libprocess/src/tests/shared_tests.cpp
index 2a2ffe7..9bb291e 100644
--- a/3rdparty/libprocess/src/tests/shared_tests.cpp
+++ b/3rdparty/libprocess/src/tests/shared_tests.cpp
@@ -87,7 +87,6 @@ TEST(SharedTest, Own)
EXPECT_EQ(42, shared->get());
EXPECT_EQ(42, (*shared).get());
- EXPECT_EQ(42, shared.get()->get());
EXPECT_TRUE(shared.unique());
Future<Owned<Foo>> future;
@@ -97,7 +96,6 @@ TEST(SharedTest, Own)
EXPECT_EQ(42, shared2->get());
EXPECT_EQ(42, (*shared2).get());
- EXPECT_EQ(42, shared2.get()->get());
EXPECT_FALSE(shared2.unique());
EXPECT_FALSE(shared.unique());
@@ -119,5 +117,4 @@ TEST(SharedTest, Own)
Owned<Foo> owned = future.get();
EXPECT_EQ(42, owned->get());
EXPECT_EQ(42, (*owned).get());
- EXPECT_EQ(42, owned.get()->get());
}
[5/7] mesos git commit: MesosTidy: removed redundant `get()` on smart
pointers in mesos.
Posted by mp...@apache.org.
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/containerizer/cni_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/cni_isolator_tests.cpp b/src/tests/containerizer/cni_isolator_tests.cpp
index 0d68dd6..9718091 100644
--- a/src/tests/containerizer/cni_isolator_tests.cpp
+++ b/src/tests/containerizer/cni_isolator_tests.cpp
@@ -368,7 +368,7 @@ TEST_F(CniIsolatorTest, ROOT_VerifyCheckpointedInfo)
EXPECT_EQ(task.task_id(), statusRunning->task_id());
EXPECT_EQ(TASK_RUNNING, statusRunning->state());
- Future<hashset<ContainerID>> containers = containerizer.get()->containers();
+ Future<hashset<ContainerID>> containers = containerizer->containers();
AWAIT_READY(containers);
ASSERT_EQ(1u, containers->size());
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/containerizer/io_switchboard_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/io_switchboard_tests.cpp b/src/tests/containerizer/io_switchboard_tests.cpp
index c3410cd..0828119 100644
--- a/src/tests/containerizer/io_switchboard_tests.cpp
+++ b/src/tests/containerizer/io_switchboard_tests.cpp
@@ -1013,7 +1013,7 @@ TEST_F(IOSwitchboardTest, DISABLED_RecoverThenKillSwitchboardContainerDestroyed)
EXPECT_EQ(TASK_RUNNING, statusRunning->state());
// Kill the io switchboard for the task.
- Future<hashset<ContainerID>> containers = containerizer.get()->containers();
+ Future<hashset<ContainerID>> containers = containerizer->containers();
AWAIT_READY(containers);
ASSERT_EQ(1u, containers->size());
@@ -1126,7 +1126,7 @@ TEST_F(IOSwitchboardTest, ContainerAttachAfterSlaveRestart)
// Wait until containerizer is recovered.
AWAIT_READY(_recover);
- Future<hashset<ContainerID>> containers = containerizer.get()->containers();
+ Future<hashset<ContainerID>> containers = containerizer->containers();
AWAIT_READY(containers);
ASSERT_EQ(1u, containers->size());
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/containerizer/mesos_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/mesos_containerizer_tests.cpp b/src/tests/containerizer/mesos_containerizer_tests.cpp
index e61a85d..ef42415 100644
--- a/src/tests/containerizer/mesos_containerizer_tests.cpp
+++ b/src/tests/containerizer/mesos_containerizer_tests.cpp
@@ -1253,10 +1253,10 @@ TEST_F(MesosContainerizerRecoverTest, SkipRecoverNonMesosContainers)
frameworkId.set_value(UUID::random().toString());
slaveState.frameworks.put(frameworkId, frameworkState);
- Future<Nothing> recover = containerizer.get()->recover(slaveState);
+ Future<Nothing> recover = containerizer->recover(slaveState);
AWAIT_READY(recover);
- Future<hashset<ContainerID>> containers = containerizer.get()->containers();
+ Future<hashset<ContainerID>> containers = containerizer->containers();
AWAIT_READY(containers);
EXPECT_TRUE(containers->empty());
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/containerizer/nested_mesos_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/nested_mesos_containerizer_tests.cpp b/src/tests/containerizer/nested_mesos_containerizer_tests.cpp
index fbd2887..3e2a2d1 100644
--- a/src/tests/containerizer/nested_mesos_containerizer_tests.cpp
+++ b/src/tests/containerizer/nested_mesos_containerizer_tests.cpp
@@ -1190,7 +1190,7 @@ TEST_F(NestedMesosContainerizerTest,
state = slaveState.get();
AWAIT_READY(containerizer->recover(state));
- Future<hashset<ContainerID>> containers = containerizer.get()->containers();
+ Future<hashset<ContainerID>> containers = containerizer->containers();
AWAIT_READY(containers);
EXPECT_EQ(2u, containers->size());
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/hook_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hook_tests.cpp b/src/tests/hook_tests.cpp
index 5428782..dc8d87f 100644
--- a/src/tests/hook_tests.cpp
+++ b/src/tests/hook_tests.cpp
@@ -736,13 +736,13 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
EXPECT_SOME(termination.get());
Future<list<Docker::Container>> containers =
- docker.get()->ps(true, slave::DOCKER_NAME_PREFIX);
+ docker->ps(true, slave::DOCKER_NAME_PREFIX);
AWAIT_READY(containers);
// Cleanup all mesos launched containers.
foreach (const Docker::Container& container, containers.get()) {
- AWAIT_READY_FOR(docker.get()->rm(container.id, true), Seconds(30));
+ AWAIT_READY_FOR(docker->rm(container.id, true), Seconds(30));
}
}
@@ -957,13 +957,13 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
EXPECT_SOME(termination.get());
Future<list<Docker::Container>> containers =
- docker.get()->ps(true, slave::DOCKER_NAME_PREFIX);
+ docker->ps(true, slave::DOCKER_NAME_PREFIX);
AWAIT_READY(containers);
// Cleanup all mesos launched containers.
foreach (const Docker::Container& container, containers.get()) {
- AWAIT_READY_FOR(docker.get()->rm(container.id, true), Seconds(30));
+ AWAIT_READY_FOR(docker->rm(container.id, true), Seconds(30));
}
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 7f4a807..9c450b9 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -655,7 +655,7 @@ TEST_F(MasterTest, EndpointsForHalfRemovedSlave)
// should be the operation that marks the slave as unreachable.
Future<Owned<master::Operation>> unreachable;
Promise<bool> promise;
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&unreachable),
Return(promise.future())));
@@ -3199,7 +3199,7 @@ TEST_F(MasterTest, RecoveredSlaveReregisterThenUnreachableRace)
Future<Owned<master::Operation>> reregister;
Promise<bool> reregisterContinue;
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&reregister),
Return(reregisterContinue.future())));
@@ -3219,7 +3219,7 @@ TEST_F(MasterTest, RecoveredSlaveReregisterThenUnreachableRace)
// expire. Because slave reregistration has already started, we do
// NOT expect the master to mark the slave unreachable. Hence we
// don't expect to see any registry operations.
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
Clock::pause();
@@ -7950,7 +7950,7 @@ TEST_F(MasterTest, AgentDomainMismatch)
// If the agent is allowed to register, the master will update the
// registry. The agent should not be allowed to register, so we
// expect that no registrar operations will be observed.
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
Owned<MasterDetector> detector = master.get()->createDetector();
@@ -8006,7 +8006,7 @@ TEST_F(MasterTest, AgentDomainMismatchOnReregister)
// If the agent is allowed to re-register, the master will update
// the registry. The agent should not be allowed to register, so we
// expect that no registrar operations will be observed.
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
// Simulate a new master detected event.
@@ -8047,7 +8047,7 @@ TEST_F(MasterTest, IgnoreOldAgentRegistration)
// The master should ignore the agent's registration attempt. Hence,
// we do not expect the master to try to update the registry.
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
process::post(slave.get()->pid, master.get()->pid, message);
@@ -8098,7 +8098,7 @@ TEST_F(MasterTest, IgnoreOldAgentReregistration)
// The master should ignore the agent's re-registration attempt, so
// we do not expect the master to try to update the registry.
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
process::post(slave.get()->pid, master.get()->pid, message);
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/partition_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/partition_tests.cpp b/src/tests/partition_tests.cpp
index eead9ce..e49c474 100644
--- a/src/tests/partition_tests.cpp
+++ b/src/tests/partition_tests.cpp
@@ -3223,7 +3223,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(PartitionTest, RegistryGcRace)
// intercept the registry operation.
Future<Owned<master::Operation>> markReachable;
Promise<bool> markReachableContinue;
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&markReachable),
Return(markReachableContinue.future())));
@@ -3243,7 +3243,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(PartitionTest, RegistryGcRace)
// force the race condition with the reregistration of `slave2`.
Future<Owned<master::Operation>> prune;
Promise<bool> pruneContinue;
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&prune),
Return(pruneContinue.future())));
@@ -3406,7 +3406,7 @@ TEST_F(PartitionTest, FailHealthChecksTwice)
Future<Owned<master::Operation>> markUnreachable;
Promise<bool> markUnreachableContinue;
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&markUnreachable),
Return(markUnreachableContinue.future())));
@@ -3427,7 +3427,7 @@ TEST_F(PartitionTest, FailHealthChecksTwice)
Future<Nothing> unreachableDispatch2 =
FUTURE_DISPATCH(master.get()->pid, &Master::markUnreachable);
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
Clock::advance(masterFlags.agent_ping_timeout);
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/reconciliation_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/reconciliation_tests.cpp b/src/tests/reconciliation_tests.cpp
index 671417f..8c43ffd 100644
--- a/src/tests/reconciliation_tests.cpp
+++ b/src/tests/reconciliation_tests.cpp
@@ -652,7 +652,7 @@ TEST_F(ReconciliationTest, RemovalInProgress)
Future<Owned<master::Operation>> unregister;
Future<Nothing> unregisterStarted;
Promise<bool> promise; // Never satisfied.
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&unregister),
Return(promise.future())));
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/slave_recovery_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp
index db337ba..64bba04 100644
--- a/src/tests/slave_recovery_tests.cpp
+++ b/src/tests/slave_recovery_tests.cpp
@@ -2209,14 +2209,14 @@ TYPED_TEST(SlaveRecoveryTest, RemoveNonCheckpointingFramework)
// Destroy all the containers before we destroy the containerizer. We need to
// do this manually because there are no slaves left in the cluster.
- Future<hashset<ContainerID>> containers = containerizer.get()->containers();
+ Future<hashset<ContainerID>> containers = containerizer->containers();
AWAIT_READY(containers);
foreach (const ContainerID& containerId, containers.get()) {
Future<Option<ContainerTermination>> wait =
- containerizer.get()->wait(containerId);
+ containerizer->wait(containerId);
- containerizer.get()->destroy(containerId);
+ containerizer->destroy(containerId);
AWAIT_READY(wait);
EXPECT_SOME(wait.get());
@@ -3415,14 +3415,14 @@ TYPED_TEST(SlaveRecoveryTest, RegisterDisconnectedSlave)
// Destroy all the containers before we destroy the containerizer. We need to
// do this manually because there are no slaves left in the cluster.
- Future<hashset<ContainerID>> containers = containerizer.get()->containers();
+ Future<hashset<ContainerID>> containers = containerizer->containers();
AWAIT_READY(containers);
foreach (const ContainerID& containerId, containers.get()) {
Future<Option<ContainerTermination>> wait =
- containerizer.get()->wait(containerId);
+ containerizer->wait(containerId);
- containerizer.get()->destroy(containerId);
+ containerizer->destroy(containerId);
AWAIT_READY(wait);
EXPECT_SOME(wait.get());
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 9c2db7a..f9c2e6b 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -3607,7 +3607,7 @@ TEST_F(SlaveTest, HealthCheckUnregisterRace)
// master's `markUnreachable` method directly. We expect the master
// to ignore this message; in particular, the master should not
// attempt to update the registry to mark the slave unreachable.
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
process::dispatch(master.get()->pid,
@@ -3670,7 +3670,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
// Now set the expectation when the agent is one ping timeout away
// from being deemed unreachable.
Future<Owned<master::Operation>> markUnreachable;
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&markUnreachable),
Invoke(master.get()->registrar.get(),
&MockRegistrar::unmocked_apply)));
@@ -3697,7 +3697,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
FUTURE_PROTOBUF(SlaveReregisteredMessage(), master.get()->pid, _);
Future<Owned<master::Operation>> markReachable;
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&markReachable),
Invoke(master.get()->registrar.get(),
&MockRegistrar::unmocked_apply)));
@@ -3747,7 +3747,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
// There should be no registrar operation across both agent termination
// and reregistration.
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
slave.get()->terminate();
@@ -3837,7 +3837,7 @@ TEST_F(SlaveTest, UnreachableThenUnregisterRace)
// attempting to mark the slave unreachable.
Future<Owned<master::Operation>> markUnreachable;
Promise<bool> markUnreachableContinue;
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&markUnreachable),
Return(markUnreachableContinue.future())));
@@ -3860,7 +3860,7 @@ TEST_F(SlaveTest, UnreachableThenUnregisterRace)
slave.get()->pid,
master.get()->pid);
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
slave.get()->shutdown();
@@ -3940,7 +3940,7 @@ TEST_F(SlaveTest, UnregisterThenUnreachableRace)
// attempt to remove the slave from the registry.
Future<Owned<master::Operation>> removeSlave;
Promise<bool> removeSlaveContinue;
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.WillOnce(DoAll(FutureArg<0>(&removeSlave),
Return(removeSlaveContinue.future())));
@@ -3973,7 +3973,7 @@ TEST_F(SlaveTest, UnregisterThenUnreachableRace)
Future<Nothing> unreachableDispatch =
FUTURE_DISPATCH(master.get()->pid, &Master::markUnreachable);
- EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+ EXPECT_CALL(*master.get()->registrar, apply(_))
.Times(0);
Clock::advance(masterFlags.agent_ping_timeout);
http://git-wip-us.apache.org/repos/asf/mesos/blob/a94e3cd0/src/uri/fetchers/hadoop.cpp
----------------------------------------------------------------------
diff --git a/src/uri/fetchers/hadoop.cpp b/src/uri/fetchers/hadoop.cpp
index 2fa5b02..1c861e8 100644
--- a/src/uri/fetchers/hadoop.cpp
+++ b/src/uri/fetchers/hadoop.cpp
@@ -99,7 +99,7 @@ Future<Nothing> HadoopFetcherPlugin::fetch(
// configuration file.
//
// TODO(jieyu): Allow user to specify the name of the output file.
- return hdfs.get()->copyToLocal(
+ return hdfs->copyToLocal(
(uri.has_host() ? stringify(uri) : uri.path()),
path::join(directory, Path(uri.path()).basename()));
}