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

Method SetUp

src/tests/persistent_volume_tests.cpp:111–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109{
110protected:
111 void SetUp() override
112 {
113 MesosTest::SetUp();
114
115 Try<string> path = environment->mkdtemp();
116 ASSERT_SOME(path) << "Failed to mkdtemp";
117
118 diskPath = path.get();
119
120 if (GetParam() == MOUNT) {
121 // On linux we mount a `tmpfs`.
122#ifdef __linux__
123 for (size_t i = 1; i <= NUM_DISKS; ++i) {
124 string disk = path::join(diskPath, "disk" + stringify(i));
125 ASSERT_SOME(os::mkdir(disk));
126 ASSERT_SOME(fs::mount(None(), disk, "tmpfs", 0, "size=10M"));
127 }
128#else // __linux__
129 // Otherwise we need to create 2 directories to mock the 2 devices.
130 for (size_t i = 1; i <= NUM_DISKS; ++i) {
131 string disk = path::join(diskPath, "disk" + stringify(i));
132 ASSERT_SOME(os::mkdir(disk));
133 }
134#endif // __linux__
135 }
136 }
137
138 void TearDown() override
139 {

Callers

nothing calls this directly

Calls 7

NoneClass · 0.85
mkdtempMethod · 0.80
joinFunction · 0.50
stringifyFunction · 0.50
mkdirFunction · 0.50
mountFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected