mock_command("dialog", {"*": ("", "0")}, host)
# mock git pull
mock_command_passthrough("git", {"pull": ("", "0")}, host)
+ # mock PID 1 to pretend to be systemd
+ mock_command_2(
+ "ps",
+ {
+ "-p 1": ("systemd", "0"),
+ },
+ host,
+ )
# mock systemctl to not start FTL
mock_command_2(
"systemctl",
"enable pihole-FTL": ("", "0"),
"restart pihole-FTL": ("", "0"),
"start pihole-FTL": ("", "0"),
+ "stop pihole-FTL": ("", "0"),
"*": ('echo "systemctl call with $@"', "0"),
},
host,
check_macvendor = test_cmd.format("r", "/etc/pihole/macvendor.db", piholeuser)
actual_rc = host.run(check_macvendor).rc
assert exit_status_success == actual_rc
- # check readable and executable /etc/init.d/pihole-FTL
- check_init = test_cmd.format("x", "/etc/init.d/pihole-FTL", piholeuser)
- actual_rc = host.run(check_init).rc
- assert exit_status_success == actual_rc
- check_init = test_cmd.format("r", "/etc/init.d/pihole-FTL", piholeuser)
- actual_rc = host.run(check_init).rc
- assert exit_status_success == actual_rc
# check readable and executable manpages
if maninstalled is True:
check_man = test_cmd.format("x", "/usr/local/share/man", piholeuser)