From: "Cao, Chen" <kcao@redhat.com>
To: Michael Goldish <mgoldish@redhat.com>
Cc: kvm@vger.kernel.org, autotest@test.kernel.org, lmr@redhat.com
Subject: Re: [KVM-AUTOTEST PATCH] Improve kvm subtest AutoIt - add option to download script from remote server
Date: Tue, 1 Dec 2009 18:17:13 +0800 [thread overview]
Message-ID: <20091201101713.GA3803@rht.nay.redhat.com> (raw)
In-Reply-To: <1642084429.876051259653783787.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
On Tue, Dec 01, 2009 at 02:49:43AM -0500, Michael Goldish wrote:
>
> ----- "Chen Cao" <kcao@redhat.com> wrote:
>
> > Add an option to let user download the .au3 script from a remote
> > server, and keep the original method to prepare the script.
> >
> > This makes it possible to employ AutoIt tests that involve several
> > files.
> >
> > new variants:
> > 1. download,
> > if params.get("download") == "yes", download the scripts to guest,
> > else use the original method, echo the code into guest.
> > 2. download_cmd,
> > What tool to use to download.
> > User can choose git, as in the sample file, svn, ftp, or wget,
> > or other preferred tools.
> > NOTE, this requires that the download tool is installed in the
> > guest, or the tools have been placed in winutils.iso.
> > 3. rsc_server,
> > Resource server which contains the AutoIt script
> > and provide a download service.
> > 4. dst_rsc_dir,
> > Destination of the AutoIt scripts in the guest.
> > i.e. the downloaded resource will be saved in this default dir.
> > 5. autoit_entry,
> > Which .au3 file to start to run.
> > this will be useful if a test involves several .au3 files.
> >
> > Signed-off-by: Cao, Chen <kcao@redhat.com>
>
> I haven't reviewed the code yet, but I have 2 quick questions:
>
> - If the files we'll be downloading are text files (.au3 files), then
> why not download them in the host and send them to the guest using
> the echo method? This imposes less requirements on the guest.
>
downloading/preparing them in the host also requires extra effects
before the test.
and we may also need testing tools, which are binary executables,
to aid our tests. then we have to wait for the improved rss.exe,
it is bad for the users/testers.
> - Why not add the ability to send multiple files from the host to the
> guest, using the echo method, without downloading them?
>
> BTW, this echo method is meant to be used only until we add file
> transfer support to rss.exe (I'm not sure when exactly that will
> happen).
>
I just like to give the users/testers more choices to focus on the tests.
especially, for now it is a little hard to echo multiple files into guest.
I am also looking forward to the new version of rss with file transfer
functions.
Thanks for your questions, buddy.
Regards,
Cao, Chen
2009/12/01
>
> > ---
> > client/tests/kvm/kvm_tests.cfg.sample | 6 ++++
> > client/tests/kvm/tests/autoit.py | 45
> > ++++++++++++++++++++++----------
> > 2 files changed, 37 insertions(+), 14 deletions(-)
> >
> > diff --git a/client/tests/kvm/kvm_tests.cfg.sample
> > b/client/tests/kvm/kvm_tests.cfg.sample
> > index 5e15b30..f688b97 100644
> > --- a/client/tests/kvm/kvm_tests.cfg.sample
> > +++ b/client/tests/kvm/kvm_tests.cfg.sample
> > @@ -169,6 +169,12 @@ variants:
> > variants:
> > - notepad:
> > autoit_script = autoit/notepad1.au3
> > + - stub:
> > + download = yes
> > + download_cmd = "git clone"
> > + rsc_server = "git://the.resource.server/autoit"
> > + dst_rsc_dir = "C:\"
> > + autoit_entry = "C:\autoit\stub\stub.au3"
> >
> > - guest_s4: install setup unattended_install
> > type = guest_s4
> > diff --git a/client/tests/kvm/tests/autoit.py
> > b/client/tests/kvm/tests/autoit.py
> > index 9435d7c..ed1d491 100644
> > --- a/client/tests/kvm/tests/autoit.py
> > +++ b/client/tests/kvm/tests/autoit.py
> > @@ -25,23 +25,40 @@ def run_autoit(test, params, env):
> > # Collect test parameters
> > binary = params.get("autoit_binary")
> > script = params.get("autoit_script")
> > + autoit_entry = params.get("autoit_entry", "script.au3")
> > script_params = params.get("autoit_script_params", "")
> > timeout = float(params.get("autoit_script_timeout", 600))
> >
> > - # Send AutoIt script to guest (this code will be replaced
> > once we
> > - # support sending files to Windows guests)
> > - session.get_command_output("del script.au3",
> > internal_timeout=0)
> > - file = open(kvm_utils.get_path(test.bindir, script))
> > - for line in file.readlines():
> > - # Insert a '^' before each character
> > - line = "".join("^" + c for c in line.rstrip())
> > - if line:
> > - # Append line to the file
> > - session.get_command_output("echo %s>>script.au3" %
> > line,
> > - internal_timeout=0)
> > - file.close()
> > -
> > - command = "cmd /c %s script.au3 %s" % (binary,
> > script_params)
> > + # Download the script resource from a remote server, or
> > + # prepare the script using rss?
> > + if params.get("download") == "yes":
> > + download_cmd = params.get("download_cmd")
> > + rsc_server = params.get("rsc_server")
> > + dst_rsc_dir = params.get("dst_rsc_dir")
> > +
> > + # Change dir to dst_rsc_dir, and remove 'autoit' there,
> > then
> > + # download the resource.
> > + rsc_cmd = "cd %s && (rmdir /s /q autoit || del /s /q
> > autoit) && " \
> > + "%s %s" % (dst_rsc_dir, download_cmd,
> > rsc_server)
> > +
> > + if session.get_command_status(rsc_cmd, timeout=timeout)
> > != 0:
> > + raise error.TestFail("Download test resource
> > failed.")
> > + logging.info("Download resource finished.")
> > + else:
> > + # Send AutoIt script to guest (this code will be replaced
> > once we
> > + # support sending files to Windows guests)
> > + session.get_command_output("del script.au3",
> > internal_timeout=0)
> > + file = open(kvm_utils.get_path(test.bindir, script))
> > + for line in file.readlines():
> > + # Insert a '^' before each character
> > + line = "".join("^" + c for c in line.rstrip())
> > + if line:
> > + # Append line to the file
> > + session.get_command_output("echo %s>>script.au3"
> > % line,
> > + internal_timeout=0)
> > + file.close()
> > +
> > + command = "cmd /c %s %s %s" % (binary, autoit_entry,
> > script_params)
> >
> > logging.info("---------------- Script output
> > ----------------")
> > status = session.get_command_status(command,
> > --
> > 1.5.5.6
next prev parent reply other threads:[~2009-12-01 10:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-01 7:16 [KVM-AUTOTEST PATCH] Improve kvm subtest AutoIt - add option to download script from remote server Cao, Chen
2009-12-01 7:49 ` Michael Goldish
2009-12-01 10:17 ` Cao, Chen [this message]
2009-12-03 3:16 ` [Autotest] " Lucas Meneghel Rodrigues
2009-12-03 6:39 ` Cao, Chen
2009-12-04 12:28 ` Lucas Meneghel Rodrigues
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=20091201101713.GA3803@rht.nay.redhat.com \
--to=kcao@redhat.com \
--cc=autotest@test.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=lmr@redhat.com \
--cc=mgoldish@redhat.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