This test verifies that the root filesystem of the container is properly changed to the one that's provisioned by the provisioner.
| 103 | // This test verifies that the root filesystem of the container is |
| 104 | // properly changed to the one that's provisioned by the provisioner. |
| 105 | TEST_F(LinuxFilesystemIsolatorTest, ROOT_ChangeRootFilesystem) |
| 106 | { |
| 107 | AWAIT_READY(DockerArchive::create(GetRegistryPath(), "test_image")); |
| 108 | |
| 109 | slave::Flags flags = CreateSlaveFlags(); |
| 110 | |
| 111 | Fetcher fetcher(flags); |
| 112 | |
| 113 | Try<MesosContainerizer*> create = |
| 114 | MesosContainerizer::create(flags, true, &fetcher); |
| 115 | |
| 116 | ASSERT_SOME(create); |
| 117 | |
| 118 | Owned<Containerizer> containerizer(create.get()); |
| 119 | |
| 120 | ContainerID containerId; |
| 121 | containerId.set_value(id::UUID::random().toString()); |
| 122 | |
| 123 | ExecutorInfo executor = createExecutorInfo( |
| 124 | "test_executor", |
| 125 | "[ ! -d '" + sandbox.get() + "' ]"); |
| 126 | |
| 127 | executor.mutable_container()->CopyFrom(createContainerInfo("test_image")); |
| 128 | |
| 129 | string directory = path::join(flags.work_dir, "sandbox"); |
| 130 | ASSERT_SOME(os::mkdir(directory)); |
| 131 | |
| 132 | Future<Containerizer::LaunchResult> launch = containerizer->launch( |
| 133 | containerId, |
| 134 | createContainerConfig(None(), executor, directory), |
| 135 | map<string, string>(), |
| 136 | None()); |
| 137 | |
| 138 | AWAIT_ASSERT_EQ(Containerizer::LaunchResult::SUCCESS, launch); |
| 139 | |
| 140 | Future<Option<ContainerTermination>> wait = containerizer->wait(containerId); |
| 141 | |
| 142 | AWAIT_READY(wait); |
| 143 | ASSERT_SOME(wait.get()); |
| 144 | ASSERT_TRUE(wait->get().has_status()); |
| 145 | EXPECT_WEXITSTATUS_EQ(0, wait->get().status()); |
| 146 | } |
| 147 | |
| 148 | |
| 149 | // This test verifies that pseudo devices like /dev/random are properly mounted |
nothing calls this directly
no test coverage detected