Ejemplo n.º 1
0
 def setUpClass(cls):
     socat.start_socat()
     ipmi.start_ipmi()
     run_command('ipmi-console start &', True, None, None)
     time.sleep(5)
     cls.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
     cls.ssh.connect('127.0.0.1', username='', password='', port=9300)
     cls.channel = cls.ssh.invoke_shell()
Ejemplo n.º 2
0
def test_socat_process_start():
    try:
        socat.start_socat(conf_file=tmp_conf_file)
        time.sleep(2)
        socat.status_socat()
        assert True
    except:
        assert False
 def setUpClass(cls):
     socat.start_socat()
     ipmi.start_ipmi()
     run_command('ipmi-console start &', True, None, None)
     time.sleep(5)
     cls.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
     cls.ssh.connect('127.0.0.1', username='', password='', port=9300)
     cls.channel = cls.ssh.invoke_shell()
Ejemplo n.º 4
0
def test_socat_process_start():
     try:
         socat.start_socat()
         ipmi.start_ipmi("quanta_d51")
         time.sleep(3)
         socat.status_socat()
         assert True
     except:
         assert False
Ejemplo n.º 5
0
    def setUpClass(cls):
        fake_config = fixtures.FakeConfig()
        cls.conf = fake_config.get_node_info()
        cls.WORKSPACE = "{}/{}".format(config.infrasim_home, cls.conf['name'])
        with open(TMP_CONF_FILE, 'w') as f_yml:
            yaml.dump(cls.conf, f_yml, default_flow_style=False)

        cls.node = model.CNode(cls.conf)
        cls.node.set_node_name(cls.conf['name'])
        socat.start_socat(conf_file=TMP_CONF_FILE)
Ejemplo n.º 6
0
    def setUpClass(cls):
        fake_config = fixtures.FakeConfig()
        cls.conf = fake_config.get_node_info()
        cls.WORKSPACE = "{}/{}".format(config.infrasim_home, cls.conf["name"])
        with open(TMP_CONF_FILE, "w") as f_yml:
            yaml.dump(cls.conf, f_yml, default_flow_style=False)

        cls.node = model.CNode(cls.conf)
        cls.node.set_node_name(cls.conf["name"])
        socat.start_socat(conf_file=TMP_CONF_FILE)
Ejemplo n.º 7
0
    def setUpClass(cls):
        with open(VM_DEFAULT_CONFIG, 'r') as f_yml:
            conf = yaml.load(f_yml)
        conf["name"] = ".test"
        with open("test.yml", 'w') as f_yml:
            yaml.dump(conf, f_yml, default_flow_style=False)

        cls.node = model.CNode(conf)
        cls.node.set_node_name(".test")
        cls.node.init_workspace()
        socat.start_socat("test.yml")
Ejemplo n.º 8
0
    def test_socat_create_serial_device_file(self):
        if os.path.isfile(self.target_device) or os.path.islink(self.target_device):
            os.unlink(self.target_device)

        # Start socat and device shall be created
        self.conf["sol_device"] = self.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(self.target_device):
            assert True
        else:
            assert False
Ejemplo n.º 9
0
    def test_socat_create_serial_device_file(self):
        if os.path.isfile(self.target_device) or os.path.islink(
                self.target_device):
            os.unlink(self.target_device)

        # Start socat and device shall be created
        self.conf["sol_device"] = self.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(self.target_device):
            assert True
        else:
            assert False
Ejemplo n.º 10
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
Ejemplo n.º 11
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 setUpClass(cls):
     socat.start_socat()
     ipmi.start_ipmi("quanta_d51")
     time.sleep(3)
Ejemplo n.º 13
0
 def setUp(self):
     socat.start_socat()
     ipmi.start_ipmi("quanta_d51")
     time.sleep(3)