You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2018/02/09 01:40:39 UTC
[3/8] mesos git commit: Updated disk profile tests due to changes in
the module interface.
Updated disk profile tests due to changes in the module interface.
Review: https://reviews.apache.org/r/65554/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/845ab9c7
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/845ab9c7
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/845ab9c7
Branch: refs/heads/1.5.x
Commit: 845ab9c70ddb79d626eea1e7a3f47514a1b1c378
Parents: 87b91a1
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
Authored: Thu Feb 8 14:41:20 2018 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu Feb 8 17:36:05 2018 -0800
----------------------------------------------------------------------
src/tests/disk_profile_tests.cpp | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/845ab9c7/src/tests/disk_profile_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/disk_profile_tests.cpp b/src/tests/disk_profile_tests.cpp
index b6b35ef..d75765e 100644
--- a/src/tests/disk_profile_tests.cpp
+++ b/src/tests/disk_profile_tests.cpp
@@ -299,7 +299,10 @@ TEST_F(UriDiskProfileTest, FetchFromFile)
const string profileName = "profile";
const string profileFile = path::join(sandbox.get(), "profiles.json");
const Duration pollInterval = Seconds(10);
- const string csiPluginType = "ignored";
+
+ ResourceProviderInfo resourceProviderInfo;
+ resourceProviderInfo.set_type("ignored");
+ resourceProviderInfo.set_name("ignored");
Parameters params;
@@ -328,7 +331,7 @@ TEST_F(UriDiskProfileTest, FetchFromFile)
// because when the module reads from file, it does so immediately upon
// being initialized.
Future<hashset<string>> future =
- module.get()->watch(hashset<string>::EMPTY, csiPluginType);
+ module.get()->watch(hashset<string>::EMPTY, resourceProviderInfo);
// Write the single profile to the file.
ASSERT_SOME(os::write(profileFile, contents));
@@ -342,7 +345,7 @@ TEST_F(UriDiskProfileTest, FetchFromFile)
// Translate the profile name into the profile mapping.
Future<DiskProfileAdaptor::ProfileInfo> mapping =
- module.get()->translate(profileName, csiPluginType);
+ module.get()->translate(profileName, resourceProviderInfo);
AWAIT_ASSERT_READY(mapping);
ASSERT_TRUE(mapping.get().capability.has_block());
@@ -438,7 +441,10 @@ TEST_F(UriDiskProfileTest, FetchFromHTTP)
})~";
const Duration pollInterval = Seconds(10);
- const string csiPluginType = "ignored";
+
+ ResourceProviderInfo resourceProviderInfo;
+ resourceProviderInfo.set_type("ignored");
+ resourceProviderInfo.set_name("ignored");
ServerWrapper server;
@@ -476,14 +482,14 @@ TEST_F(UriDiskProfileTest, FetchFromHTTP)
// Wait for the first HTTP poll to complete.
Future<hashset<string>> future =
- module.get()->watch(hashset<string>::EMPTY, csiPluginType);
+ module.get()->watch(hashset<string>::EMPTY, resourceProviderInfo);
AWAIT_ASSERT_READY(future);
ASSERT_EQ(1u, future->size());
EXPECT_EQ("profile", *(future->begin()));
// Start watching for an update to the list of profiles.
- future = module.get()->watch({"profile"}, csiPluginType);
+ future = module.get()->watch({"profile"}, resourceProviderInfo);
// Trigger the second HTTP poll.
Clock::advance(pollInterval);
@@ -491,7 +497,7 @@ TEST_F(UriDiskProfileTest, FetchFromHTTP)
// Dispatch a call to the module, which ensures that the polling has actually
// completed (not just the HTTP call).
- AWAIT_ASSERT_READY(module.get()->translate("profile", csiPluginType));
+ AWAIT_ASSERT_READY(module.get()->translate("profile", resourceProviderInfo));
// We don't expect the module to notify watcher(s) because the server's
// response is considered invalid (the module does not allow profiles