Commit 64251957 authored by gejun's avatar gejun

Show output of curl if some cases in test/brpc_server_unittest.cpp fail

parent 4c39a496
...@@ -1283,10 +1283,17 @@ TEST_F(ServerTest, too_big_message) { ...@@ -1283,10 +1283,17 @@ TEST_F(ServerTest, too_big_message) {
server.Join(); server.Join();
} }
struct EchoCurlMsg {};
inline std::ostream& operator<<(std::ostream& os, EchoCurlMsg) {
std::ifstream t("curl.msg");
return os << "============ The output of previous curl ============\n"
<< t.rdbuf()
<< "\n============ The output ends here ============\n";
}
void CheckCert(const char* address, const char* cert) { void CheckCert(const char* address, const char* cert) {
std::string cmd = butil::string_printf( std::string cmd = butil::string_printf(
"/usr/bin/curl -Ikv https://%s 2>&1 | grep %s", address, cert); "/usr/bin/curl -Ikv https://%s >curl.msg 2>&1; grep %s curl.msg", address, cert);
ASSERT_EQ(0, system(cmd.c_str())); ASSERT_EQ(0, system(cmd.c_str())) << EchoCurlMsg();
} }
std::string GetRawPemString(const char* fname) { std::string GetRawPemString(const char* fname) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment