Example #1
0
 def setUp(self):
     self.ssh_address = '1.2.3.4'
     self.host_address = '5.6.7.8'
     self.bind_address = '9.10.11.12'
     self.current_user = getuser()
     self.host_port = get_available_port()
     self.bind_port = get_available_port()
     self.default_open_kwargs = dict(
         ssh_user=self.current_user, ssh_address=self.ssh_address,
         host_address=self.host_address, bind_address=self.bind_address,
         host_port=self.host_port, bind_port=self.bind_port,
         ssh_path=dummy_ssh_cmd,
     )
Example #2
0
 def setUp(self):
     self.ssh_address = '1.2.3.4'
     self.host_address = '5.6.7.8'
     self.bind_address = '9.10.11.12'
     self.current_user = getuser()
     self.host_port = get_available_port()
     self.bind_port = get_available_port()
     self.default_open_kwargs = dict(
         ssh_user=self.current_user,
         ssh_address=self.ssh_address,
         host_address=self.host_address,
         bind_address=self.bind_address,
         host_port=self.host_port,
         bind_port=self.bind_port,
         ssh_path=dummy_ssh_cmd,
     )
Example #3
0
def test_create_tunnel():
    ssh_address = '1.2.3.4'
    host_address = '5.6.7.8'
    bind_address = '9.10.11.12'
    current_user = getuser()
    host_port = get_available_port()
    bind_port = get_available_port()
    t = bgtunnel.open(ssh_user=current_user, ssh_address=ssh_address,
                      host_address=host_address, bind_address=bind_address,
                      host_port=host_port, bind_port=bind_port,
                      ssh_path=dummy_ssh_cmd)

    assert t.ssh_user == current_user
    assert t.host_port == host_port
    assert t.bind_port == bind_port
    assert t.ssh_address == ssh_address
    assert t.host_address == host_address
    assert t.bind_address == bind_address