def test_delete_key_old_way(env):
# if pytest.config.getoption('--ci'):
# pytest.skip('does not work in CI environments')
from django_remote_submission.wrapper.remote import RemoteWrapper
wrapper = RemoteWrapper(
hostname=env.server_hostname,
username=env.remote_user,
port=env.server_port,
)
public_key_filename = os.path.expanduser('~/.ssh/id_rsa.pub')
# Connect with password drop the key
with wrapper.connect(env.remote_password, public_key_filename):
wrapper.deploy_key_if_it_does_not_exist()
# Connect without password
with wrapper.connect():
pass
# delete the they
with wrapper.connect(env.remote_password):
wrapper.delete_key()
评论列表
文章目录