def tearDownClass(cls):
     socat.stop_socat(conf_file=TMP_CONF_FILE)
     cls.node = model.CNode(cls.conf)
     cls.node.init()
     cls.node.terminate_workspace()
     if os.path.exists(TMP_CONF_FILE):
         os.unlink(TMP_CONF_FILE)
 def tearDownClass(cls):
     cls.channel.close()
     cls.ssh.close()
     run_command('ipmi-console stop', True, subprocess.PIPE, subprocess.PIPE)
     qemu.stop_qemu()
     ipmi.stop_ipmi()
     socat.stop_socat()
Example #3
0
def test_socat_process_stop():
    try:
        socat.stop_socat(conf_file=tmp_conf_file)
        socat.status_socat()
        assert False
    except:
        assert True
Example #4
0
 def tearDownClass(cls):
     socat.stop_socat(conf_file=TMP_CONF_FILE)
     cls.node = model.CNode(cls.conf)
     cls.node.init()
     cls.node.terminate_workspace()
     if os.path.exists(TMP_CONF_FILE):
         os.unlink(TMP_CONF_FILE)
def test_socat_process_stop():
     try:
         socat.stop_socat()
         socat.status_socat()
         assert False
     except:
         assert True
def test_socat_process_stop():
     try:
         socat.stop_socat()
         socat.status_socat()
         assert False
     except:
         assert True
 def tearDownClass(cls):
     socat.stop_socat("test.yml")
     with open("test.yml", 'r') as f_yml:
         conf = yaml.load(f_yml)
     cls.node = model.CNode(conf)
     cls.node.init()
     cls.node.terminate_workspace()
     os.system("rm test.yml")
 def tearDownClass(cls):
     cls.channel.close()
     cls.ssh.close()
     run_command('ipmi-console stop', True, subprocess.PIPE, subprocess.PIPE)
     qemu.stop_qemu()
     ipmi.stop_ipmi()
     socat.stop_socat()
     os.system("rm -rf {}/.infrasim/node-0/".format(os.environ["HOME"]))
Example #9
0
 def tearDownClass(cls):
     cls.channel.close()
     cls.ssh.close()
     run_command('ipmi-console stop', True, subprocess.PIPE,
                 subprocess.PIPE)
     qemu.stop_qemu()
     ipmi.stop_ipmi()
     socat.stop_socat()
     os.system("rm -rf {}/.infrasim/node-0/".format(os.environ["HOME"]))
Example #10
0
    def tearDown(self):
        socat.stop_socat(conf_file=self.TMP_CONF_FILE)

        if os.path.exists(self.TMP_CONF_FILE):
            os.unlink(self.TMP_CONF_FILE)

        workspace = os.path.join(config.infrasim_home, self.conf['name'])
        if workspace and os.path.exists(workspace):
            shutil.rmtree(workspace)

        self.conf = None
    def tearDown(self):
        socat.stop_socat(conf_file=self.TMP_CONF_FILE)

        if os.path.exists(self.TMP_CONF_FILE):
            os.unlink(self.TMP_CONF_FILE)

        workspace = os.path.join(config.infrasim_home, self.conf['name'])
        if workspace and os.path.exists(workspace):
            shutil.rmtree(workspace)

        self.conf = None
Example #12
0
    def test_socat_create_serial_device_file(self):
        target_device = "./pty_serial"
        if os.path.isfile(target_device) or os.path.islink(target_device):
            os.system("rm {}".format(target_device))

        # Start socat and device shall be created
        self.conf["sol_device"] = target_device
        with open("test.yml", "w") as yaml_file:
            yaml.dump(self.conf, yaml_file, default_flow_style=False)
        socat.start_socat("test.yml")

        if os.path.islink(target_device):
            assert True
        else:
            assert False

        # Remove socat and device shall be collected
        socat.stop_socat()
        if os.path.isfile(target_device) or os.path.islink(target_device):
            assert False
        else:
            assert True
    def test_socat_create_serial_device_file(self):
        target_device = "./pty_serial"
        if os.path.isfile(target_device) or os.path.islink(target_device):
            os.system("rm {}".format(target_device))

        # Start socat and device shall be created
        self.conf["sol_device"] = target_device
        with open("test.yml", "w") as yaml_file:
            yaml.dump(self.conf, yaml_file, default_flow_style=False)
        socat.start_socat("test.yml")

        if os.path.islink(target_device):
            assert True
        else:
            assert False

        # Remove socat and device shall be collected
        socat.stop_socat()
        if os.path.isfile(target_device) or os.path.islink(target_device):
            assert False
        else:
            assert True
Example #14
0
    def test_socat_create_serial_device_file(self):
        target_device = "/tmp/pty_serial"
        if os.path.isfile(target_device) or os.path.islink(target_device):
            os.unlink(target_device)

        # Start socat and device shall be created
        self.conf["sol_device"] = target_device
        with open(self.TMP_CONF_FILE, "w") as yaml_file:
            yaml.dump(self.conf, yaml_file, default_flow_style=False)

        socat.start_socat(conf_file=self.TMP_CONF_FILE)

        if os.path.islink(target_device):
            assert True
        else:
            assert False

        # Remove socat and device shall be collected
        socat.stop_socat()
        if os.path.isfile(target_device) or os.path.islink(target_device):
            assert False
        else:
            assert True
    def test_socat_create_serial_device_file(self):
        target_device = "/tmp/pty_serial"
        if os.path.isfile(target_device) or os.path.islink(target_device):
            os.unlink(target_device)

        # Start socat and device shall be created
        self.conf["sol_device"] = target_device
        with open(self.TMP_CONF_FILE, "w") as yaml_file:
            yaml.dump(self.conf, yaml_file, default_flow_style=False)

        socat.start_socat(conf_file=self.TMP_CONF_FILE)

        if os.path.islink(target_device):
            assert True
        else:
            assert False

        # Remove socat and device shall be collected
        socat.stop_socat()
        if os.path.isfile(target_device) or os.path.islink(target_device):
            assert False
        else:
            assert True
Example #16
0
 def setUpClass(cls):
     socat.stop_socat()
 def tearDown(self):
     self.conf = None
     socat.stop_socat()
     os.system("rm -rf {}/.infrasim/node-0/".format(os.environ["HOME"]))
     os.system("rm -rf test.yml")
 def tearDown(self):
     qemu.stop_qemu()
     ipmi.stop_ipmi()
     socat.stop_socat()
 def tearDownClass(cls):
     qemu.stop_qemu()
     ipmi.stop_ipmi()
     socat.stop_socat()
 def setUpClass(cls):
     socat.stop_socat()
Example #21
0
 def tearDown(self):
     self.conf = None
     socat.stop_socat()
     os.system("rm -rf {}/.infrasim/node-0/".format(os.environ["HOME"]))
     os.system("rm -rf test.yml")