scp_ssh.py 文件源码

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

项目:avocado-misc-tests 作者: avocado-framework-tests 项目源码 文件源码
def setUp(self):
        '''
        To check and install dependencies for the test
        '''
        smm = SoftwareManager()
        pkgs = ["net-tools"]
        detected_distro = distro.detect()
        if detected_distro.name == "Ubuntu":
            pkgs.extend(["openssh-client", "iputils-ping"])
        elif detected_distro.name == "SuSE":
            pkgs.extend(["openssh", "iputils"])
        else:
            pkgs.extend(["openssh-clients", "iputils"])
        for pkg in pkgs:
            if not smm.check_installed(pkg) and not smm.install(pkg):
                self.cancel("%s package is need to test" % pkg)
        interfaces = netifaces.interfaces()
        self.iface = self.params.get("interface")
        if self.iface not in interfaces:
            self.cancel("%s interface is not available" % self.iface)
        self.peer = self.params.get("peer_ip", default="")
        if self.peer == "":
            self.cancel("peer ip should specify in input")
        self.user = self.params.get("user_name", default="root")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号