test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Xu, HuilongX" <huilongx.xu@intel.com>
To: "Liu, Yong" <yong.liu@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Subject: Re: [dts] [PATCH] Qemu kvm module support login parameter
Date: Thu, 25 Jun 2015 02:57:19 +0000	[thread overview]
Message-ID: <DF2A19295B96364286FEB7F3DDA27A46011264A9@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E10E52433@SHSMSX103.ccr.corp.intel.com>

Hi yong,
dts need run with python2.7.
In python2.7 used if "key" in "dict" replace if "key" in dict.keys() to check "key" in "dict"
This function add in python from python2.3

Thanks  a lot

> -----Original Message-----
> From: Liu, Yong
> Sent: Thursday, June 25, 2015 10:51 AM
> To: Xu, HuilongX; dts@dpdk.org
> Subject: RE: [dts] [PATCH] Qemu kvm module support login parameter
> 
> Huilong,
> See my comments below.
> 
> > -----Original Message-----
> > From: Xu, HuilongX
> > Sent: Thursday, June 25, 2015 10:31 AM
> > To: Liu, Yong; dts@dpdk.org
> > Subject: RE: [dts] [PATCH] Qemu kvm module support login parameter
> >
> > Hi yong,
> > Would check my comments as below?
> >
> > > -----Original Message-----
> > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu
> > > Sent: Wednesday, June 24, 2015 5:23 PM
> > > To: dts@dpdk.org
> > > Subject: [dts] [PATCH] Qemu kvm module support login parameter
> > >
> > > From: Marvin Liu <yong.liu@intel.com>
> > >
> > > Default vm username and password are the same as host.
> > > User can change the default values by login parameter.
> > >
> > > Signed-off-by: Marvin Liu <yong.liu@intel.com>
> > >
> > > diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py
> > > index d149524..36622b5 100644
> > > --- a/framework/qemu_kvm.py
> > > +++ b/framework/qemu_kvm.py
> > > @@ -92,6 +92,10 @@ class QEMUKvm(VirtBase):
> > >          # devices pass-through into vm
> > >          self.pt_devices = []
> > >
> > > +        # default login user,password
> > > +        self.username = dut.crb['user']
> > > +        self.password = dut.crb['pass']
> > > +
> > >      def set_vm_default(self):
> > >          self.set_vm_name(self.vm_name)
> > >          self.set_vm_enable_kvm()
> > > @@ -282,6 +286,22 @@ class QEMUKvm(VirtBase):
> > >              disk_boot_line = '-drive file=%s' % options['file']
> > >              self.__add_boot_line(disk_boot_line)
> > >
> > > +    def add_vm_login(self, **options):
> > > +        """
> > > +        user: login username of virtual machine
> > > +        password: login password of virtual machine
> > > +        """
> >            You can used "user" in options replace check dict key is
> exist
> 
> Huilong,
> All parameters in virtual machine are optional.
> We can't make sure that both "user" and "password" those two parameters
> supplied by users.
> So we need to check them and if the key existed then use the value.
> 
> > > +        if 'user' in options.keys():
> >                Would you used self.username = options['user']?
> > > +            user = options['user']
> > > +            self.username = user
> > > +
> >            The comments same with last coments
> > > +        if 'password' in options.keys():
> > > +            password = options['password']
> > > +            self.password = password
> > > +
> > > +    def get_vm_login(self):
> > > +        return (self.username, self.password)
> > > +
> > >      def set_vm_net(self, **options):
> > >          index = self.find_option_index('net')
> > >          if index:
> > > diff --git a/framework/virt_base.py b/framework/virt_base.py
> > > index 9a0035d..063342f 100644
> > > --- a/framework/virt_base.py
> > > +++ b/framework/virt_base.py
> > > @@ -294,6 +294,9 @@ class VirtBase(object):
> > >          crb['bypass core0'] = False
> > >          vm_ip = self.get_vm_ip()
> > >          crb['IP'] = vm_ip
> > > +        username, password = self.get_vm_login()
> > > +        crb['user'] = username
> > > +        crb['pass'] = password
> > >
> > >          # remove default key
> > >          remove_old_rsa_key(self.host_dut.tester, crb['IP'])
> > > --
> > > 1.9.3

  reply	other threads:[~2015-06-25  2:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24  9:23 Yong Liu
2015-06-25  2:30 ` Xu, HuilongX
2015-06-25  2:51   ` Liu, Yong
2015-06-25  2:57     ` Xu, HuilongX [this message]
2015-06-26  1:03       ` Liu, Yong
2015-06-29  3:26         ` Liu, Yong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DF2A19295B96364286FEB7F3DDA27A46011264A9@SHSMSX101.ccr.corp.intel.com \
    --to=huilongx.xu@intel.com \
    --cc=dts@dpdk.org \
    --cc=yong.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).