On Fri, 09/15 12:37, Alex Bennée wrote: > > Fam Zheng <f...@redhat.com> 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 <f...@redhat.com> > > --- > > 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 <f...@redhat.com> > > +# > > +# 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 [alex@zen:~/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