MCPcopy Create free account
hub / github.com/davmac314/dinit / no_command_error_test

Function no_command_error_test

src/igr-tests/igr-runner.cc:583–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581}
582
583void no_command_error_test()
584{
585 // Check that a service without a command configured causes the appropriate error.
586
587 igr_test_setup setup("no-command-error");
588 std::string socket_path = setup.prep_socket_path();
589
590 std::string sd_dir = setup.get_output_dir() + "/sd";
591
592 std::vector<std::string> dinit_args {"-u", "-d", "sd", "-p", socket_path};
593
594#if SUPPORT_CGROUPS
595 // If cgroups support, supply dummy cgroup base path to avoid "unable to determine cgroup" message
596 dinit_args.push_back("-b");
597 dinit_args.push_back("/");
598#endif
599
600 dinit_args.push_back("no-command");
601
602 dinit_proc dinit_p;
603 dinit_p.start("no-command-error", dinit_args);
604 dinit_p.wait_for_term({1, 0} /* max 1 second */);
605
606 igr_assert_eq(read_file_contents(igr_input_basedir + "/no-command-error/dinit-run.expected"), dinit_p.get_stdout());
607}
608
609void add_rm_dep_test()
610{

Callers

nothing calls this directly

Calls 7

igr_assert_eqFunction · 0.85
prep_socket_pathMethod · 0.80
push_backMethod · 0.80
wait_for_termMethod · 0.80
get_stdoutMethod · 0.80
read_file_contentsFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected