MCPcopy Create free account
hub / github.com/apache/mesos / TEST_F_TEMP_DISABLED_ON_WINDOWS

Function TEST_F_TEMP_DISABLED_ON_WINDOWS

src/tests/fetcher_tests.cpp:384–418  ·  view source on GitHub ↗

Negative test: invalid user name. Copied from FileTest, so this normally would succeed, but here a bogus user name is specified. So we check for fetch failure. This won't work on Windows because file ownership and permissions support isn't implemented, see MESOS-3176.

Source from the content-addressed store, hash-verified

382// This won't work on Windows because file ownership and permissions
383// support isn't implemented, see MESOS-3176.
384TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, InvalidUser)
385{
386 string fromDir = path::join(os::getcwd(), "from");
387 ASSERT_SOME(os::mkdir(fromDir));
388 string testFile = path::join(fromDir, "test");
389 EXPECT_SOME(os::write(testFile, "data"));
390
391 string localFile = path::join(os::getcwd(), "test");
392 EXPECT_FALSE(os::exists(localFile));
393
394 slave::Flags flags = CreateSlaveFlags();
395
396 ContainerID containerId;
397 containerId.set_value(id::UUID::random().toString());
398
399 CommandInfo commandInfo;
400 commandInfo.set_user(id::UUID::random().toString());
401
402 CommandInfo::URI* uri = commandInfo.add_uris();
403 uri->set_value(uri::from_path(testFile));
404
405 Fetcher fetcher(flags);
406
407 Future<Nothing> fetch = fetcher.fetch(
408 containerId, commandInfo, os::getcwd(), None());
409 AWAIT_FAILED(fetch);
410
411 // See FetcherProcess::fetch(), the message must mention "chown" in
412 // this case.
413 EXPECT_TRUE(strings::contains(fetch.failure(), "chown"));
414
415 EXPECT_FALSE(os::exists(localFile));
416
417 verifyMetrics(0, 1);
418}
419
420
421// Negative test: URI leading to non-existing file. Copied from FileTest,

Callers

nothing calls this directly

Calls 15

randomFunction · 0.85
from_pathFunction · 0.85
NoneClass · 0.85
PathClass · 0.85
permissionsFunction · 0.85
failureMethod · 0.80
fetchMethod · 0.65
joinFunction · 0.50
getcwdFunction · 0.50
mkdirFunction · 0.50
writeFunction · 0.50
existsFunction · 0.50

Tested by

no test coverage detected