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

Function TEST_F

src/tests/disk_quota_tests.cpp:84–98  ·  view source on GitHub ↗

This test verifies the usage of a file.

Source from the content-addressed store, hash-verified

82
83// This test verifies the usage of a file.
84TEST_F(DiskUsageCollectorTest, File)
85{
86 // Create a file and write 8K bytes.
87 string path = path::join(os::getcwd(), "file");
88 ASSERT_SOME(os::write(path, string(Kilobytes(8).bytes(), 'x')));
89
90 DiskUsageCollector collector(Milliseconds(1));
91
92 Future<Bytes> usage = collector.usage(path, {});
93 AWAIT_READY(usage);
94
95 // NOTE: A typical file system needs more disk space to keep meta
96 // data. So the check here is not a strict equal-to check.
97 EXPECT_GE(usage.get(), Kilobytes(8));
98}
99
100
101// This test verifies the usage of a directory.

Callers

nothing calls this directly

Calls 15

KilobytesFunction · 0.85
MillisecondsClass · 0.85
createPersistentVolumeFunction · 0.85
MegabytesFunction · 0.85
NoneClass · 0.85
createDetectorMethod · 0.80
principalMethod · 0.80
createTaskFunction · 0.70
CREATEFunction · 0.70
LAUNCHFunction · 0.70
startMethod · 0.65
acceptOffersMethod · 0.65

Tested by

no test coverage detected