Example #1
0
    def restart_fscd(self):
        if running_systemd():
            run_shell_cmd("/bin/systemctl restart fscd")
        else:
            run_shell_cmd("sv restart fscd")

        time.sleep(20)
Example #2
0
    def set_start_watchdog_daemon_cmd(self):
        if running_systemd():
            supervisor = "/bin/systemctl"
        else:
            supervisor = "/usr/bin/sv"

        self.start_watchdog_daemon_cmd = ["{} start fscd".format(supervisor)]
Example #3
0
    def setUp(self):
        if running_systemd():
            self.syslog_restart_command = SYSTEMD_RESTART_COMMAND
        else:
            self.syslog_restart_command = SYSV_RESTART_COMMAND

        self._ensure_rsyslog_working()
Example #4
0
 def test_psumuxmon_runit_sv_status(self):
     if running_systemd():
         cmd = ["/bin/systemctl status psumuxmon"]
         data = run_shell_cmd(cmd)
         self.assertIn("running", data, "psumuxmon unit not running")
     else:
         cmd = ["/usr/bin/sv status psumuxmon"]
         data = run_shell_cmd(cmd)
         self.assertIn("run", data, "psumuxmon process not running")
Example #5
0
 def set_processes(self):
     self.expected_process = [
         "spatula_wrapper.py",
         "fscd",
         "psumuxmon",
         "rackmond",
         "rest.py",
         "mTerm_server",
     ]
     if not running_systemd():
         self.expected_process.extend(
             ["/var/run/dhclient.eth0.pid", "/var/run/dhclient6.eth0.pid"])
Example #6
0
    def setUp(self):
        Logger.start(name=self._testMethodName)
        if running_systemd():
            Logger.info("Running the systemd variant")
            self.kill_fan_ctrl_cmd = [
                "/bin/systemctl stop fscd",
                "/usr/local/bin/wdtcli stop",
            ]
            self.start_fan_ctrl_cmd = ["/bin/systemctl start fscd"]
        else:
            self.kill_fan_ctrl_cmd = [
                "/usr/bin/sv stop fscd",
                "/usr/local/bin/wdtcli stop",
            ]
            self.start_fan_ctrl_cmd = ["/usr/bin/sv start fscd"]

        self.read_fans_cmd = "/usr/local/bin/get_fan_speed.sh"
        self.write_fans_cmd = "/usr/local/bin/set_fan_speed.sh"