[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
- [Qemu-devel] [PATCH v7 00/13] tests: Add VM based build tests (for non-x86_64 and/or non-Linux), Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 01/13] gitignore: Ignore vm test images, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 02/13] qemu.py: Add "wait()" method, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 03/13] scripts: Add archive-source.sh, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 04/13] tests: Add a test key pair, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 05/13] tests: Add vm test lib, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 06/13] tests: Add ubuntu.i386 image, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 07/13] tests: Add FreeBSD image, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 08/13] tests: Add NetBSD image, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 09/13] tests: Add OpenBSD image, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 10/13] Makefile: Add rules to run vm tests, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 11/13] MAINTAINERS: Add tests/vm entry, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 12/13] tests: Add README for vm tests, Fam Zheng, 2017/09/12
- [Qemu-devel] [PATCH v7 13/13] docker: Use archive-source.py, Fam Zheng, 2017/09/12