def __call__(self, vmi, *args, **kwargs): os = registry.lookup([], ios.IOSystem, vmi.cfg.interface_os) ver = registry.lookup([], ios.IVersionMajor, vmi.cfg.interface_os_version) mver = registry.lookup([], ios.IVersionMinor, vmi.cfg.interface_os_mversion) arch = registry.lookup([], ios.IArch, vmi.cfg.interface_os_arch) ovirt_ver = registry.lookup([], ios.IArch, vmi.cfg.interface_ovirt_version) os_info = ",".join(map(repr, [os, ver, mver, arch, ovirt_ver])) msg = "OS info: %s" % os_info utils.debug(vmi, msg) lookup_order = [[os, ver, mver, arch, ovirt_ver], [os, ver, mver, ovirt_ver], [os, ver, arch, ovirt_ver], [os, ver, ovirt_ver], [os, ovirt_ver], [os, ver, mver, arch], [os, ver, mver], [os, ver, arch], [os, ver], [os]] action = None iset = None for iset in lookup_order: if not all(iset): continue action = registry.lookup(iset, reg.IVmAction, self.name) if action: break if not action: msg = "Cannot find suitable implementation for: %s." % self.name raise utils.SpiceTestFail(vmi.test, msg) act_reqs = ",".join(map(repr, iset)) msg = "Call: %s, for OS interface: %s" % (self.name, act_reqs) utils.debug(vmi, msg) return action(vmi, *args, **kwargs)
def new_ssn(vmi, admin=False): if admin: username = vmi.cfg.rootuser password = vmi.cfg.rootpassword utils.debug(vmi, "Open a new session for: admin.") else: username = vmi.cfg.username password = vmi.cfg.password utils.debug(vmi, "Open a new session for: user.") ssn = vmi.vm.wait_for_login(username=username, password=password, timeout=int(vmi.cfg.login_timeout)) act.export_vars(vmi, ssn) return ssn
def new_ssn(vmi, admin=False, dogtail_ssn=False): if admin: username = vmi.cfg.rootuser password = vmi.cfg.rootpassword utils.debug(vmi, "Open a new session for: admin.") else: username = vmi.cfg.username password = vmi.cfg.password utils.debug(vmi, "Open a new session for: user.") ssn = vmi.vm.wait_for_login(username=username, password=password, timeout=int(vmi.cfg.login_timeout)) if dogtail_ssn: dogtail_cmd = utils.Cmd("dogtail-run-headless-next", "--dont-start", "--dont-kill", "/bin/bash") act.run(vmi, dogtail_cmd, ssn=ssn) act.export_vars(vmi, ssn) return ssn
def __call__(self, vmi, *args, **kwargs): os = registry.lookup([], ios.IOSystem, vmi.cfg.interface_os) ver = registry.lookup([], ios.IVersionMajor, vmi.cfg.interface_os_version) mver = registry.lookup([], ios.IVersionMinor, vmi.cfg.interface_os_mversion) arch = registry.lookup([], ios.IArch, vmi.cfg.interface_os_arch) ovirt_ver = registry.lookup([], ios.IArch, vmi.cfg.interface_ovirt_version) os_info = ",".join(map(repr, [os, ver, mver, arch, ovirt_ver])) msg = "OS info: %s" % os_info utils.debug(vmi, msg) lookup_order = [ [os, ver, mver, arch, ovirt_ver], [os, ver, mver, ovirt_ver], [os, ver, arch, ovirt_ver], [os, ver, ovirt_ver], [os, ovirt_ver], [os, ver, mver, arch], [os, ver, mver], [os, ver, arch], [os, ver], [os]] action = None for iset in lookup_order: if not all(iset): continue action = registry.lookup(iset, reg.IVmAction, self.name) if action: break if not action: msg = "Cannot find suitable implementation for: %s." % self.name raise utils.SpiceTestFail(vmi.test, msg) act_reqs = ",".join(map(repr, iset)) msg = "Call: %s, for OS interface: %s" % (self.name, act_reqs) utils.debug(vmi, msg) return action(vmi, *args, **kwargs)
def new_ssn(vmi, admin=False): utils.debug(vmi, "Yahooooooooooooo!")