test_tasks.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:django-remote-submission 作者: ornl-ndav 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号