MCPcopy Create free account
hub / github.com/apache/impala / exec

Function exec

be/src/util/webserver-test.cc:77–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75};
76
77string exec(const char* cmd) {
78 std::array<char, 1024> buffer;
79 string result;
80 unique_ptr<FILE> pipe(popen(cmd, "r"));
81 if (!pipe) {
82 throw std::runtime_error(Substitute("popen() failed with $0", errno));
83 }
84 while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
85 result += buffer.data();
86 }
87 return result;
88}
89
90TEST(Webserver, SmokeTest) {
91 MetricGroup metrics("webserver-test");

Callers 2

TESTFunction · 0.85
curl_status_codeFunction · 0.85

Calls 4

SubstituteFunction · 0.85
getMethod · 0.65
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected