| 581 | } |
| 582 | |
| 583 | void 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 | |
| 609 | void add_rm_dep_test() |
| 610 | { |
nothing calls this directly
no test coverage detected