[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib |
Date: |
Wed, 30 Aug 2017 11:27:04 +0800 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Tue, 08/29 13:11, Daniel P. Berrange wrote:
> On Tue, Aug 29, 2017 at 09:06:48AM -0300, Philippe Mathieu-Daudé wrote:
> > Hi Fam,
> >
> > On 08/28/2017 02:47 PM, Fam Zheng wrote:
> > > 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 | 287
> > > +++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > 1 file changed, 287 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..d0095c5332
> > > --- /dev/null
> > > +++ b/tests/vm/basevm.py
>
> > > + def add_source_dir(self, data_dir):
> > > + name = "data-" + hashlib.sha1(data_dir).hexdigest()[:5]
> > > + tarfile = os.path.join(self._tmpdir, name + ".tar")
> > > + logging.debug("Creating archive %s for data dir: %s", tarfile,
> > > data_dir)
> > > + if subprocess.call("type gtar", stdout=self._devnull,
> > > + stderr=self._devnull, shell=True) == 0:
> > > + tar_cmd = "gtar"
> > > + else:
> > > + tar_cmd = "tar"
> > > + subprocess.check_call([tar_cmd,
> > > + "--exclude-vcs",
> > > + "--exclude=tests/vm/*.img",
> > > + "--exclude=tests/vm/*.img.*",
> > > + "--exclude=*.d",
> > > + "--exclude=*.o",
> > > + "--exclude=docker-src.*",
> > > + "-cf", tarfile, '.'], cwd=data_dir,
> >
> > I'm not happy with this command :/
> > My distrib uses tmpfs for /tmp and suddently the whole X window became
> > irresponsive until this script failing after filling 8G of /tmp and swap:
> >
> > ...
> > DEBUG:root:Creating archive /tmp/qemu-vm-F7CY9O/data-3a52c.tar for data dir:
> > .
> > tar: /tmp/qemu-vm-F7CY9O/data-3a52c.tar: Wrote only 4096 of 10240 bytes
> > tar: Error is not recoverable: exiting now
> > Failed to prepare guest environment
> >
> > Then I figured out my workdir is full of testing stuff, debug images,
> > firmwares, coredumps, etc.
> >
> > I'll think of another way.
>
> Yeah, /tmp should never be used for anything which has significant
> size. Could go for /var/tmp instead, but IMHO just use the QEMU build
> dir, as is done for (almost) all other build & test artifacts and
> thus avoid any global dirs.
Thanks, I'll fix it. Using current dir would be fine.
Fam
>
>
> Regards,
> Daniel
> --
> |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o- https://fstop138.berrange.com :|
> |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [Qemu-devel] [PATCH v4 00/10] tests: Add VM based build tests (for non-x86_64 and/or non-Linux), Fam Zheng, 2017/08/28
- [Qemu-devel] [PATCH v4 01/10] gitignore: Ignore vm test images, Fam Zheng, 2017/08/28
- [Qemu-devel] [PATCH v4 02/10] qemu.py: Add "wait()" method, Fam Zheng, 2017/08/28
- [Qemu-devel] [PATCH v4 04/10] tests: Add ubuntu.i386 image, Fam Zheng, 2017/08/28
- [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib, Fam Zheng, 2017/08/28
- Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib, Philippe Mathieu-Daudé, 2017/08/29
- Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib, Philippe Mathieu-Daudé, 2017/08/29
- Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib, Kamil Rytarowski, 2017/08/29
- Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib, Philippe Mathieu-Daudé, 2017/08/29
- Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib, Fam Zheng, 2017/08/30
- Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib, Fam Zheng, 2017/08/30
Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib, Philippe Mathieu-Daudé, 2017/08/29
Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib, Philippe Mathieu-Daudé, 2017/08/29