qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v7 05/13] tests: Add vm test lib


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH v7 05/13] tests: Add vm test lib
Date: Fri, 15 Sep 2017 19:57:26 +0800
User-agent: Mutt/1.8.3 (2017-05-23)

On Fri, 09/15 12:37, Alex Bennée wrote:
> 
> Fam Zheng <address@hidden> writes:
> 
> > This is the common code to implement a "VM test" to
> >
> >   1) Download and initialize a pre-defined VM that has necessary
> >   dependencies to build QEMU and SSH access.
> >
> >   2) Archive $SRC_PATH to a .tar file.
> >
> >   3) Boot the VM, and pass the source tar file to the guest.
> >
> >   4) SSH into the VM, untar the source tarball, build from the source.
> >
> > Signed-off-by: Fam Zheng <address@hidden>
> > ---
> >  tests/vm/basevm.py | 256 
> > +++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 256 insertions(+)
> >  create mode 100755 tests/vm/basevm.py
> >
> > diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> > new file mode 100755
> > index 0000000000..e4603f3fba
> > --- /dev/null
> > +++ b/tests/vm/basevm.py
> > @@ -0,0 +1,256 @@
> > +#!/usr/bin/env python
> > +#
> > +# VM testing base class
> > +#
> > +# Copyright 2017 Red Hat Inc.
> > +#
> > +# Authors:
> > +#  Fam Zheng <address@hidden>
> > +#
> > +# This code is licensed under the GPL version 2 or later.  See
> > +# the COPYING file in the top-level directory.
> > +#
> > +
> > +import os
> > +import sys
> > +import logging
> > +import time
> > +import datetime
> > +sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", 
> > "scripts"))
> > +from qemu import QEMUMachine
> > +import subprocess
> > +import hashlib
> > +import optparse
> > +import atexit
> > +import tempfile
> > +import shutil
> > +import multiprocessing
> > +import traceback
> > +
> > +SSH_KEY = open(os.path.join(od.path.dirname(__file__),
> > +               "..", "keys", "id_rsa")).read()
> > +SSH_PUB_KEY = open(os.path.join(od.path.dirname(__file__),
> > +                   "..", "keys", "id_rsa.pub")).read()
> 
> Hmm I don't think this was tested:
> 
> 12:35:56 address@hidden:~/l/q/qemu.git] review/fam-vm-build-test-v7(+2/-2) ± 
> make vm-build-netbsd
>         CHK version_gen.h
>     VM-IMAGE netbsd
> Traceback (most recent call last):
>   File "/home/alex/lsrc/qemu/qemu.git/tests/vm/netbsd", line 17, in <module>
>     import basevm
>   File "/home/alex/lsrc/qemu/qemu.git/tests/vm/basevm.py", line 30, in 
> <module>
>     SSH_KEY = open(os.path.join(od.path.dirname(__file__),
> NameError: name 'od' is not defined
> /home/alex/lsrc/qemu/qemu.git/tests/vm/Makefile.include:23: recipe for target 
> 'tests/vm/netbsd.img' failed

Right, I tested the fixed version (s/od/os).

Fam



reply via email to

[Prev in Thread] Current Thread [Next in Thread]