Helper function to deserialize the response from the `/api/v1` agent endpoint as a V1 response protobuf.
| 132 | // Helper function to deserialize the response from the `/api/v1` agent |
| 133 | // endpoint as a V1 response protobuf. |
| 134 | Future<v1::agent::Response> deserialize( |
| 135 | const Future<http::Response>& response) |
| 136 | { |
| 137 | ContentType contentType = std::get<2>(GetParam()); |
| 138 | |
| 139 | return response |
| 140 | .then([contentType](const http::Response& response) |
| 141 | -> Future<v1::agent::Response> { |
| 142 | if (response.status != http::OK().status) { |
| 143 | return Failure( |
| 144 | "Unexpected response status: " + response.status + |
| 145 | ": " + response.body); |
| 146 | } |
| 147 | |
| 148 | return mesos::internal::deserialize<v1::agent::Response>( |
| 149 | contentType, response.body); |
| 150 | }); |
| 151 | } |
| 152 | |
| 153 | // Helper function to launch a top level container based on the first |
| 154 | // test parameter: |