• Home
  • Raw
  • Download

Lines Matching refs:cmd

28 std::string GetCmdResultFromPopen(const std::string& cmd);
38 int GetCmdLinesFromPopen(const std::string& cmd) in GetCmdLinesFromPopen() argument
40 if (cmd.empty()) { in GetCmdLinesFromPopen()
43 FILE* fp = popen(cmd.c_str(), "r"); in GetCmdLinesFromPopen()
61 std::string GetCmdResultFromPopen(const std::string& cmd) in GetCmdResultFromPopen() argument
63 if (cmd.empty()) { in GetCmdResultFromPopen()
66 FILE* fp = popen(cmd.c_str(), "r"); in GetCmdResultFromPopen()
85 bool IsExistInCmdResult(const std::string &cmd, const std::string &str) in IsExistInCmdResult() argument
87 if (cmd.empty()) { in IsExistInCmdResult()
90 FILE* fp = popen(cmd.c_str(), "r"); in IsExistInCmdResult()
142 std::string cmd = ""; variable
144 cmd = prefix + it.first;
145 EXPECT_TRUE(IsExistInCmdResult(cmd, it.second));
150 cmd = prefix + it.first;
151 EXPECT_TRUE(IsExistInCmdResult(cmd, it.second));
168 std::string cmd = "hilog -b " + level; variable
171 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
175 cmd = "hilog -b test_level 2>&1";
177 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
194 std::string cmd = "hilog -b " + level + " -D " + Uint2HexStr(domain); variable
197 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
200 cmd = "hilog -D test_domain 2>&1";
202 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
219 std::string cmd = "hilog -b " + level + " -T " + tag; variable
222 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
225 cmd = "hilog -T abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 2>&1";
227 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
246 std::string cmd = "hilog -G 512K"; variable
250 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
252 cmd = "hilog -G 512G";
254 EXPECT_TRUE(IsExistInCmdResult(cmd, str));
272 std::string cmd = "hilog -g"; variable
276 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
292 std::string cmd = "hilog -k on"; variable
295 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
298 cmd = "hilog -k off";
300 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
303 cmd = "hilog -k test_feature 2>&1";
305 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
321 std::string cmd = "hilog -p on"; variable
324 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
327 cmd = "hilog -p off";
329 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
332 cmd = "hilog -p test_feature 2>&1";
334 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
352 std::string cmd = "hilog -Q pidon"; variable
355 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
358 cmd = "hilog -Q pidoff";
360 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
363 cmd = "hilog -Q domainon";
366 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
369 cmd = "hilog -Q domainoff";
371 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
374 cmd = "hilog -Q test_cmd 2>&1";
376 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
393 std::string cmd = "hilog -a " + std::to_string(lines); variable
394 EXPECT_EQ(GetCmdLinesFromPopen(cmd), lines);
396 cmd = "hilog -z " + std::to_string(lines);
397 EXPECT_EQ(GetCmdLinesFromPopen(cmd), lines);
399 cmd = "hilog -a test 2>&1";
401 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
403 cmd = "hilog -z test 2>&1";
404 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
406 cmd = "hilog -a 10 -z 10 2>&1";
408 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
430 std::string cmd = "hilog -r"; variable
432 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
461 std::string cmd = "hilog -r -t app"; variable
463 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
465 cmd = "hilog -r -t core";
467 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
469 cmd = "hilog -r -t test_type 2>&1";
471 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
494 std::string cmd = "hilog -w start"; variable
496 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
498 cmd = "hilog -w stop";
500 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
508 cmd = "hilog -w start -f " + filename + " -l " + std::to_string(length) + unit
511 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
513 cmd = "hilog -w query";
516 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
518 cmd = "hilog -w test 2>&1";
520 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
524 cmd = "hilog -w query -f " + filename + " 2>&1";
526 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
528 cmd = "hilog -w query -j test 2>&1";
530 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
532 cmd = "hilog -w query -l test 2>&1";
534 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
536 cmd = "hilog -w query -n test 2>&1";
538 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
553 std::string cmd = "hilog -x -e "; variable
555 std::string res = GetCmdResultFromPopen(cmd + regex);
564 cmd = "hilog -x -e abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
568 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
583 std::string cmd = "hilog -a 10 -L "; variable
585 std::string res = GetCmdResultFromPopen(cmd + level);
593 cmd = "hilog -L test_level 2>&1";
595 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
597 cmd = "hilog -L E F 2>&1";
599 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
601 cmd = "hilog -L E -L F 2>&1";
603 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
618 std::string cmd = "hilog -a 10 -P "; variable
619 std::string res = GetCmdResultFromPopen(cmd + pid);
629 cmd = "hilog -P test 2>&1";
631 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
653 std::string cmd = "hilog -s"; variable
655 EXPECT_TRUE(IsExistInCmdResult(cmd, str));
663 EXPECT_TRUE(IsExistInCmdResult(cmd, str));
667 cmd = "hilog -S";
669 EXPECT_EQ(GetCmdResultFromPopen(cmd), str);
691 std::string cmd = "hilog -v time -z 5"; variable
694 std::string res = GetCmdResultFromPopen(cmd);
701 cmd = "hilog -v epoch -z 5";
703 res = GetCmdResultFromPopen(cmd);
709 cmd = "hilog -v monotonic -z 5";
711 res = GetCmdResultFromPopen(cmd);
723 cmd = "hilog -v msec -z 5";
726 res = GetCmdResultFromPopen(cmd);
732 cmd = "hilog -v usec -z 5";
735 res = GetCmdResultFromPopen(cmd);
741 cmd = "hilog -v nsec -z 5";
744 res = GetCmdResultFromPopen(cmd);
750 cmd = "hilog -v year -z 5";
753 res = GetCmdResultFromPopen(cmd);
759 cmd = "hilog -v zone -z 5";
764 res = GetCmdResultFromPopen(cmd);
770 cmd = "hilog -v test 2>&1";
772 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
774 cmd = "hilog -v time -v epoch 2>&1";
776 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
778 cmd = "hilog -v msec -v usec 2>&1";
780 EXPECT_EQ(GetCmdResultFromPopen(cmd), errMsg);
782 cmd = "hilog -x -v color";
783 EXPECT_GT(GetCmdLinesFromPopen(cmd), 0);