MCPcopy Create free account
hub / github.com/ceph/ceph / TEST

Function TEST

src/test/run_cmd.cc:9–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include <unistd.h>
8
9TEST(RunCommand, StringSimple)
10{
11 char temp_file_name[] = "run_cmd_temp_file_XXXXXX";
12
13 int fd = ::mkstemp(temp_file_name);
14 ASSERT_GE(fd, 0);
15 ::close(fd);
16
17 std::string ret = run_cmd("touch", temp_file_name, (char*)NULL);
18 ASSERT_EQ(ret, "");
19
20 ASSERT_EQ(access(temp_file_name, R_OK), 0);
21
22 ret = run_cmd("rm", "-f", temp_file_name, (char*)NULL);
23 ASSERT_EQ(ret, "");
24
25 ASSERT_NE(access(temp_file_name, R_OK), 0);
26}

Callers

nothing calls this directly

Calls 2

accessClass · 0.85
run_cmdFunction · 0.50

Tested by

no test coverage detected