mbox series

[v5,00/12] tests: Add VM based build tests (for non-x86_64 and/or non-Linux)

Message ID 20170831064302.14427-1-famz@redhat.com
Headers show
Series tests: Add VM based build tests (for non-x86_64 and/or non-Linux) | expand

Message

Fam Zheng Aug. 31, 2017, 6:42 a.m. UTC
v5: Generate source tar file with a script.
    Fix tmpdir, use pwd.
    Reduce default -j to half cores.

v4: Drop unused imports and parameters. [Cleber]
    Use --exclude-vcs (still no --exclude-vcs-ignores because it's too new). [Philippe]
    Use gtar if available. [Philippe, Kamil]
    /dev/ld1a -> /dev/rld1a for netbsd. [Kamil]
    Only use '-enable-kvm' if /dev/kvm is there. [Kamil]
    Grammar fixes of README. [Stefan]
    Rename image on the server to include version and arch. [Kamil]
    Just ignore *.tmp. [Philippe]

v3: Drop RFC.
    Add Stefan's and Kamil's reviewed-bys.
    Use optparse. [Stefan]
    Drop the VGA patch. [Paolo, Stefan]
    Improve exit/exit code/doc. [Stefan]
    Drop unused line from basevm.py. [Stefan]
    Drop "--target-list" form Makefile.
    More intelligent '-j'.
    Add README. [Stefan]

v2: - Add docstring. [Stefan]
    - Call self._load_io_lod. [Stefan]
    - Use "info usernet" and dynamic ssh_port forwarding. [Stefan]
    - Add image checksum.
    - Use os.rename() and os.makedirs(). [Stefan]
    - Fix NetBSD URL. [Kamil]

Build tests in one 32 bit Linux guest and three BSD images are defined in this
series. This is a more managable way than the manually maintained virtual
machines in patchew. Also, one big advantage of ephemeral VMs over long running
guests is the reduced RAM usage of host, which makes it possible to have one
host test all these BSD variants and probably more.

The BSD guest templates are manually prepared following

https://wiki.qemu.org/Hosts/BSD

as it is not easy to automate. (The ideal approach is like the ubuntu.i386
script, which configures the guest on top of an official released image, fully
automatically.)

Need for help: "gmake check" in the added OpenBSD image fails with -ENOMEM
errors, even if I change "-m 2G" to "-m 8G" when starting VM. Ideas? And there
is a warning from ./configure about OpenBSD going to be unsupported in coming
releases, is it still the case?

Fam

Fam Zheng (12):
  gitignore: Ignore vm test images
  qemu.py: Add "wait()" method
  scripts: Add archive-source.sh
  tests: Add vm test lib
  tests: Add ubuntu.i386 image
  tests: Add FreeBSD image
  tests: Add NetBSD image
  tests: Add OpenBSD image
  Makefile: Add rules to run vm tests
  MAINTAINERS: Add tests/vm entry
  tests: Add README for vm tests
  docker: Use archive-source.py

 .gitignore                    |   2 +
 MAINTAINERS                   |   1 +
 Makefile                      |   2 +
 configure                     |   2 +-
 scripts/archive-source.sh     |  29 +++++
 scripts/qemu.py               |   7 ++
 tests/docker/Makefile.include |  15 +--
 tests/docker/run              |   8 +-
 tests/vm/Makefile.include     |  42 +++++++
 tests/vm/README               |  63 ++++++++++
 tests/vm/basevm.py            | 276 ++++++++++++++++++++++++++++++++++++++++++
 tests/vm/freebsd              |  42 +++++++
 tests/vm/netbsd               |  42 +++++++
 tests/vm/openbsd              |  43 +++++++
 tests/vm/ubuntu.i386          |  88 ++++++++++++++
 15 files changed, 641 insertions(+), 21 deletions(-)
 create mode 100755 scripts/archive-source.sh
 create mode 100644 tests/vm/Makefile.include
 create mode 100644 tests/vm/README
 create mode 100755 tests/vm/basevm.py
 create mode 100755 tests/vm/freebsd
 create mode 100755 tests/vm/netbsd
 create mode 100755 tests/vm/openbsd
 create mode 100755 tests/vm/ubuntu.i386

Comments

no-reply@patchew.org Aug. 31, 2017, 6:55 a.m. UTC | #1
Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20170831064302.14427-1-famz@redhat.com
Subject: [Qemu-devel] [PATCH v5 00/12] tests: Add VM based build tests (for non-x86_64 and/or non-Linux)
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 t [tag update]            patchew/20170830163609.50260-1-pasic@linux.vnet.ibm.com -> patchew/20170830163609.50260-1-pasic@linux.vnet.ibm.com
 t [tag update]            patchew/20170830215523.25278-1-f4bug@amsat.org -> patchew/20170830215523.25278-1-f4bug@amsat.org
 * [new tag]               patchew/20170831064302.14427-1-famz@redhat.com -> patchew/20170831064302.14427-1-famz@redhat.com
Switched to a new branch 'test'
7ad2e659ca docker: Use archive-source.py
2dc170d07c tests: Add README for vm tests
19170c4fd7 MAINTAINERS: Add tests/vm entry
77ab30467b Makefile: Add rules to run vm tests
4a41ba7fcd tests: Add OpenBSD image
d6586b4423 tests: Add NetBSD image
3f1a2d60c9 tests: Add FreeBSD image
b413ab4921 tests: Add ubuntu.i386 image
167e9915a4 tests: Add vm test lib
75824c3f84 scripts: Add archive-source.sh
35bff37d20 qemu.py: Add "wait()" method
e572b186d5 gitignore: Ignore vm test images

=== OUTPUT BEGIN ===
Checking PATCH 1/12: gitignore: Ignore vm test images...
Checking PATCH 2/12: qemu.py: Add "wait()" method...
Checking PATCH 3/12: scripts: Add archive-source.sh...
Checking PATCH 4/12: tests: Add vm test lib...
ERROR: line over 90 characters
#85: FILE: tests/vm/basevm.py:60:
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCikC46WYtXotUd0UGPz9547Aj0KqC4gk+nt4BBJm86IHgCD9FygSGX9EFutXlhz9KZIPg9Okk7+IzXRHCWI2MNvhrcjyrezKREm71z08j9iwfxY3340fY2Mo+0khwpO7bzsgzkljHIHqcOg7MgttPInVMNH/EfqpgR8EDKJuWCB2Ny+EBFN/3dAiff0X/EvKle9PUrY70EkSycnyURS8HZReEqj8lN9J5kXzA8F6jBo/0Q42Ttv6e4k5YcaDrwmLrBWLra2PCXZLNyHqXEiFkGmdXtA1Eox9gc/p4jIXim6xrPNmpN6WyrrEjaCF5xYvNv8wXkD6uSWwbHYU24lIAn qemu-vm-key

WARNING: line over 80 characters
#99: FILE: tests/vm/basevm.py:74:
+        self._tmpdir = tempfile.mkdtemp(prefix="vm-test-", suffix=".tmp", dir=".")

WARNING: line over 80 characters
#190: FILE: tests/vm/basevm.py:165:
+        logging.debug("Creating archive %s for src_dir dir: %s", tarfile, src_dir)

WARNING: line over 80 characters
#195: FILE: tests/vm/basevm.py:170:
+                            "file=%s,if=none,id=%s,cache=writeback,format=raw" % \

WARNING: line over 80 characters
#198: FILE: tests/vm/basevm.py:173:
+                            "virtio-blk,drive=%s,serial=%s,bootindex=1" % (name, name)]

ERROR: line over 90 characters
#245: FILE: tests/vm/basevm.py:220:
+    VM test utility.  Exit codes: 0 = success, 1 = command line error, 2 = environment initialization failed, 3 = test command failed""")

WARNING: line over 80 characters
#252: FILE: tests/vm/basevm.py:227:
+    parser.add_option("--jobs", type=int, default=multiprocessing.cpu_count() / 2,

total: 2 errors, 5 warnings, 276 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 5/12: tests: Add ubuntu.i386 image...
Checking PATCH 6/12: tests: Add FreeBSD image...
Checking PATCH 7/12: tests: Add NetBSD image...
Checking PATCH 8/12: tests: Add OpenBSD image...
Checking PATCH 9/12: Makefile: Add rules to run vm tests...
Checking PATCH 10/12: MAINTAINERS: Add tests/vm entry...
Checking PATCH 11/12: tests: Add README for vm tests...
Checking PATCH 12/12: docker: Use archive-source.py...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
Kamil Rytarowski Aug. 31, 2017, 2:04 p.m. UTC | #2
Could we please add SmartOS image. It's an Illumos distribution,
previously known as OpenSolaris.

qemu is actively maintained for SmartOS in pkgsrc.

The latest build fixes were introduced less than a week ago.
https://github.com/NetBSD/pkgsrc/commit/f2608af5433f1491a92567bf570e9349dffbda7a

I'm going to submit the SmartOS patches to fix the build regardless of
the decision.

On 31.08.2017 08:42, Fam Zheng wrote:
> v5: Generate source tar file with a script.
>     Fix tmpdir, use pwd.
>     Reduce default -j to half cores.
> 
> v4: Drop unused imports and parameters. [Cleber]
>     Use --exclude-vcs (still no --exclude-vcs-ignores because it's too new). [Philippe]
>     Use gtar if available. [Philippe, Kamil]
>     /dev/ld1a -> /dev/rld1a for netbsd. [Kamil]
>     Only use '-enable-kvm' if /dev/kvm is there. [Kamil]
>     Grammar fixes of README. [Stefan]
>     Rename image on the server to include version and arch. [Kamil]
>     Just ignore *.tmp. [Philippe]
> 
> v3: Drop RFC.
>     Add Stefan's and Kamil's reviewed-bys.
>     Use optparse. [Stefan]
>     Drop the VGA patch. [Paolo, Stefan]
>     Improve exit/exit code/doc. [Stefan]
>     Drop unused line from basevm.py. [Stefan]
>     Drop "--target-list" form Makefile.
>     More intelligent '-j'.
>     Add README. [Stefan]
> 
> v2: - Add docstring. [Stefan]
>     - Call self._load_io_lod. [Stefan]
>     - Use "info usernet" and dynamic ssh_port forwarding. [Stefan]
>     - Add image checksum.
>     - Use os.rename() and os.makedirs(). [Stefan]
>     - Fix NetBSD URL. [Kamil]
> 
> Build tests in one 32 bit Linux guest and three BSD images are defined in this
> series. This is a more managable way than the manually maintained virtual
> machines in patchew. Also, one big advantage of ephemeral VMs over long running
> guests is the reduced RAM usage of host, which makes it possible to have one
> host test all these BSD variants and probably more.
> 
> The BSD guest templates are manually prepared following
> 
> https://wiki.qemu.org/Hosts/BSD
> 
> as it is not easy to automate. (The ideal approach is like the ubuntu.i386
> script, which configures the guest on top of an official released image, fully
> automatically.)
> 
> Need for help: "gmake check" in the added OpenBSD image fails with -ENOMEM
> errors, even if I change "-m 2G" to "-m 8G" when starting VM. Ideas? And there
> is a warning from ./configure about OpenBSD going to be unsupported in coming
> releases, is it still the case?
> 
> Fam
> 
> Fam Zheng (12):
>   gitignore: Ignore vm test images
>   qemu.py: Add "wait()" method
>   scripts: Add archive-source.sh
>   tests: Add vm test lib
>   tests: Add ubuntu.i386 image
>   tests: Add FreeBSD image
>   tests: Add NetBSD image
>   tests: Add OpenBSD image
>   Makefile: Add rules to run vm tests
>   MAINTAINERS: Add tests/vm entry
>   tests: Add README for vm tests
>   docker: Use archive-source.py
> 
>  .gitignore                    |   2 +
>  MAINTAINERS                   |   1 +
>  Makefile                      |   2 +
>  configure                     |   2 +-
>  scripts/archive-source.sh     |  29 +++++
>  scripts/qemu.py               |   7 ++
>  tests/docker/Makefile.include |  15 +--
>  tests/docker/run              |   8 +-
>  tests/vm/Makefile.include     |  42 +++++++
>  tests/vm/README               |  63 ++++++++++
>  tests/vm/basevm.py            | 276 ++++++++++++++++++++++++++++++++++++++++++
>  tests/vm/freebsd              |  42 +++++++
>  tests/vm/netbsd               |  42 +++++++
>  tests/vm/openbsd              |  43 +++++++
>  tests/vm/ubuntu.i386          |  88 ++++++++++++++
>  15 files changed, 641 insertions(+), 21 deletions(-)
>  create mode 100755 scripts/archive-source.sh
>  create mode 100644 tests/vm/Makefile.include
>  create mode 100644 tests/vm/README
>  create mode 100755 tests/vm/basevm.py
>  create mode 100755 tests/vm/freebsd
>  create mode 100755 tests/vm/netbsd
>  create mode 100755 tests/vm/openbsd
>  create mode 100755 tests/vm/ubuntu.i386
>
Peter Maydell Aug. 31, 2017, 2:27 p.m. UTC | #3
On 31 August 2017 at 15:04, Kamil Rytarowski <n54@gmx.com> wrote:
> Could we please add SmartOS image. It's an Illumos distribution,
> previously known as OpenSolaris.
>
> qemu is actively maintained for SmartOS in pkgsrc.
>
> The latest build fixes were introduced less than a week ago.
> https://github.com/NetBSD/pkgsrc/commit/f2608af5433f1491a92567bf570e9349dffbda7a

Maintaining out of tree patches without posting them upstream
is rather counterproductive, because if the host OS doesn't
build or have anybody submitting patches to fix it upstream
we will conclude that it's unused and delete the support entirely.
That E1000_SEC define has been around for nearly 10 years
without anybody saying it was a problem, for instance.
(Indeed Solaris is probably next after AIX on the "nobody
came along to tell us they cared enough to help us maintain
it" list for removal as a result.)

> I'm going to submit the SmartOS patches to fix the build
> regardless of the decision.

Thank you. Do you also have some instructions on how to
get it running in a VM or something so we can add it to
our build tests? (Login on a build machine, or a SmartOS
host in the gcc compile farm, would work too).

thanks
-- PMM
Kamil Rytarowski Aug. 31, 2017, 2:42 p.m. UTC | #4
On 31.08.2017 16:27, Peter Maydell wrote:
> On 31 August 2017 at 15:04, Kamil Rytarowski <n54@gmx.com> wrote:
>> Could we please add SmartOS image. It's an Illumos distribution,
>> previously known as OpenSolaris.
>>
>> qemu is actively maintained for SmartOS in pkgsrc.
>>
>> The latest build fixes were introduced less than a week ago.
>> https://github.com/NetBSD/pkgsrc/commit/f2608af5433f1491a92567bf570e9349dffbda7a
> 
> Maintaining out of tree patches without posting them upstream
> is rather counterproductive, because if the host OS doesn't
> build or have anybody submitting patches to fix it upstream
> we will conclude that it's unused and delete the support entirely.
> That E1000_SEC define has been around for nearly 10 years
> without anybody saying it was a problem, for instance.
> (Indeed Solaris is probably next after AIX on the "nobody
> came along to tell us they cared enough to help us maintain
> it" list for removal as a result.)
> 

Fully agreed. I keep slowly unloading pkgsrc from the downstream patches.

>> I'm going to submit the SmartOS patches to fix the build
>> regardless of the decision.
> 
> Thank you. Do you also have some instructions on how to
> get it running in a VM or something so we can add it to
> our build tests? (Login on a build machine, or a SmartOS
> host in the gcc compile farm, would work too).
> 

I use a Joyent machine for pkgsrc developers. I'm right now test
building 2.10.0 (including the dependencies).

I don't have any first-time starter.. This wiki might be useful.
https://wiki.smartos.org/display/DOC/Download+SmartOS

SmartOS is a regular UNIX-like OS (or even certified UNIX-based).

> thanks
> -- PMM
>
Fam Zheng Aug. 31, 2017, 2:49 p.m. UTC | #5
On Thu, 08/31 16:04, Kamil Rytarowski wrote:
> Could we please add SmartOS image. It's an Illumos distribution,
> previously known as OpenSolaris.
> 
> qemu is actively maintained for SmartOS in pkgsrc.
> 
> The latest build fixes were introduced less than a week ago.
> https://github.com/NetBSD/pkgsrc/commit/f2608af5433f1491a92567bf570e9349dffbda7a
> 
> I'm going to submit the SmartOS patches to fix the build regardless of
> the decision.

When QEMU builds on it, and when someone composes an instruction page like 

> > https://wiki.qemu.org/Hosts/BSD

then probably yes.

Fam