예제 #1
0
def test_build_ssh_with_key(fake_key):
    """Ensure the fake ssh key (fixture) is used with -i in the ssh cmd."""

    runner = Bladerunner({"ssh_key": fake_key, "debug": 3})
    cmd = runner._build_ssh_command("somewhere", "bob", 66)
    assert cmd == "ssh -p 66 -t -i {0} -vvv bob@somewhere".format(fake_key)
예제 #2
0
def test_build_ssh_with_key(fake_key):
    """Ensure the fake ssh key (fixture) is used with -i in the ssh cmd."""

    runner = Bladerunner({"ssh_key": fake_key, "debug": 3})
    cmd = runner._build_ssh_command("somewhere", "bob", 66)
    assert cmd == "ssh -p 66 -t -i {0} -vvv bob@somewhere".format(fake_key)
예제 #3
0
def test_build_ssh_commands():
    """Ensure we are building the ssh connect command correctly."""

    runner = Bladerunner({"debug": -1})  # should be invalid/ignored
    cmd = runner._build_ssh_command("nowhere", "joe", 44)
    assert cmd == "ssh -p 44 -t joe@nowhere"
예제 #4
0
def test_build_ssh_commands():
    """Ensure we are building the ssh connect command correctly."""

    runner = Bladerunner({"debug": -1})  # should be invalid/ignored
    cmd = runner._build_ssh_command("nowhere", "joe", 44)
    assert cmd == "ssh -p 44 -t joe@nowhere"