From 74d51c8c3e18a8b6738aff0c6f7ff706fd70eaa6 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 26 Jun 2014 13:57:02 +0200 Subject: initial commit for Enea Linux 4.0 Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau --- README | 38 ++ conf/layer.conf | 13 + images-append/enea-image-demo.bbappend | 4 + images-append/enea-image-test-bash.bbappend | 6 + images/enea-image-virt-test-guest.bb | 33 ++ recipes-append/busybox/busybox_1.22.1.bbappend | 3 + .../configure-Add-with-python-install-dir.patch | 60 +++ recipes-append/libxml/libxml2_2.9.1.bbappend | 26 ++ recipes-append/netperf/netperf_2.6.0.bbappend | 4 + recipes-append/qemu/qemu_1.7.0.bbappend | 6 + .../systest-runner/files/tests/virt-test | 247 ++++++++++ .../systest-runner/systest-runner.bbappend | 12 + recipes-containers/lxc/files/init-lxc-mount | 12 + .../lxc-busybox-support-enea-linux-init.patch | 51 ++ .../lxc-test-attach-replace-cmp-with-grep.patch | 24 + recipes-containers/lxc/lxc_1.0.1.bbappend | 15 + recipes-core/base-files/base-files_3.0.14.bbappend | 13 + .../packagegroup-enea-virt-test-guest.bb | 27 ++ .../packagegroups/packagegroup-enea-virt.bb | 35 ++ recipes-example/virt-example/files/LICENSE | 24 + .../virt-example/files/example-container.conf | 50 ++ .../virt-example/files/example-guest-x86.xml | 71 +++ recipes-example/virt-example/files/example-net.xml | 39 ++ .../virt-example/files/pxe/pxelinux.cfg/default | 10 + recipes-example/virt-example/virt-example_1.0.0.bb | 34 ++ .../python-urlgrabber/pycurl-curl.patch | 288 ++++++++++++ .../python-urlgrabber/python-urlgrabber_3.10.1.bb | 37 ++ recipes-extra/virt-manager/virt-manager_1.0.0.bb | 72 +++ .../perf-x86-fix-RAPL-rdmsrl_safe-usage.patch | 29 ++ ...tel-Use-rdmsrl_safe-when-initializing-RAP.patch | 80 ++++ recipes-kernel/linux/linux-keystone_3.10.bbappend | 13 + recipes-kernel/linux/linux-qoriq-sdk.bbappend | 24 + recipes-kernel/linux/linux-xlnx_3.8.bbappend | 7 + recipes-kernel/linux/linux-yocto_3.10.bbappend | 6 + recipes-kernel/linux/linux-yocto_3.14.bbappend | 8 + .../lksctp-tools/lksctp-tools_1.0.16.bb | 57 +++ recipes-test/autotest/autotest.inc | 17 + recipes-test/autotest/autotest_0.16.0.bb | 7 + ...efile-use-g-from-environment-if-available.patch | 44 ++ ...ile-Add-support-for-building-on-powerpc64.patch | 46 ++ ...Makefile-Add-support-for-building-on-ARM7.patch | 46 ++ recipes-test/udt/udt_git.bb | 46 ++ .../virt-test/files/add_enea_linux_support.patch | 78 ++++ .../files/allow_bootstrap_3rd_party_image.patch | 233 ++++++++++ .../files/clear_mandatory_header_list.patch | 13 + recipes-test/virt-test/files/dnsmasq-virt-test | 2 + .../files/do_not_upgrade_test_providers.patch | 27 ++ .../virt-test/files/enea-image-virt-test-guest.wks | 10 + .../virt-test/files/fix_asset_uncompress.patch | 29 ++ .../files/qemu-tests-clock-getres-config.patch | 20 + .../qemu-tests-cpuflags-build-avoidance.patch | 516 +++++++++++++++++++++ .../virt-test/files/qemu-tests-cpuflags-conf.patch | 41 ++ .../qemu-tests-cpuflags-migrate-to-provider.patch | 91 ++++ .../virt-test/files/qemu-tests-cyclictest.patch | 217 +++++++++ .../files/qemu-tests-multi-nic-stress.patch | 102 ++++ .../files/qemu-tests-nx-exploit-config.patch | 21 + .../files/qemu-tests-pipetest-config.patch | 26 ++ .../virt-test/files/qemu-tests-stress-config.patch | 28 ++ .../files/qemu-tests-time-drift-config.patch | 37 ++ .../qemu-tests-tsc-sync-build-avoidance.patch | 194 ++++++++ .../files/qemu-tests-tsc-sync-config.patch | 21 + ...qemu-tests-virtual-nic-send-buffer-config.patch | 26 ++ .../virt-test/files/remove_7za_dependency.patch | 13 + .../virt-test/files/remove_gcc_dependency.patch | 13 + recipes-test/virt-test/files/virt-test-ppc.patch | 121 +++++ ...irt-test-qemu_vm-add-monotonic-start-time.patch | 32 ++ .../files/virt-test-search-qemu-system-arch.patch | 21 + .../files/virttest-passfd-compiler-fix.patch | 24 + .../files/virttest-utils-misc-cpu-flags-fix.patch | 25 + recipes-test/virt-test/virt-test-libvirt_git.bb | 26 ++ recipes-test/virt-test/virt-test-qemu_git.bb | 118 +++++ recipes-test/virt-test/virt-test_git.bb | 77 +++ 72 files changed, 3886 insertions(+) create mode 100644 README create mode 100644 conf/layer.conf create mode 100644 images-append/enea-image-demo.bbappend create mode 100644 images-append/enea-image-test-bash.bbappend create mode 100644 images/enea-image-virt-test-guest.bb create mode 100644 recipes-append/busybox/busybox_1.22.1.bbappend create mode 100644 recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch create mode 100644 recipes-append/libxml/libxml2_2.9.1.bbappend create mode 100644 recipes-append/netperf/netperf_2.6.0.bbappend create mode 100644 recipes-append/qemu/qemu_1.7.0.bbappend create mode 100755 recipes-append/systest-runner/files/tests/virt-test create mode 100644 recipes-append/systest-runner/systest-runner.bbappend create mode 100755 recipes-containers/lxc/files/init-lxc-mount create mode 100644 recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch create mode 100644 recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch create mode 100644 recipes-containers/lxc/lxc_1.0.1.bbappend create mode 100644 recipes-core/base-files/base-files_3.0.14.bbappend create mode 100644 recipes-core/packagegroups/packagegroup-enea-virt-test-guest.bb create mode 100644 recipes-core/packagegroups/packagegroup-enea-virt.bb create mode 100644 recipes-example/virt-example/files/LICENSE create mode 100644 recipes-example/virt-example/files/example-container.conf create mode 100644 recipes-example/virt-example/files/example-guest-x86.xml create mode 100644 recipes-example/virt-example/files/example-net.xml create mode 100755 recipes-example/virt-example/files/pxe/pxelinux.cfg/default create mode 100644 recipes-example/virt-example/virt-example_1.0.0.bb create mode 100644 recipes-extra/python-urlgrabber/python-urlgrabber/pycurl-curl.patch create mode 100644 recipes-extra/python-urlgrabber/python-urlgrabber_3.10.1.bb create mode 100644 recipes-extra/virt-manager/virt-manager_1.0.0.bb create mode 100644 recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch create mode 100644 recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch create mode 100644 recipes-kernel/linux/linux-keystone_3.10.bbappend create mode 100644 recipes-kernel/linux/linux-qoriq-sdk.bbappend create mode 100644 recipes-kernel/linux/linux-xlnx_3.8.bbappend create mode 100644 recipes-kernel/linux/linux-yocto_3.10.bbappend create mode 100644 recipes-kernel/linux/linux-yocto_3.14.bbappend create mode 100644 recipes-missing/lksctp-tools/lksctp-tools_1.0.16.bb create mode 100644 recipes-test/autotest/autotest.inc create mode 100644 recipes-test/autotest/autotest_0.16.0.bb create mode 100644 recipes-test/udt/files/0001-Makefile-use-g-from-environment-if-available.patch create mode 100644 recipes-test/udt/files/0002-Makefile-Add-support-for-building-on-powerpc64.patch create mode 100644 recipes-test/udt/files/0003-Makefile-Add-support-for-building-on-ARM7.patch create mode 100644 recipes-test/udt/udt_git.bb create mode 100644 recipes-test/virt-test/files/add_enea_linux_support.patch create mode 100644 recipes-test/virt-test/files/allow_bootstrap_3rd_party_image.patch create mode 100644 recipes-test/virt-test/files/clear_mandatory_header_list.patch create mode 100644 recipes-test/virt-test/files/dnsmasq-virt-test create mode 100644 recipes-test/virt-test/files/do_not_upgrade_test_providers.patch create mode 100644 recipes-test/virt-test/files/enea-image-virt-test-guest.wks create mode 100644 recipes-test/virt-test/files/fix_asset_uncompress.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-clock-getres-config.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-cpuflags-build-avoidance.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-cpuflags-conf.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-cpuflags-migrate-to-provider.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-cyclictest.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-multi-nic-stress.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-nx-exploit-config.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-pipetest-config.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-stress-config.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-time-drift-config.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-tsc-sync-build-avoidance.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-tsc-sync-config.patch create mode 100644 recipes-test/virt-test/files/qemu-tests-virtual-nic-send-buffer-config.patch create mode 100644 recipes-test/virt-test/files/remove_7za_dependency.patch create mode 100644 recipes-test/virt-test/files/remove_gcc_dependency.patch create mode 100644 recipes-test/virt-test/files/virt-test-ppc.patch create mode 100644 recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch create mode 100644 recipes-test/virt-test/files/virt-test-search-qemu-system-arch.patch create mode 100644 recipes-test/virt-test/files/virttest-passfd-compiler-fix.patch create mode 100644 recipes-test/virt-test/files/virttest-utils-misc-cpu-flags-fix.patch create mode 100644 recipes-test/virt-test/virt-test-libvirt_git.bb create mode 100644 recipes-test/virt-test/virt-test-qemu_git.bb create mode 100644 recipes-test/virt-test/virt-test_git.bb diff --git a/README b/README new file mode 100644 index 0000000..be8e45d --- /dev/null +++ b/README @@ -0,0 +1,38 @@ +Enea Linux virtualization support +================================= + +This layer provides virtualization support and related tools to Enea Linux. + +Supported Platforms +------------------- + + KVM - Kernel Virtual Machine for x86-64 and PowerPC (e500mc). + LXC - Linux Containers for x86-64, 32-bit ARM, PowerPC. + +Dependencies +------------ +meta-enea: + URI: git://git.enea.com/linux/meta-enea.git + branch: master + +meta-virtualization: + URI: git://git.yoctoproject.org/meta-virtualization + branch: daisy + +meta-openembedded: + URI: git://git.openembedded.org/meta-openembedded + branch: daisy + layers: meta-oe + meta-networking + +Maintenance +----------- + +Maintainers: Enea Linux + +License +------- + +All metadata is MIT licensed unless otherwise stated. Source code included +in tree for individual recipes is under the LICENSE stated in each recipe +(.bb file) unless otherwise stated. diff --git a/conf/layer.conf b/conf/layer.conf new file mode 100644 index 0000000..03dcaab --- /dev/null +++ b/conf/layer.conf @@ -0,0 +1,13 @@ +# We have a packages directory, add to BBFILES +BBPATH .= ":${LAYERDIR}" + +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb*" +BBFILES += "${LAYERDIR}/images/*.bb*" +BBFILES += "${LAYERDIR}/images-append/*.bb*" + +BBFILE_COLLECTIONS += "enea-vt" +BBFILE_PATTERN_enea-vt := "^${LAYERDIR}/" +BBFILE_PRIORITY_enea-vt = "7" +LAYERDEPENDS_enea-vt = "enea" + +BB_DANGLINGAPPENDS_WARNONLY = "yes" diff --git a/images-append/enea-image-demo.bbappend b/images-append/enea-image-demo.bbappend new file mode 100644 index 0000000..9019a7b --- /dev/null +++ b/images-append/enea-image-demo.bbappend @@ -0,0 +1,4 @@ +IMAGE_INSTALL += " \ + packagegroup-enea-virt \ + virt-example \ + " diff --git a/images-append/enea-image-test-bash.bbappend b/images-append/enea-image-test-bash.bbappend new file mode 100644 index 0000000..3103afc --- /dev/null +++ b/images-append/enea-image-test-bash.bbappend @@ -0,0 +1,6 @@ +IMAGE_FSTYPES += "cpio.gz" + +IMAGE_INSTALL += " \ + packagegroup-enea-virt \ + virt-example \ + " diff --git a/images/enea-image-virt-test-guest.bb b/images/enea-image-virt-test-guest.bb new file mode 100644 index 0000000..48bd7de --- /dev/null +++ b/images/enea-image-virt-test-guest.bb @@ -0,0 +1,33 @@ +# +# Poky specific package kits. +# + +# no need for udev +VIRTUAL-RUNTIME_dev_manager = "" + + +# +# Enea Specific Packages +# +IMAGE_FEATURES += "ssh-server-dropbear" + +IMAGE_INSTALL = " \ + packagegroup-enea-core-boot \ + pramfs-init \ + packagegroup-enea-virt-test-guest \ + " + +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +inherit core-image +inherit image_types_uboot + +IMAGE_FSTYPES += "ext2.gz.u-boot ext3 tar.gz cpio.gz" + +# The bigger of below two will be chosen +IMAGE_ROOTFS_SIZE = "1" +# Increased the overhead factor to be able to build via nfs. +IMAGE_OVERHEAD_FACTOR = "2" + diff --git a/recipes-append/busybox/busybox_1.22.1.bbappend b/recipes-append/busybox/busybox_1.22.1.bbappend new file mode 100644 index 0000000..edabf7e --- /dev/null +++ b/recipes-append/busybox/busybox_1.22.1.bbappend @@ -0,0 +1,3 @@ +do_prepare_config_append () { + sed -i -e 's/# CONFIG_CHPASSWD is not set/CONFIG_CHPASSWD=y/' .config +} diff --git a/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch b/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch new file mode 100644 index 0000000..174be5f --- /dev/null +++ b/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch @@ -0,0 +1,60 @@ +From df85edda5f6632f12f5802173a5012a35b19ccdd Mon Sep 17 00:00:00 2001 +From: Jonas Eriksson +Date: Thu, 6 Mar 2014 08:22:23 +0100 +Subject: [PATCH] configure: Add --with-python-install-dir + +Cross-compiling the python bindings is a bit difficult today, as the +configure script will figure out the site packages dir +(PYTHON_SITE_PACKAGES) by either: + +- Generating the path to the site-package target directories using + libdir, and see if it exists. As it is not possible to point to the + full path of the sysroot, since that will yield the wrong install + path, and that the directory does not neccessarily exist on the host, + this approach will not work. + +- Fetch the site packages dir from the python interpreter as pointed to + by --with-python. Since this python interpreter will point to the + sysroot, the install dir generated will be inside the sysroot and thus + not work. + +This patch approaches the problem by adding the possibility of +explicitly stating the install dir of the python packages, leaving it up +to the cross-compilation environment to specify it. The patch does not +affect the default case (non-cross compilation). + +Signed-off-by: Jonas Eriksson + +Upstream-Status: Submitted [xml@gnome.org] +--- + configure.in | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/configure.in b/configure.in +index ecaa403..21ad1e7 100644 +--- a/configure.in ++++ b/configure.in +@@ -148,6 +148,9 @@ AC_ARG_WITH(push, + [ --with-push add the PUSH parser interfaces (on)]) + AC_ARG_WITH(python, + [ --with-python[[=DIR]] build Python bindings if found]) ++AC_ARG_WITH(python_install_dir, ++[ --with-python-install-dir=DIR ++ install Python bindings in DIR]) + AC_ARG_WITH(reader, + [ --with-reader add the xmlReader parsing interface (on)]) + AC_ARG_WITH(readline, +@@ -866,6 +869,10 @@ if test "$with_python" != "no" ; then + fi + fi + fi ++ if test "$with_python_install_dir" != "" ++ then ++ PYTHON_SITE_PACKAGES="$with_python_install_dir" ++ fi + if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = "" + then + if test -d $libdir/python$PYTHON_VERSION/site-packages +-- +1.9.0 + diff --git a/recipes-append/libxml/libxml2_2.9.1.bbappend b/recipes-append/libxml/libxml2_2.9.1.bbappend new file mode 100644 index 0000000..98745d8 --- /dev/null +++ b/recipes-append/libxml/libxml2_2.9.1.bbappend @@ -0,0 +1,26 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://configure-Add-with-python-install-dir.patch" + +PACKAGES += "${PN}-python ${PN}-python-staticdev ${PN}-python-dbg" + +DEPENDS += "python-dev" + +FILES_${PN}-python = " \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.so \ + ${PYTHON_SITEPACKAGES_DIR}/drv_libxml2.py \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2.py \ + " +FILES_${PN}-python-staticdev += " \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.a \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.la \ + " +FILES_${PN}-python-dbg += " \ + ${PYTHON_SITEPACKAGES_DIR}/.debug/libxml2mod.so \ + " + +# +: --with-catalog, --with-python-install-dir +EXTRA_OECONF = "--with-python=${STAGING_BINDIR}/python --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} --without-debug --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions" + +# +: --with-python-install-dir +EXTRA_OECONF_linuxstdbase = "--with-python=${STAGING_BINDIR}/python --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} --with-debug --with-legacy --with-catalog --with-docbook --with-c14n --without-lzma" diff --git a/recipes-append/netperf/netperf_2.6.0.bbappend b/recipes-append/netperf/netperf_2.6.0.bbappend new file mode 100644 index 0000000..0115d4f --- /dev/null +++ b/recipes-append/netperf/netperf_2.6.0.bbappend @@ -0,0 +1,4 @@ +PACKAGECONFIG ??= "sctp" +PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools," + +RRECOMMENDS_${PN} += "${@base_contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}" diff --git a/recipes-append/qemu/qemu_1.7.0.bbappend b/recipes-append/qemu/qemu_1.7.0.bbappend new file mode 100644 index 0000000..d633a19 --- /dev/null +++ b/recipes-append/qemu/qemu_1.7.0.bbappend @@ -0,0 +1,6 @@ +# Fixes the DEPENDS variable to not require x11 +DEPENDS = "glib-2.0 zlib alsa-lib pixman dtc libsdl \ + ${@base_contains('DISTRO_FEATURES', 'x11', 'virtual/libx11', '', d)}" + +PACKAGECONFIG += "virtfs" +PACKAGECONFIG_class-nativesdk ??= "" diff --git a/recipes-append/systest-runner/files/tests/virt-test b/recipes-append/systest-runner/files/tests/virt-test new file mode 100755 index 0000000..500b6ef --- /dev/null +++ b/recipes-append/systest-runner/files/tests/virt-test @@ -0,0 +1,247 @@ +#!/bin/sh + +filter_output() { + test_name="$1" + debug_dir="" + while read row; do + echo "# $row" + # Output is colorized; remove escape characters + row_cleaned=`echo "$row" | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"` + # Transform "SETUP: PASS|FAIL" to "SETUP ($test_name): PASS|FAIL" + row_cleaned=`echo "$row_cleaned" | sed "s/^SETUP:/SETUP ($test_name):/"` + if echo "$row_cleaned" | grep -q '^[^:]*: \(PASS\|FAIL\|ERROR\)\( \[result=[^]]*\]\)\? ([0-9\.]\{1,\} s)$'; then + # The row is a test result + test_case=`echo "$row_cleaned" | grep -o '^\(SETUP\|([0-9]\{1,\}/[0-9]\{1,\})\)[^:]*' | sed 's|^([0-9]\{1,\}/[0-9]\{1,\}) ||'` + status=`echo "$row_cleaned" | grep -o ': \(PASS\|FAIL\|ERROR\)' | sed -e 's/^: //' -e 's/ERROR/FAIL/'` + echo -n "$status: $test_case" + # Are there any textual results to be appended? + keyval_file="$debug_dir/$test_case/keyval" + if [ -n "$debug_dir" -a -e "$keyval_file" ]; then + result=`grep '^result=' $keyval_file | sed 's/^result=//'` + if [ -n "$result" ]; then + echo -n " [result=$result]" + fi + fi + echo "" + elif echo "$row_cleaned" | grep -q '^DEBUG LOG: '; then + # The row specifies the path to the debug log: Extract the debug directory and save it + debug_dir=`echo "$row_cleaned" | sed -e 's,^DEBUG LOG: ,,' -e 's,/debug\.log$,,'` + fi + done +} + +create_empty_image() { + IMAGE_NAME="$1" + COMPRESSION_TYPE="$2" + + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}.${COMPRESSION_TYPE}" + if [ -z "$COMPRESSION_TYPE" ]; then + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}" + fi + SHA1_NAME="${COMPRESSED_IMAGE_NAME}.sha1" + + pushd /opt/virt-test/shared/data/images/ &> /dev/null + + rm -f "$IMAGE_NAME" "$SHA1_NAME" "$COMPRESSED_IMAGE_NAME" + rm -f "${IMAGE_NAME}.backup" + + echo "# Creating empty image ${IMAGE_NAME}" + qemu-img create -f qcow2 ${IMAGE_NAME} 10M + case "$COMPRESSION_TYPE" in + bz2) + bzip2 -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" + ;; + gz) + gzip -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" + ;; + xz) + xz -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" + ;; + *) + echo "ERROR: Invalid compression type: $COMPRESSION_TYPE" + popd + exit 1 + ;; + esac + sha1sum "$COMPRESSED_IMAGE_NAME" > "$SHA1_NAME" + + cp "$IMAGE_NAME" "${IMAGE_NAME}.backup" + + echo "# Empty image $IMAGE_NAME created" + echo + + popd &> /dev/null +} + +get_image() { + URL_BASE="$1" + IMAGE_NAME="$2" + COMPRESSION_TYPE="$3" + + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}.${COMPRESSION_TYPE}" + if [ -z "$COMPRESSION_TYPE" ]; then + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}" + fi + SHA1_NAME="${COMPRESSED_IMAGE_NAME}.sha1" + COMPRESSED_IMAGE_URL="${URL_BASE}/${COMPRESSED_IMAGE_NAME}" + SHA1_URL="${URL_BASE}/${SHA1_NAME}" + + pushd /opt/virt-test/shared/data/images/ &> /dev/null + + rm -f "$IMAGE_NAME" "$SHA1_NAME" "$COMPRESSED_IMAGE_NAME" + rm -f "${IMAGE_NAME}.backup" + + echo "# Downloading $COMPRESSED_IMAGE_URL" + wget $COMPRESSED_IMAGE_URL + wget $SHA1_URL + + if ! sha1sum -c "$SHA1_NAME" > /dev/null; then + echo "ERROR: Invalid sha1 sum!" + exit 1 + fi + + echo "# Uncompressing $COMPRESSED_IMAGE_NAME -> $IMAGE_NAME" + case "$COMPRESSION_TYPE" in + bz2) + bunzip2 -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" + ;; + gz) + gunzip -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" + ;; + xz) + unxz -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" + ;; + "") + ;; + *) + echo "ERROR: Invalid compression type: $COMPRESSION_TYPE" + popd + exit 1 + ;; + esac + + cp "$IMAGE_NAME" "${IMAGE_NAME}.backup" + + echo "# Download of $IMAGE_NAME completed" + echo + + popd &> /dev/null +} + +# Verbose? +VERBOSE= +if [ "$1" = '-v' ]; then + VERBOSE=1 + set -x +fi + +# Servers +NTP_SERVER=ntp.enea.se + +# Architecture +ARCH=`uname -m` + +# Needed by virt-test +export AUTOTEST_PATH="/opt/autotest/" + +# Init LVM +DEST_DIR=/opt/virt-test/shared/data +if ! [ -e /dev/rootvg ]; then + vgchange -ay + udevadm settle # Wait for device nodes +fi +if [ -e /dev/rootvg ]; then + if ! [ -e /dev/rootvg/virttestdatalv ]; then + if ! lvcreate -L30G -n virttestdatalv /dev/rootvg; then + echo "ERROR: Unable to create virttestdatalv!" >&2 + exit 1 + fi + udevadm settle + if ! mkfs.ext4 /dev/rootvg/virttestdatalv; then + echo "ERROR: Unable to format virttestdatalv!" >&2 + exit 1 + fi + fi + + # Mount the virttestdatalv + mkdir -p $DEST_DIR + if ! mountpoint -q $DEST_DIR; then + if ! mount /dev/rootvg/virttestdatalv $DEST_DIR; then + echo "ERROR: Unable to mount virttestdatalv!" >&2 + exit 1 + fi + fi +else + echo "WARNING: No rootvg volume group! Continuing anyway" >&2 +fi +( + cd $DEST_DIR + mkdir -p gpg images isos steps_data +) + +# Sync the clock before starting tests, as some tests will do this, and thereby +# cause tests that run for a negative amount of time unless the time is synced +# from the very beginning +ntpdate $NTP_SERVER + +# Download/create images, kernel, initrd +JEOS_VERSION="19-64" +ENEA_VERSION="4.0" +# virt-test will try to unpack the images for all architectures, even though +# they are not used, so always create the (empty) images. +create_empty_image "enea-${ENEA_VERSION}-x86_64.qcow2" "gz" +create_empty_image "enea-${ENEA_VERSION}-ppc.qcow2" "gz" +create_empty_image "enea-${ENEA_VERSION}-ppc64.qcow2" "gz" +if [ "$ARCH" = "x86_64" ]; then + #get_image "http://172.21.3.124/~jori/jeos/" "jeos-${JEOS_VERSION}.qcow2" "bz2" + get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.qcow2" "gz" +elif [ "$ARCH" = "ppc" -o "$ARCH" = "ppc64" ]; then + get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.uImage" "" + get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.cpio.gz" "" +else + echo "ERROR: Architecture '$ARCH' not supported" + exit 1 +fi + +# Create virbr0 +if ! [ -e /sys/class/net/virbr0 ]; then + ip link add virbr0 type bridge + ip addr add dev virbr0 10.99.99.1/24 + ip link set virbr0 up + /etc/init.d/dnsmasq stop + sleep 5 + /etc/init.d/dnsmasq start +fi + +# Run tests +cd /opt/virt-test/ +QEMU_BIN=`which qemu-system-$ARCH` +OPTS="--qemu-bin=$QEMU_BIN --qemu_sandbox=off --no-downloads" +if ! [ "$VERBOSE" = "" ]; then + OPTS="$OPTS -v" +fi + +declare -a TEST_SUITE TEST_SUITE_EXTRAOPTS TEST_CASES + +TEST_SUITE[0]="qemu" +TEST_SUITE_EXTRAOPTS[0]="" +TEST_CASES[0]="check_clock_offset.with_syscall,migrate.default.fd" + +TEST_SUITE[1]="libvirt" +TEST_SUITE_EXTRAOPTS[1]="" +if [ "$ARCH" = "x86_64" ]; then + TEST_SUITE_EXTRAOPTS[1]="--machine-type=q35" +fi +TEST_CASES[1]="virsh.volume" + +for (( i=0; i<${#TEST_SUITE[@]}; i++ )); do + # Update machine.cfg + cp /opt/virt-test/shared/cfg/machines.cfg \ + /opt/virt-test/backends/${TEST_SUITE[$i]}/cfg/ + + # Run tests + echo "# Running ${TEST_SUITE[$i]} tests ${TEST_CASES[$i]}" + ./run $OPTS ${TEST_SUITE_EXTRAOPTS[$i]} -g Enea -t "${TEST_SUITE[$i]}" \ + --tests="${TEST_CASES[$i]}" --arch=$ARCH 2>&1 \ + | filter_output "${TEST_SUITE[$i]}" +done diff --git a/recipes-append/systest-runner/systest-runner.bbappend b/recipes-append/systest-runner/systest-runner.bbappend new file mode 100644 index 0000000..9c6dc67 --- /dev/null +++ b/recipes-append/systest-runner/systest-runner.bbappend @@ -0,0 +1,12 @@ +FILESEXTRAPATHS_append := ":${THISDIR}/files" + +VIRT_TEST_SRC_URI = "file://tests/virt-test" +SRC_URI_append_corei7-64-intel-common = "${VIRT_TEST_SRC_URI}" +SRC_URI_append_e500mc = "${VIRT_TEST_SRC_URI}" +SRC_URI_append_b4860qds-64b = "${VIRT_TEST_SRC_URI}" + +VIRT_TEST_RDEPENDS = "lvm2 e2fsprogs virt-test virt-test-libvirt virt-test-qemu \ + ntpdate bzip2 coreutils" +RDEPENDS_${PN}_append_corei7-64-intel-common = "${VIRT_TEST_RDEPENDS}" +RDEPENDS_${PN}_append_e500mc = "${VIRT_TEST_RDEPENDS}" +RDEPENDS_${PN}_append_b4860qds-64b = "${VIRT_TEST_RDEPENDS}" diff --git a/recipes-containers/lxc/files/init-lxc-mount b/recipes-containers/lxc/files/init-lxc-mount new file mode 100755 index 0000000..c4c77df --- /dev/null +++ b/recipes-containers/lxc/files/init-lxc-mount @@ -0,0 +1,12 @@ +#!/bin/sh -e + +mkdir -p /sys/fs/cgroup/cpuset +mkdir -p /sys/fs/cgroup/cpu,cpuacct +mkdir -p /sys/fs/cgroup/devices +mkdir -p /sys/fs/cgroup/freezer +mkdir -p /sys/fs/cgroup/memory +mount cpuset +mount cpuacct +mount devices +mount freezer +mount memory diff --git a/recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch b/recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch new file mode 100644 index 0000000..4eecfaa --- /dev/null +++ b/recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch @@ -0,0 +1,51 @@ +lxc: Modify lxc-busybox to support Enea Linux + +In Enea Linux, the busybox commands are split between busybox.nosuid (symlinked +as /bin/busybox) and busybox.suid. This patch enables the commands provided by +the latter and also replaces the busybox init with the SysV counterpart. + +Upstream-Status: Pending + +Signed-off-by: Petre Pircalabu + +--- a/templates/lxc-busybox.in ++++ b/templates/lxc-busybox.in +@@ -129,6 +129,7 @@ EOF + # and propose a shell on the tty, the last one is + # not needed + cat <> $rootfs/etc/inittab ++id:5:initdefault: + ::sysinit:/etc/init.d/rcS + tty1::respawn:/bin/getty -L tty1 115200 vt100 + console::askfirst:/bin/sh +@@ -209,8 +210,28 @@ configure_busybox() + xargs -n1 ln -s busybox + popd > /dev/null + +- # relink /sbin/init +- ln $rootfs/bin/busybox $rootfs/sbin/init ++ which busybox.suid >/dev/null 2>&1 ++ ++ if [ $? -eq 0 ]; then ++ # copy busybox.suid in the rootfs ++ cp $(which busybox.suid) $rootfs/bin ++ if [ $? -ne 0 ]; then ++ echo "failed to copy busybox.suid in the rootfs" ++ return 1 ++ fi ++ ++ pushd $rootfs/bin > /dev/null || return 1 ++ ./busybox.suid --help | grep 'Currently defined functions:' -A300 | \ ++ grep -v 'Currently defined functions:' | tr , '\n' | \ ++ xargs -n1 ln -s busybox.suid ++ popd > /dev/null ++ fi ++ ++ # use SysV init ++ pushd $rootfs/sbin > /dev/null || return 1 ++ cp /sbin/init.sysvinit . ++ ln -s init.sysvinit init ++ popd > /dev/null + + # passwd exec must be setuid + chmod +s $rootfs/bin/passwd diff --git a/recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch b/recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch new file mode 100644 index 0000000..88d2450 --- /dev/null +++ b/recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch @@ -0,0 +1,24 @@ +lxc: Update lxc-test-attach + +For Enea Linux, the SysV init file is different from busybox, causing cmp to +return an error. In order to preserve the test's logic it was replaced with a +command which succeeds in every situation: +(e.g. search for root in /etc/passwd using grep). + +Upstream-Status: Pending + +Signed-off-by: Petre Pircalabu + +--- a/src/tests/attach.c ++++ b/src/tests/attach.c +@@ -237,8 +237,8 @@ static int test_attach_cmd(struct lxc_co + { + int ret; + pid_t pid; +- char *argv[] = {"cmp", "-s", "/sbin/init", "/bin/busybox", NULL}; +- lxc_attach_command_t command = {"cmp", argv}; ++ char *argv[] = {"grep", "-q", "root", "/etc/passwd", NULL}; ++ lxc_attach_command_t command = {"grep", argv}; + lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; + + TSTOUT("Testing attach with success command...\n"); diff --git a/recipes-containers/lxc/lxc_1.0.1.bbappend b/recipes-containers/lxc/lxc_1.0.1.bbappend new file mode 100644 index 0000000..84a1cb5 --- /dev/null +++ b/recipes-containers/lxc/lxc_1.0.1.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS_append := ":${THISDIR}/files" +SRC_URI_append = " file://init-lxc-mount" +SRC_URI_append = " file://lxc-busybox-support-enea-linux-init.patch" +SRC_URI_append = " file://lxc-test-attach-replace-cmp-with-grep.patch" + +inherit update-rc.d + +INITSCRIPT_NAME = "init-lxc-mount" + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/init-lxc-mount ${D}${sysconfdir}/init.d/init-lxc-mount +} + +FILES_${PN} += "${sysconfdir}/init.d/init-lxc-mount" diff --git a/recipes-core/base-files/base-files_3.0.14.bbappend b/recipes-core/base-files/base-files_3.0.14.bbappend new file mode 100644 index 0000000..98b5395 --- /dev/null +++ b/recipes-core/base-files/base-files_3.0.14.bbappend @@ -0,0 +1,13 @@ +do_install_append() { +# Add cgroups to /etc/fstab + echo "# For LXC" >> ${D}${sysconfdir}/fstab + echo "cgroup /sys/fs/cgroup tmpfs defaults 0 0" >> ${D}${sysconfdir}/fstab + echo "cpuset /sys/fs/cgroup/cpuset cgroup cpuset,noauto 0 0" >> ${D}${sysconfdir}/fstab + echo "cpuacct /sys/fs/cgroup/cpu,cpuacct cgroup cpuacct,cpu,noauto 0 0" >> ${D}${sysconfdir}/fstab + echo "devices /sys/fs/cgroup/devices cgroup devices,noauto 0 0" >> ${D}${sysconfdir}/fstab + echo "freezer /sys/fs/cgroup/freezer cgroup freezer,noauto 0 0" >> ${D}${sysconfdir}/fstab + echo "memory /sys/fs/cgroup/memory cgroup memory,noauto 0 0" >> ${D}${sysconfdir}/fstab +# Fix for multiple dnsmasq instances when using libvirt. + echo "interface=eth0" >> ${D}${sysconfdir}/dnsmasq.conf + echo "bind-interfaces" >> ${D}${sysconfdir}/dnsmasq.conf +} diff --git a/recipes-core/packagegroups/packagegroup-enea-virt-test-guest.bb b/recipes-core/packagegroups/packagegroup-enea-virt-test-guest.bb new file mode 100644 index 0000000..1d80ecc --- /dev/null +++ b/recipes-core/packagegroups/packagegroup-enea-virt-test-guest.bb @@ -0,0 +1,27 @@ +DESCRIPTION = "Package group for virt-test guest OS support" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +PR = "r0" + +def if_arch_re(regexp, trueval, falseval, d): + import re + target_arch = bb.data.getVar('TUNE_ARCH', d, 1) + return trueval if re.match(regexp, target_arch) else falseval + +inherit packagegroup + +RDEPENDS_${PN} = " \ + procps \ + netcat-openbsd \ + tcpdump \ + tar \ + rt-tests \ + virt-test-guest-scripts-bin \ + virt-test-qemu-guest-timedrift \ + virt-test-qemu-guest-clock-getres \ + ${@if_arch_re("^(i[3-9]86|x86_64)", "virt-test-qemu-guest-nx", "", d)} \ + ${@if_arch_re("^(i[3-9]86|x86_64)", "virt-test-qemu-guest-cpuflags", "", d)} \ + ${@if_arch_re("^(i[3-9]86|x86_64)", "virt-test-qemu-guest-tsc-sync", "", d)} \ + " + diff --git a/recipes-core/packagegroups/packagegroup-enea-virt.bb b/recipes-core/packagegroups/packagegroup-enea-virt.bb new file mode 100644 index 0000000..8015224 --- /dev/null +++ b/recipes-core/packagegroups/packagegroup-enea-virt.bb @@ -0,0 +1,35 @@ +DESCRIPTION = "Package group for virtualization" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +PR = "r0" + +inherit packagegroup + +def if_arch_re(regexp, trueval, falseval, d): + import re + target_arch = bb.data.getVar('TUNE_ARCH', d, 1) + return trueval if re.match(regexp, target_arch) else falseval + +RDEPENDS_${PN} = " \ + qemu \ + libvirt \ + libvirt-libvirtd \ + libvirt-virsh \ + ${@if_arch_re("^(i[3-9]86|x86_64)", "kernel-module-kvm", "", d)} \ + ${@if_arch_re("^(i[3-9]86|x86_64)", "kernel-module-kvm-intel", "", d)} \ + lxc \ + " + +RDEPENDS_${PN}_remove_p2020rdb = " \ + qemu \ + " + +RDEPENDS_${PN}_remove_b4860qds-64b = " \ + qemu \ + " + +RDEPENDS_${PN}_remove_zc702-zynq7 = " \ + qemu \ + " + diff --git a/recipes-example/virt-example/files/LICENSE b/recipes-example/virt-example/files/LICENSE new file mode 100644 index 0000000..22b249d --- /dev/null +++ b/recipes-example/virt-example/files/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2014 by Enea Software AB +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Enea Software AB nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/recipes-example/virt-example/files/example-container.conf b/recipes-example/virt-example/files/example-container.conf new file mode 100644 index 0000000..e2e8d5e --- /dev/null +++ b/recipes-example/virt-example/files/example-container.conf @@ -0,0 +1,50 @@ +#Copyright (c) 2014 by Enea Software AB +#All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Enea Software AB nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +#ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +#(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +#ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +lxc.tty = 2 +lxc.pts = 2 +lxc.rootfs = /container-images/example-container-rootfs/ +lxc.autodev = 1 +lxc.cgroup.cpuset.cpus = 3 + +lxc.cgroup.devices.deny = a +# /dev/null and zero +lxc.cgroup.devices.allow = c 1:3 rwm +lxc.cgroup.devices.allow = c 1:5 rwm +# /dev/{,u}random +lxc.cgroup.devices.allow = c 1:9 rwm +lxc.cgroup.devices.allow = c 1:8 rwm +# pts consoles +lxc.cgroup.devices.allow = c 136:* rwm +lxc.cgroup.devices.allow = c 5:2 rwm +# rtc +lxc.cgroup.devices.allow = c 254:0 rwm + +lxc.utsname = example-container + +lxc.network.type = veth +lxc.network.link = example-bridge +lxc.network.veth.pair = example-veth +lxc.network.flags = up diff --git a/recipes-example/virt-example/files/example-guest-x86.xml b/recipes-example/virt-example/files/example-guest-x86.xml new file mode 100644 index 0000000..a3d4f6a --- /dev/null +++ b/recipes-example/virt-example/files/example-guest-x86.xml @@ -0,0 +1,71 @@ + + + + kvm-example-guest + 2000000 + 2 + + hvm + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes-example/virt-example/files/example-net.xml b/recipes-example/virt-example/files/example-net.xml new file mode 100644 index 0000000..c8cbca7 --- /dev/null +++ b/recipes-example/virt-example/files/example-net.xml @@ -0,0 +1,39 @@ + + + + virt-example-net + + + + + + + + + + diff --git a/recipes-example/virt-example/files/pxe/pxelinux.cfg/default b/recipes-example/virt-example/files/pxe/pxelinux.cfg/default new file mode 100755 index 0000000..753d6db --- /dev/null +++ b/recipes-example/virt-example/files/pxe/pxelinux.cfg/default @@ -0,0 +1,10 @@ +SERIAL 0 115200 0xab3 + +DEFAULT kvm-example + +LABEL kvm-example + kernel bzImage + append console=ttyS0,115200n8 initrd=enea-image-kvm-example-guest.cpio.gz + +PROMPT 1 +TIMEOUT 0 diff --git a/recipes-example/virt-example/virt-example_1.0.0.bb b/recipes-example/virt-example/virt-example_1.0.0.bb new file mode 100644 index 0000000..1840d13 --- /dev/null +++ b/recipes-example/virt-example/virt-example_1.0.0.bb @@ -0,0 +1,34 @@ +DESCRIPTION = "KVM and libvirt examples" + +FILESEXTRAPATHS_append := ":${THISDIR}/files" + +SRC_URI = " \ + file://example-container.conf \ + file://example-guest-x86.xml \ + file://example-net.xml \ + file://LICENSE \ + file://pxe/pxelinux.cfg/default \ +" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=b52bab7a403562f36be803f11489f1a4" + +S = "${WORKDIR}" + +DESTDIR = "/usr/share/${PN}/" + +FILES_${PN} = " \ + ${DESTDIR}example-container.conf \ + ${DESTDIR}example-guest-x86.xml \ + ${DESTDIR}example-net.xml \ + ${DESTDIR}pxe/pxelinux.cfg/default \ +" + +do_install() { + install -d ${D}${DESTDIR} + install -d ${D}${DESTDIR}pxe/pxelinux.cfg/ + install ${WORKDIR}/pxe/pxelinux.cfg/default ${D}${DESTDIR}pxe/pxelinux.cfg/ + install ${WORKDIR}/example-container.conf ${D}${DESTDIR} + install ${WORKDIR}/example-guest-x86.xml ${D}${DESTDIR} + install ${WORKDIR}/example-net.xml ${D}${DESTDIR} +} diff --git a/recipes-extra/python-urlgrabber/python-urlgrabber/pycurl-curl.patch b/recipes-extra/python-urlgrabber/python-urlgrabber/pycurl-curl.patch new file mode 100644 index 0000000..50f87e8 --- /dev/null +++ b/recipes-extra/python-urlgrabber/python-urlgrabber/pycurl-curl.patch @@ -0,0 +1,288 @@ +It seems that pycurl has been renamed to curl. + +Signed-off-by: Jonas Eriksson +Upstream-Status: Pending +diff -uNrp urlgrabber-3.10.1.orig/urlgrabber/grabber.py urlgrabber-3.10.1/urlgrabber/grabber.py +--- urlgrabber-3.10.1.orig/urlgrabber/grabber.py 2014-03-04 17:08:52.345678844 +0100 ++++ urlgrabber-3.10.1/urlgrabber/grabber.py 2014-03-04 17:09:49.074595399 +0100 +@@ -88,7 +88,7 @@ GENERAL ARGUMENTS (kwargs) + a positive integer expressing the number of seconds to wait before + timing out attempts to connect to a server. If the value is None + or 0, connection attempts will not time out. The timeout is passed +- to the underlying pycurl object as its CONNECTTIMEOUT option, see ++ to the underlying curl object as its CONNECTTIMEOUT option, see + the curl documentation on CURLOPT_CONNECTTIMEOUT for more information. + http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTCONNECTTIMEOUT + +@@ -509,7 +509,7 @@ import mimetools + import thread + import types + import stat +-import pycurl ++import curl + from ftplib import parse150 + from StringIO import StringIO + from httplib import HTTPException +@@ -821,7 +821,7 @@ class URLParser: + + def process_http(self, parts, url): + (scheme, host, path, parm, query, frag) = parts +- # TODO: auth-parsing here, maybe? pycurl doesn't really need it ++ # TODO: auth-parsing here, maybe? curl doesn't really need it + return (scheme, host, path, parm, query, frag) + + def quote(self, parts): +@@ -983,7 +983,7 @@ class URLGrabberOptions: + self.username = None + self.password = None + self.ssl_ca_cert = None # sets SSL_CAINFO - path to certdb +- self.ssl_context = None # no-op in pycurl ++ self.ssl_context = None # no-op in curl + self.ssl_verify_peer = True # check peer's cert for authenticityb + self.ssl_verify_host = True # make sure who they are and who the cert is for matches + self.ssl_key = None # client key +@@ -1355,7 +1355,7 @@ class PyCurlFileObject(object): + + return len(buf) + except KeyboardInterrupt: +- return pycurl.READFUNC_ABORT ++ return curl.READFUNC_ABORT + + def _return_hdr_obj(self): + if self._parsed_hdr: +@@ -1370,7 +1370,7 @@ class PyCurlFileObject(object): + + hdr = property(_return_hdr_obj) + http_code = property(fget= +- lambda self: self.curl_obj.getinfo(pycurl.RESPONSE_CODE)) ++ lambda self: self.curl_obj.getinfo(curl.RESPONSE_CODE)) + + def _set_opts(self, opts={}): + # XXX +@@ -1379,109 +1379,109 @@ class PyCurlFileObject(object): + + # keepalives + if not opts.keepalive: +- self.curl_obj.setopt(pycurl.FORBID_REUSE, 1) ++ self.curl_obj.setopt(curl.FORBID_REUSE, 1) + + # defaults we're always going to set +- self.curl_obj.setopt(pycurl.NOPROGRESS, False) +- self.curl_obj.setopt(pycurl.NOSIGNAL, True) +- self.curl_obj.setopt(pycurl.WRITEFUNCTION, self._retrieve) +- self.curl_obj.setopt(pycurl.HEADERFUNCTION, self._hdr_retrieve) +- self.curl_obj.setopt(pycurl.PROGRESSFUNCTION, self._progress_update) +- self.curl_obj.setopt(pycurl.FAILONERROR, True) +- self.curl_obj.setopt(pycurl.OPT_FILETIME, True) +- self.curl_obj.setopt(pycurl.FOLLOWLOCATION, True) ++ self.curl_obj.setopt(curl.NOPROGRESS, False) ++ self.curl_obj.setopt(curl.NOSIGNAL, True) ++ self.curl_obj.setopt(curl.WRITEFUNCTION, self._retrieve) ++ self.curl_obj.setopt(curl.HEADERFUNCTION, self._hdr_retrieve) ++ self.curl_obj.setopt(curl.PROGRESSFUNCTION, self._progress_update) ++ self.curl_obj.setopt(curl.FAILONERROR, True) ++ self.curl_obj.setopt(curl.OPT_FILETIME, True) ++ self.curl_obj.setopt(curl.FOLLOWLOCATION, True) + + if DEBUG and DEBUG.level <= 10: +- self.curl_obj.setopt(pycurl.VERBOSE, True) ++ self.curl_obj.setopt(curl.VERBOSE, True) + if opts.user_agent: +- self.curl_obj.setopt(pycurl.USERAGENT, opts.user_agent) ++ self.curl_obj.setopt(curl.USERAGENT, opts.user_agent) + if opts.ip_resolve: + # Default is: IPRESOLVE_WHATEVER + ipr = opts.ip_resolve.lower() + if ipr == 'whatever': # Do we need this? +- self.curl_obj.setopt(pycurl.IPRESOLVE,pycurl.IPRESOLVE_WHATEVER) ++ self.curl_obj.setopt(curl.IPRESOLVE,curl.IPRESOLVE_WHATEVER) + if ipr == 'ipv4': +- self.curl_obj.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V4) ++ self.curl_obj.setopt(curl.IPRESOLVE, curl.IPRESOLVE_V4) + if ipr == 'ipv6': +- self.curl_obj.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V6) ++ self.curl_obj.setopt(curl.IPRESOLVE, curl.IPRESOLVE_V6) + + # maybe to be options later +- self.curl_obj.setopt(pycurl.FOLLOWLOCATION, True) +- self.curl_obj.setopt(pycurl.MAXREDIRS, 5) ++ self.curl_obj.setopt(curl.FOLLOWLOCATION, True) ++ self.curl_obj.setopt(curl.MAXREDIRS, 5) + + # timeouts + timeout = 300 + if hasattr(opts, 'timeout'): + timeout = int(opts.timeout or 0) +- self.curl_obj.setopt(pycurl.CONNECTTIMEOUT, timeout) +- self.curl_obj.setopt(pycurl.LOW_SPEED_LIMIT, opts.minrate or 1000) +- self.curl_obj.setopt(pycurl.LOW_SPEED_TIME, timeout) ++ self.curl_obj.setopt(curl.CONNECTTIMEOUT, timeout) ++ self.curl_obj.setopt(curl.LOW_SPEED_LIMIT, opts.minrate or 1000) ++ self.curl_obj.setopt(curl.LOW_SPEED_TIME, timeout) + + # ssl options + if self.scheme == 'https': + if opts.ssl_ca_cert: # this may do ZERO with nss according to curl docs +- self.curl_obj.setopt(pycurl.CAPATH, opts.ssl_ca_cert) +- self.curl_obj.setopt(pycurl.CAINFO, opts.ssl_ca_cert) +- self.curl_obj.setopt(pycurl.SSL_VERIFYPEER, opts.ssl_verify_peer) ++ self.curl_obj.setopt(curl.CAPATH, opts.ssl_ca_cert) ++ self.curl_obj.setopt(curl.CAINFO, opts.ssl_ca_cert) ++ self.curl_obj.setopt(curl.SSL_VERIFYPEER, opts.ssl_verify_peer) + if opts.ssl_verify_host: # 1 is meaningless to curl +- self.curl_obj.setopt(pycurl.SSL_VERIFYHOST, 2) ++ self.curl_obj.setopt(curl.SSL_VERIFYHOST, 2) + if opts.ssl_key: +- self.curl_obj.setopt(pycurl.SSLKEY, opts.ssl_key) ++ self.curl_obj.setopt(curl.SSLKEY, opts.ssl_key) + if opts.ssl_key_type: +- self.curl_obj.setopt(pycurl.SSLKEYTYPE, opts.ssl_key_type) ++ self.curl_obj.setopt(curl.SSLKEYTYPE, opts.ssl_key_type) + if opts.ssl_cert: +- self.curl_obj.setopt(pycurl.SSLCERT, opts.ssl_cert) ++ self.curl_obj.setopt(curl.SSLCERT, opts.ssl_cert) + # if we have a client side cert - turn off reuse b/c nss is odd +- self.curl_obj.setopt(pycurl.FORBID_REUSE, 1) ++ self.curl_obj.setopt(curl.FORBID_REUSE, 1) + if opts.ssl_cert_type: +- self.curl_obj.setopt(pycurl.SSLCERTTYPE, opts.ssl_cert_type) ++ self.curl_obj.setopt(curl.SSLCERTTYPE, opts.ssl_cert_type) + if opts.ssl_key_pass: +- self.curl_obj.setopt(pycurl.SSLKEYPASSWD, opts.ssl_key_pass) ++ self.curl_obj.setopt(curl.SSLKEYPASSWD, opts.ssl_key_pass) + + #headers: + if opts.http_headers and self.scheme in ('http', 'https'): + headers = [] + for (tag, content) in opts.http_headers: + headers.append('%s:%s' % (tag, content)) +- self.curl_obj.setopt(pycurl.HTTPHEADER, headers) ++ self.curl_obj.setopt(curl.HTTPHEADER, headers) + + # ranges: + if opts.range or opts.reget: + range_str = self._build_range() + if range_str: +- self.curl_obj.setopt(pycurl.RANGE, range_str) ++ self.curl_obj.setopt(curl.RANGE, range_str) + + # throttle/bandwidth + if hasattr(opts, 'raw_throttle') and opts.raw_throttle(): +- self.curl_obj.setopt(pycurl.MAX_RECV_SPEED_LARGE, int(opts.raw_throttle())) ++ self.curl_obj.setopt(curl.MAX_RECV_SPEED_LARGE, int(opts.raw_throttle())) + + # proxy + if opts.proxy is not None: +- self.curl_obj.setopt(pycurl.PROXY, opts.proxy) +- self.curl_obj.setopt(pycurl.PROXYAUTH, ++ self.curl_obj.setopt(curl.PROXY, opts.proxy) ++ self.curl_obj.setopt(curl.PROXYAUTH, + # All but Kerberos. BZ 769254 +- pycurl.HTTPAUTH_ANY - pycurl.HTTPAUTH_GSSNEGOTIATE) ++ curl.HTTPAUTH_ANY - curl.HTTPAUTH_GSSNEGOTIATE) + + if opts.username and opts.password: + if self.scheme in ('http', 'https'): +- self.curl_obj.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_ANY) ++ self.curl_obj.setopt(curl.HTTPAUTH, curl.HTTPAUTH_ANY) + + if opts.username and opts.password: + # apparently when applying them as curlopts they do not require quoting of any kind + userpwd = '%s:%s' % (opts.username, opts.password) +- self.curl_obj.setopt(pycurl.USERPWD, userpwd) ++ self.curl_obj.setopt(curl.USERPWD, userpwd) + + #posts - simple - expects the fields as they are + if opts.data: +- self.curl_obj.setopt(pycurl.POST, True) +- self.curl_obj.setopt(pycurl.POSTFIELDS, _to_utf8(opts.data)) ++ self.curl_obj.setopt(curl.POST, True) ++ self.curl_obj.setopt(curl.POSTFIELDS, _to_utf8(opts.data)) + + # ftp + if opts.ftp_disable_epsv: +- self.curl_obj.setopt(pycurl.FTP_USE_EPSV, False) ++ self.curl_obj.setopt(curl.FTP_USE_EPSV, False) + + # our url +- self.curl_obj.setopt(pycurl.URL, self.url) ++ self.curl_obj.setopt(curl.URL, self.url) + + + def _do_perform(self): +@@ -1490,7 +1490,7 @@ class PyCurlFileObject(object): + + try: + self.curl_obj.perform() +- except pycurl.error, e: ++ except curl.error, e: + # XXX - break some of these out a bit more clearly + # to other URLGrabErrors from + # http://curl.haxx.se/libcurl/c/libcurl-errors.html +@@ -1505,11 +1505,11 @@ class PyCurlFileObject(object): + + if errcode == 23 and 200 <= code <= 299: + # this is probably wrong but ultimately this is what happens +- # we have a legit http code and a pycurl 'writer failed' code ++ # we have a legit http code and a curl 'writer failed' code + # which almost always means something aborted it from outside + # since we cannot know what it is -I'm banking on it being + # a ctrl-c. XXXX - if there's a way of going back two raises to +- # figure out what aborted the pycurl process FIXME ++ # figure out what aborted the curl process FIXME + raise getattr(self, '_cb_error', KeyboardInterrupt) + + elif errcode == 28: +@@ -1519,11 +1519,11 @@ class PyCurlFileObject(object): + + elif errcode == 42: + # this is probably wrong but ultimately this is what happens +- # we have a legit http code and a pycurl 'writer failed' code ++ # we have a legit http code and a curl 'writer failed' code + # which almost always means something aborted it from outside + # since we cannot know what it is -I'm banking on it being + # a ctrl-c. XXXX - if there's a way of going back two raises to +- # figure out what aborted the pycurl process FIXME ++ # figure out what aborted the curl process FIXME + raise KeyboardInterrupt + + else: +@@ -1750,7 +1750,7 @@ class PyCurlFileObject(object): + pass # URL too long. = IOError ... ignore everything. + + # set the time +- mod_time = self.curl_obj.getinfo(pycurl.INFO_FILETIME) ++ mod_time = self.curl_obj.getinfo(curl.INFO_FILETIME) + if mod_time != -1: + try: + os.utime(self.filename, (mod_time, mod_time)) +@@ -1863,7 +1863,7 @@ class PyCurlFileObject(object): + + msg = _("Downloaded more than max size for %s: %s > %s") \ + % (self.url, cur, max_size) +- self._error = (pycurl.E_FILESIZE_EXCEEDED, msg) ++ self._error = (curl.E_FILESIZE_EXCEEDED, msg) + return True + return False + +@@ -1903,16 +1903,16 @@ class PyCurlFileObject(object): + urllib.addinfourl, via. urllib.URLopener.* """ + return self.url + +-if hasattr(pycurl, 'GLOBAL_ACK_EINTR'): ++if hasattr(curl, 'GLOBAL_ACK_EINTR'): + # fail immediately on ctrl-c +- pycurl.global_init(pycurl.GLOBAL_DEFAULT | pycurl.GLOBAL_ACK_EINTR) +-_curl_cache = pycurl.Curl() # make one and reuse it over and over and over ++ curl.global_init(curl.GLOBAL_DEFAULT | curl.GLOBAL_ACK_EINTR) ++_curl_cache = curl.Curl() # make one and reuse it over and over and over + + def reset_curl_obj(): + """To make sure curl has reread the network/dns info we force a reload""" + global _curl_cache + _curl_cache.close() +- _curl_cache = pycurl.Curl() ++ _curl_cache = curl.Curl() + + _libproxy_cache = None + diff --git a/recipes-extra/python-urlgrabber/python-urlgrabber_3.10.1.bb b/recipes-extra/python-urlgrabber/python-urlgrabber_3.10.1.bb new file mode 100644 index 0000000..97dab20 --- /dev/null +++ b/recipes-extra/python-urlgrabber/python-urlgrabber_3.10.1.bb @@ -0,0 +1,37 @@ +DESCRIPTION = "urlgrabber is a pure python package that drastically simplifies the fetching of files." + +HOMEPAGE = "http://urlgrabber.baseurl.org/" +SECTION = "devel/python" +PRIORITY = "optional" +LICENSE = "LGPL2.1+" +PR = "r1" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=68ad62c64cc6c620126241fd429e68fe" + +SRC_URI = "http://urlgrabber.baseurl.org/download/urlgrabber-${PV}.tar.gz \ + file://pycurl-curl.patch" + +S = "${WORKDIR}/urlgrabber-${PV}" + +SRC_URI[md5sum] = "1f5dc63805623cc473e06204fd240bb2" +SRC_URI[sha256sum] = "06b13ff8d527dba3aee04069681b2c09c03117592d5485a80ae4b807cdf33476" + +RDEPENDS_${PN} = "python-pycurl" + +inherit distutils + +FILES_${PN} += "/usr/share/libexec" + +# setup.py will try to include the urlgrabber package, which fails since we +# don't have pycurl in the native sysroot. It's included just to get the +# version and description text strings for inclusion in the package. Avoid this +# by dynamically creating a version of urlgrabber that does not include the +# actual urlgrabber features, that setup.py can include. +do_patch() { + # Create a non-importing version of urlgrabber for the setup script + mkdir ${S}/urlgrabber_version + sed 's/^from grabber import.*//' ${S}/urlgrabber/__init__.py > ${S}/urlgrabber_version/__init__.py + + # Make sure the setup script uses the version-only urlgrabber + sed -i 's/import urlgrabber/&_version/' ${S}/setup.py +} diff --git a/recipes-extra/virt-manager/virt-manager_1.0.0.bb b/recipes-extra/virt-manager/virt-manager_1.0.0.bb new file mode 100644 index 0000000..21ad3bb --- /dev/null +++ b/recipes-extra/virt-manager/virt-manager_1.0.0.bb @@ -0,0 +1,72 @@ +SUMMARY = "virt-manager" +DESCRIPTION = "virt-manager" +HOMEPAGE = "http://virt-manager.org" +SECTION = "devel" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" + +SRC_URI = "https://fedorahosted.org/released/virt-manager/virt-manager-${PV}.tar.gz" +SRC_URI[sha256sum] = "2b2f59f7fccd2fcfbaf4306e33342e5d2be8f0ddd71af9eeca0c1f215e1e29aa" +SRC_URI[md5sum] = "8a0585de48d8060a5394aae912342c95" + +sharedir = "${datadir}" + +FILES_${PN} = " \ + ${bindir}/virt-clone \ + ${bindir}/virt-image \ + ${bindir}/virt-install \ + ${bindir}/virt-convert \ + ${bindir}/virt-xml \ + ${sharedir}/virt-manager/virt-clone \ + ${sharedir}/virt-manager/virt-image \ + ${sharedir}/virt-manager/virt-install \ + ${sharedir}/virt-manager/virt-convert \ + ${sharedir}/virt-manager/virt-xml \ + ${sharedir}/virt-manager/virtinst \ + ${sharedir}/virt-manager/virtconv \ + ${sharedir}/virt-manager/virtcli \ + \ + ${sharedir}/virt-manager/virt-manager \ + ${sharedir}/virt-manager/virtManager \ + ${sharedir}/virt-manager/ui \ + ${sharedir}/virt-manager/icons \ + ${sharedir}/icons \ + ${sharedir}/appdata \ + ${sharedir}/applications \ + ${sharedir}/glib-2.0 \ + ${@base_contains('DISTRO_FEATURES', 'x11', '${bindir}/virt-manager', '', d)} \ + " + +DEPENDS = "nativesdk-perl" + +RDEPENDS_${PN} = " \ + libvirt-python \ + python-urlgrabber \ + libxml2-python \ + ${@base_contains('DISTRO_FEATURES', 'x11', 'python-pygtk', '', d)} \ + " + + +do_configure() { + python setup.py configure +} + +do_build() { + python setup.py build --prefix=${prefix} +} + +# virt-manager is the only command that requires graphical libraries. The +# package does however not supply a --no-graphics argument or such to the +# install program, which is understandable since distutils (which is +# undocumented to a large degree) seems to be called with the complete file +# list before the argument parsing is performed. To avoid that this command is +# available when the package is built as part of a non-x11 distro, remove the +# /usr/bin/virt-manager file. + +REMOVE_COMMAND = "${@base_contains('DISTRO_FEATURES', 'x11', '', 'rm ${D}${bindir}/virt-manager', d)}" +do_install() { + python setup.py install --prefix=${prefix} --root=${D} + + sh -c "${REMOVE_COMMAND}" +} diff --git a/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch b/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch new file mode 100644 index 0000000..058e676 --- /dev/null +++ b/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch @@ -0,0 +1,29 @@ +From: Stephane Eranian +Date: Wed Apr 23 2014 - 13:04:31 EST +This patch fixes a bug introduced by commit 24223657. + +perf/x86: fix RAPL rdmsrl_safe() usage + +The rdmsrl_safe() function returns 0 on success. +The current code was failing to detect the RAPL PMU +on real hardware (missing /sys/devices/power) because +the return value of rdmsrl_safe() was misinterpreted. + +Signed-off-by: Stephane Eranian +Upstream-Status: Backport [http://lkml.iu.edu/hypermail/linux/kernel/1404.2/05008.html] + +diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c +index 7c87424..619f769 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c +@@ -543,7 +543,8 @@ static int rapl_cpu_prepare(int cpu) + if (phys_id < 0) + return -1; + +- if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) ++ /* protect rdmsrl() to handle virtualization */ ++ if (rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) + return -1; + + pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); +-- diff --git a/recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch b/recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch new file mode 100644 index 0000000..6b29970 --- /dev/null +++ b/recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch @@ -0,0 +1,80 @@ +From 24223657806a0ebd0ae5c9caaf7b021091889cf2 Mon Sep 17 00:00:00 2001 +From: Venkatesh Srinivas +Date: Thu, 13 Mar 2014 12:36:26 -0700 +Subject: [PATCH] perf/x86/intel: Use rdmsrl_safe() when initializing RAPL PMU + +CPUs which should support the RAPL counters according to +Family/Model/Stepping may still issue #GP when attempting to access +the RAPL MSRs. This may happen when Linux is running under KVM and +we are passing-through host F/M/S data, for example. Use rdmsrl_safe +to first access the RAPL_POWER_UNIT MSR; if this fails, do not +attempt to use this PMU. + +Signed-off-by: Venkatesh Srinivas +Signed-off-by: Peter Zijlstra +Link: http://lkml.kernel.org/r/1394739386-22260-1-git-send-email-venkateshs@google.com +Cc: zheng.z.yan@intel.com +Cc: eranian@google.com +Cc: ak@linux.intel.com +Cc: linux-kernel@vger.kernel.org +[ The patch also silently fixes another bug: rapl_pmu_init() didn't handle the memory alloc failure case previously. ] +Signed-off-by: Ingo Molnar +Upstream-Status: Backport +--- + arch/x86/kernel/cpu/perf_event_intel_rapl.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c +index 4b9a9e9..7c87424 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c +@@ -535,6 +535,7 @@ static int rapl_cpu_prepare(int cpu) + struct rapl_pmu *pmu = per_cpu(rapl_pmu, cpu); + int phys_id = topology_physical_package_id(cpu); + u64 ms; ++ u64 msr_rapl_power_unit_bits; + + if (pmu) + return 0; +@@ -542,6 +543,9 @@ static int rapl_cpu_prepare(int cpu) + if (phys_id < 0) + return -1; + ++ if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) ++ return -1; ++ + pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); + if (!pmu) + return -1; +@@ -555,8 +559,7 @@ static int rapl_cpu_prepare(int cpu) + * + * we cache in local PMU instance + */ +- rdmsrl(MSR_RAPL_POWER_UNIT, pmu->hw_unit); +- pmu->hw_unit = (pmu->hw_unit >> 8) & 0x1FULL; ++ pmu->hw_unit = (msr_rapl_power_unit_bits >> 8) & 0x1FULL; + pmu->pmu = &rapl_pmu_class; + + /* +@@ -677,7 +680,9 @@ static int __init rapl_pmu_init(void) + cpu_notifier_register_begin(); + + for_each_online_cpu(cpu) { +- rapl_cpu_prepare(cpu); ++ ret = rapl_cpu_prepare(cpu); ++ if (ret) ++ goto out; + rapl_cpu_init(cpu); + } + +@@ -700,6 +705,7 @@ static int __init rapl_pmu_init(void) + hweight32(rapl_cntr_mask), + ktime_to_ms(pmu->timer_interval)); + ++out: + put_online_cpus(); + + return 0; +-- +1.9.0 + diff --git a/recipes-kernel/linux/linux-keystone_3.10.bbappend b/recipes-kernel/linux/linux-keystone_3.10.bbappend new file mode 100644 index 0000000..7914b77 --- /dev/null +++ b/recipes-kernel/linux/linux-keystone_3.10.bbappend @@ -0,0 +1,13 @@ +SRC_URI += " \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " + +KERNEL_FEATURES_append = "\ + cfg/00040-9p \ + cfg/00041-virtio \ + cfg/00042-vhost \ + cfg/00043-containers \ +" diff --git a/recipes-kernel/linux/linux-qoriq-sdk.bbappend b/recipes-kernel/linux/linux-qoriq-sdk.bbappend new file mode 100644 index 0000000..4e73fd5 --- /dev/null +++ b/recipes-kernel/linux/linux-qoriq-sdk.bbappend @@ -0,0 +1,24 @@ +SRC_URI =+ "\ + file://cfg/00035-netfilter.cfg \ + file://cfg/00036-ppc_virt.cfg \ + file://cfg/00037-ppc_lxc.cfg \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " + +VIRT_FEATURES = "\ + cfg/00035-netfilter \ + cfg/00036-ppc_virt \ + cfg/00037-ppc_lxc \ + cfg/00040-9p \ + cfg/00041-virtio \ + cfg/00042-vhost \ + cfg/00043-containers \ +" + +KERNEL_FEATURES_append_e500v2 = " ${VIRT_FEATURES}" +KERNEL_FEATURES_remove_e500v2 = "cfg/00036-ppc_virt" +KERNEL_FEATURES_append_e500mc = " ${VIRT_FEATURES}" +KERNEL_FEATURES_append_b4860qds-64b = " ${VIRT_FEATURES}" diff --git a/recipes-kernel/linux/linux-xlnx_3.8.bbappend b/recipes-kernel/linux/linux-xlnx_3.8.bbappend new file mode 100644 index 0000000..e4cd65c --- /dev/null +++ b/recipes-kernel/linux/linux-xlnx_3.8.bbappend @@ -0,0 +1,7 @@ +SRC_URI_append = " \ + file://cfg/00035-netfilter.cfg \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " diff --git a/recipes-kernel/linux/linux-yocto_3.10.bbappend b/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000..7791d06 --- /dev/null +++ b/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -0,0 +1,6 @@ +SRC_URI += " \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " diff --git a/recipes-kernel/linux/linux-yocto_3.14.bbappend b/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000..a9cfb3c --- /dev/null +++ b/recipes-kernel/linux/linux-yocto_3.14.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI += "file://perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch \ + file://perf-x86-fix-RAPL-rdmsrl_safe-usage.patch \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " diff --git a/recipes-missing/lksctp-tools/lksctp-tools_1.0.16.bb b/recipes-missing/lksctp-tools/lksctp-tools_1.0.16.bb new file mode 100644 index 0000000..2c229c3 --- /dev/null +++ b/recipes-missing/lksctp-tools/lksctp-tools_1.0.16.bb @@ -0,0 +1,57 @@ +DESCRIPTION = "The Linux Kernel Stream Control Transmission Protocol (lksctp) project" +SECTION = "libs" +LICENSE = "LGPLv2" + +LIC_FILES_CHKSUM = " \ + file://COPYING.lib;md5=0a1b79af951c42a9c8573533fbba9a92 \ + file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \ +" + +SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz" + +SRC_URI[md5sum] = "708bb0b5a6806ad6e8d13c55b067518e" +SRC_URI[sha256sum] = "0903dd526b7f30a89d5031aa2c82757612becc38ed7bc6e4f972f8deae351f26" + +S = "${WORKDIR}/${BP}" + +BBCLASSEXTEND = "native" + +inherit autotools pkgconfig binconfig + +SOLIBVERSION="${PV}" +SOLIBMAJORVERSION="1" + +PACKAGES =+ "${PN}-withsctp ${PN}-utils" + +FILES_${PN} = " \ + ${libdir}/libsctp.so.${SOLIBVERSION} \ +" + +FILES_${PN}-withsctp = " \ + ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBVERSION} \ +" + +FILES_${PN}-dev += " \ + ${libdir}/libsctp.so.${SOLIBMAJORVERSION} \ + ${libdir}/libsctp.so \ + ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBMAJORVERSION} \ + ${libdir}/lksctp-tools/libwithsctp.so \ + ${datadir}/lksctp-tools/checksctp.c \ + ${datadir}/lksctp-tools/sctp_socket.c \ + ${datadir}/lksctp-tools/sctp_status.c \ + ${datadir}/lksctp-tools/sctp_bind.c \ + ${datadir}/lksctp-tools/sctp_darn.c \ + ${datadir}/lksctp-tools/sctp_load_libs.c \ + ${datadir}/lksctp-tools/sctp_sockopt.c \ + ${datadir}/lksctp-tools/sctp_socket.h \ + ${datadir}/lksctp-tools/sctp_test.c \ + ${datadir}/lksctp-tools/sctp_darn.h \ +" + +FILES_${PN}-utils = " \ + ${bindir}/sctp_test \ + ${bindir}/sctp_darn \ + ${bindir}/checksctp \ + ${bindir}/withsctp \ + ${bindir}/sctp_status \ +" diff --git a/recipes-test/autotest/autotest.inc b/recipes-test/autotest/autotest.inc new file mode 100644 index 0000000..c9ac55e --- /dev/null +++ b/recipes-test/autotest/autotest.inc @@ -0,0 +1,17 @@ +SUMMARY = "Autotest framework" +DESCRIPTION = "Autotest - fully automated testing under linux." +HOMEPAGE = "http://autotest.github.io" +SECTION = "console/tests" +LICENSE = "GPLv2 & BSD & LGPLv2+ & MIT" + +SRC_URI = "https://github.com/autotest/autotest/archive/${PV}.tar.gz" + +FILES_${PN} += "/opt /etc/profile.d/autotest.sh" + +do_install() { + install -d ${D}/opt/${PN} + cp -r ${B}/* ${D}/opt/${PN} + + mkdir -p ${D}/etc/profile.d/ + echo "export AUTOTEST_PATH=/opt/${PN}" > ${D}/etc/profile.d/autotest.sh +} diff --git a/recipes-test/autotest/autotest_0.16.0.bb b/recipes-test/autotest/autotest_0.16.0.bb new file mode 100644 index 0000000..d81b39f --- /dev/null +++ b/recipes-test/autotest/autotest_0.16.0.bb @@ -0,0 +1,7 @@ +require autotest.inc + +SRC_URI[md5sum] = "505936dcf2e81daad3231f23ccea1153" +SRC_URI[sha256sum] = "8008c2a8d8456cf007d3089a8590dd6d28d51e57c4d4ebaf7d3b3ac3e2dc422e" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=46bdd99511e3434a768b5e0998fe295a \ + file://LGPL_LICENSE;md5=18b09a20dd186af4fd60f1a08311628c" diff --git a/recipes-test/udt/files/0001-Makefile-use-g-from-environment-if-available.patch b/recipes-test/udt/files/0001-Makefile-use-g-from-environment-if-available.patch new file mode 100644 index 0000000..c7c1b02 --- /dev/null +++ b/recipes-test/udt/files/0001-Makefile-use-g-from-environment-if-available.patch @@ -0,0 +1,44 @@ +From 7a8fce8a763f4ce5d750916cc0aae0c47e6d0a1b Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Thu, 8 May 2014 14:49:21 +0200 +Subject: [PATCH 1/2] Makefile: use g++ from environment if available + +Signed-off-by: Josep Puigdemont + +Upstream-Status: Pending +--- + udt4/app/Makefile | 6 +++++- + udt4/src/Makefile | 6 +++++- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/udt4/app/Makefile b/udt4/app/Makefile +index 9d16c0f..0ee2562 100644 +--- a/udt4/app/Makefile ++++ b/udt4/app/Makefile +@@ -1,4 +1,8 @@ +-C++ = g++ ++ifndef CXX ++ C++ = g++ ++else ++ C++ = $(CXX) ++endif + + ifndef os + os = LINUX +diff --git a/udt4/src/Makefile b/udt4/src/Makefile +index bc1e049..1f64b8d 100644 +--- a/udt4/src/Makefile ++++ b/udt4/src/Makefile +@@ -1,4 +1,8 @@ +-C++ = g++ ++ifndef CXX ++ C++ = g++ ++else ++ C++ = $(CXX) ++endif + + ifndef os + os = LINUX +-- +1.9.0 + diff --git a/recipes-test/udt/files/0002-Makefile-Add-support-for-building-on-powerpc64.patch b/recipes-test/udt/files/0002-Makefile-Add-support-for-building-on-powerpc64.patch new file mode 100644 index 0000000..9192474 --- /dev/null +++ b/recipes-test/udt/files/0002-Makefile-Add-support-for-building-on-powerpc64.patch @@ -0,0 +1,46 @@ +From 9bf5e5746bb57d78162210f7f7cddb002c704f84 Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Thu, 8 May 2014 15:00:07 +0200 +Subject: [PATCH 2/2] Makefile: Add support for building on powerpc64 + +Signed-off-by: Josep Puigdemont + +Upstream-Status: Pending +--- + udt4/app/Makefile | 4 ++++ + udt4/src/Makefile | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/udt4/app/Makefile b/udt4/app/Makefile +index 0ee2562..b046b83 100644 +--- a/udt4/app/Makefile ++++ b/udt4/app/Makefile +@@ -22,6 +22,10 @@ ifeq ($(arch), POWERPC) + CCFLAGS += -mcpu=powerpc + endif + ++ifeq ($(arch), POWERPC64) ++ CCFLAGS += -mcpu=powerpc64 ++endif ++ + ifeq ($(arch), IA64) + CCFLAGS += -DIA64 + endif +diff --git a/udt4/src/Makefile b/udt4/src/Makefile +index 1f64b8d..0d94d48 100644 +--- a/udt4/src/Makefile ++++ b/udt4/src/Makefile +@@ -22,6 +22,10 @@ ifeq ($(arch), POWERPC) + CCFLAGS += -mcpu=powerpc + endif + ++ifeq ($(arch), POWERPC64) ++ CCFLAGS += -mcpu=powerpc64 ++endif ++ + ifeq ($(arch), SPARC) + CCFLAGS += -DSPARC + endif +-- +1.9.0 + diff --git a/recipes-test/udt/files/0003-Makefile-Add-support-for-building-on-ARM7.patch b/recipes-test/udt/files/0003-Makefile-Add-support-for-building-on-ARM7.patch new file mode 100644 index 0000000..45381a4 --- /dev/null +++ b/recipes-test/udt/files/0003-Makefile-Add-support-for-building-on-ARM7.patch @@ -0,0 +1,46 @@ +From 96dafd845546d585616c8d5744c0123dd08b7443 Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Sat, 10 May 2014 17:12:28 +0200 +Subject: [PATCH 3/3] Makefile: Add support for building on ARM7 + +Signed-off-by: Josep Puigdemont +Upstream-Status: Pending + +--- + udt4/app/Makefile | 4 ++++ + udt4/src/Makefile | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/udt4/app/Makefile b/udt4/app/Makefile +index b046b83..5336e2d 100644 +--- a/udt4/app/Makefile ++++ b/udt4/app/Makefile +@@ -34,6 +34,10 @@ ifeq ($(arch), SPARC) + CCFLAGS += -DSPARC + endif + ++ifeq ($(arch), ARM7) ++ CCFLAGS += -mcpu=arm7 ++endif ++ + LDFLAGS = -L../src -ludt -lstdc++ -lpthread -lm + + ifeq ($(os), UNIX) +diff --git a/udt4/src/Makefile b/udt4/src/Makefile +index 0d94d48..4153bcd 100644 +--- a/udt4/src/Makefile ++++ b/udt4/src/Makefile +@@ -38,6 +38,10 @@ ifeq ($(arch), AMD64) + CCFLAGS += -DAMD64 + endif + ++ifeq ($(arch), ARM7) ++ CCFLAGS += -mcpu=arm7 ++endif ++ + OBJS = api.o buffer.o cache.o ccc.o channel.o common.o core.o epoll.o list.o md5.o packet.o queue.o window.o + DIR = $(shell pwd) + +-- +1.9.0 + diff --git a/recipes-test/udt/udt_git.bb b/recipes-test/udt/udt_git.bb new file mode 100644 index 0000000..a2fa358 --- /dev/null +++ b/recipes-test/udt/udt_git.bb @@ -0,0 +1,46 @@ +SUMMARY = "UDP-based Data Transfer" +DESCRIPTION = "UDT is a reliable UDP based application level data transport protocol for distributed data intensive applications over wide area high-speed networks." +HOMEPAGE = "http://udt.sourceforge.net/" +SECTION = "net/utils" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=567e8c8da655afbe9ad8ec73696cc31e" + +SRCREV = "6b4216d8a4c9b8e1e9413ad6cf473f71e7b80502" +SRC_URI = "git://git.code.sf.net/p/udt/git \ + file://0001-Makefile-use-g-from-environment-if-available.patch;striplevel=2 \ + file://0002-Makefile-Add-support-for-building-on-powerpc64.patch;striplevel=2 \ + file://0003-Makefile-Add-support-for-building-on-ARM7.patch;striplevel=2 \ + " + +S = "${WORKDIR}/git/udt4" +B = "${S}" + +FILES_${PN} = "${bindir}/sendfile ${bindir}/recvfile ${libdir}/libudt.so" +FILES_${PN}-dbg = "${bindir}/.debug/* ${libdir}/.debug/*" +FILES_${PN}-dev = "" + +# UDT has a non-standard way of representing architectures +def get_udt_arch(bb, d): + target_arch = bb.data.getVar('TARGET_ARCH', d, 1) + arch_map = { + 'i386': 'IA32', + 'x86_64': 'AMD64', + 'powerpc': 'POWERPC', + 'powerpc64': 'POWERPC64', + 'ia64': 'IA64', + 'arm': 'ARM7', + } + # Let non-existant arches trigger a KeyError + return arch_map[target_arch] + +do_compile() { + make -C ${S} os=LINUX arch=${@get_udt_arch(bb, d)} +} + +do_install() { + install -m 0755 -d ${D}/${bindir} + install -m 0755 ${S}/app/sendfile ${D}/${bindir} + install -m 0755 ${S}/app/recvfile ${D}/${bindir} + install -m 0755 -d ${D}/${libdir} + install -m 0755 ${S}/src/libudt.so ${D}/${libdir} +} diff --git a/recipes-test/virt-test/files/add_enea_linux_support.patch b/recipes-test/virt-test/files/add_enea_linux_support.patch new file mode 100644 index 0000000..0a5f2ba --- /dev/null +++ b/recipes-test/virt-test/files/add_enea_linux_support.patch @@ -0,0 +1,78 @@ +virt-test: Add Enea Linux configuration + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Petre Pircalabu +Signed-off-by: Jonas Eriksson + +--- /dev/null ++++ b/shared/cfg/guest-os/Linux/Enea.cfg +@@ -0,0 +1,4 @@ ++- Enea: ++ no setup ++ shell_prompt = "^.*@.*[\#\$]\s*$" ++ password = "" +--- /dev/null ++++ b/shared/cfg/guest-os/Linux/Enea/4.0_x86_64.cfg +@@ -0,0 +1,3 @@ ++- 4.0.x86_64: ++ image_name = images/enea-4.0-x86_64 ++ vm_arch_name = x86_64 +--- /dev/null ++++ b/shared/cfg/guest-os/Linux/Enea/4.0_ppc.cfg +@@ -0,0 +1,7 @@ ++- 4.0.ppc: ++ image_name = images/enea-4.0-ppc ++ only p4080ds ++ kernel = images/enea-4.0-ppc.uImage ++ initrd = images/enea-4.0-ppc.cpio.gz ++ kernel_params = "console=ttyS0,115200n8" ++ vm_arch_name = ppc +--- /dev/null ++++ b/shared/cfg/guest-os/Linux/Enea/4.0_ppc64.cfg +@@ -0,0 +1,6 @@ ++- 4.0.ppc64: ++ image_name = images/enea-4.0-ppc64 ++ kernel = images/enea-4.0-ppc64.uImage ++ initrd = images/enea-4.0-ppc64.cpio.gz ++ kernel_params = "console=ttyS0,115200n8" ++ vm_arch_name = ppc64 +--- /dev/null ++++ b/shared/downloads/enea-4.0-x86_64.ini +@@ -0,0 +1,5 @@ ++[enea-4.0-x86_64] ++title = Enea Linux 4.0 x86_64 ++destination = images/enea-4.0-x86_64.qcow2.gz ++destination_uncompressed = images/enea-4.0-x86_64.qcow2 ++ +--- /dev/null ++++ b/shared/downloads/enea-4.0-ppc.ini +@@ -0,0 +1,4 @@ ++[enea-4.0-ppc] ++title = Enea Linux 4.0 ppc(32) ++destination = images/enea-4.0-ppc.qcow2.gz ++destination_uncompressed = images/enea-4.0-ppc.qcow2 +--- /dev/null ++++ b/shared/downloads/enea-4.0-ppc64.ini +@@ -0,0 +1,4 @@ ++[enea-4.0-ppc64] ++title = Enea Linux 4.0 ppc64 ++destination = images/enea-4.0-ppc64.qcow2.gz ++destination_uncompressed = images/enea-4.0-ppc64.qcow2 +diff --git a/shared/cfg/machines.cfg b/shared/cfg/machines.cfg +index 0636d17..a81b81c 100644 +--- a/shared/cfg/machines.cfg ++++ b/shared/cfg/machines.cfg +@@ -15,3 +15,12 @@ variants: + - @pseries: + only ppc64 + machine_type = pseries ++ - @p4080ds: ++ only ppc ++ machine_type = ppce500 ++ display = nographic ++ take_regular_screendumps = no ++ direct_serials = "serial0" ++ isa_serials = "" ++ cpu_model = e500mc ++ auto_cpu_model = no diff --git a/recipes-test/virt-test/files/allow_bootstrap_3rd_party_image.patch b/recipes-test/virt-test/files/allow_bootstrap_3rd_party_image.patch new file mode 100644 index 0000000..7e53f59 --- /dev/null +++ b/recipes-test/virt-test/files/allow_bootstrap_3rd_party_image.patch @@ -0,0 +1,233 @@ +virt-test: Bootstrap using other OS images. + +Upstream-Status: Accepted + +Signed-off-by: Petre Pircalabu + +--- a/run ++++ b/run +@@ -10,6 +10,7 @@ import traceback + import signal + import optparse + import logging ++import virttest.defaults + + + class StreamProxy(object): +@@ -173,9 +174,8 @@ class VirtTestRunParser(optparse.OptionP + def __init__(self): + optparse.OptionParser.__init__(self, usage='Usage: %prog [options]') + from virttest import data_dir +- from virttest import bootstrap +- jeos_info = bootstrap.get_jeos_info() +- self.default_guest_os = jeos_info['variant'] ++ os_info = virttest.defaults.get_default_guest_os_info() ++ self.default_guest_os = os_info['variant'] + + try: + qemu_bin_path = _find_default_qemu_paths()[0] +@@ -267,7 +267,7 @@ class VirtTestRunParser(optparse.OptionP + help=("Machine type under test. " + "If -c is provided, this will be ignored. " + "Default: all for the chosen guests, %s if " +- "--guest-os not given." % DEFAULT_MACHINE_TYPE)) ++ "--guest-os not given." % virttest.defaults.DEFAULT_MACHINE_TYPE)) + general.add_option("--tests", action="store", dest="tests", + default="", + help=('List of space separated tests to be ' +@@ -415,7 +415,6 @@ def variant_only_file(filename): + return ", ".join(result) + + +-DEFAULT_MACHINE_TYPE = "i440fx" + QEMU_DEFAULT_SET = "migrate..tcp, migrate..unix, migrate..exec, migrate..fd" + LIBVIRT_DEFAULT_SET = variant_only_file('backends/libvirt/cfg/default_tests') + LVSB_DEFAULT_SET = ("lvsb_date") +@@ -546,7 +545,7 @@ class VirtTestApp(object): + # TODO: this is x86-specific, instead we can get the default + # arch from qemu binary and run on all supported machine types + if self.options.arch is None and self.options.guest_os is None: +- self.cartesian_parser.only_filter(DEFAULT_MACHINE_TYPE) ++ self.cartesian_parser.only_filter(virttest.defaults.DEFAULT_MACHINE_TYPE) + else: + self.cartesian_parser.only_filter(self.options.machine_type) + else: +@@ -827,7 +826,9 @@ class VirtTestApp(object): + selinux=self.options.selinux_setup, + restore_image=keep_image, + verbose=self.options.verbose, +- update_providers=self.options.update_providers) ++ update_providers=self.options.update_providers, ++ guest_os=(self.options.guest_os or ++ self.option_parser.default_guest_os)) + sys.exit(0) + + if self.options.type: +--- a/virttest/bootstrap.py ++++ b/virttest/bootstrap.py +@@ -9,6 +9,7 @@ import data_dir + import asset + import cartesian_config + import utils_selinux ++import defaults + + basic_program_requirements = ['tcpdump', 'nc', 'ip', 'arping'] + +@@ -53,15 +54,30 @@ last_subtest = {'qemu': ['shutdown'], + test_filter = ['__init__', 'cfg', 'dropin.py'] + + +-def get_jeos_info(): ++def get_guest_os_info_list(test_name, guest_os): + """ +- Gets the correct asset and variant information depending on host OS. ++ Returns a list of matching assets compatible with the specified test name ++ and guest OS + """ +- jeos_info = {'asset': 'jeos-19-64', 'variant': 'JeOS.19'} +- issue_contents = utils.read_file('/etc/issue') +- if 'Fedora' in issue_contents and '20' in issue_contents: +- jeos_info = {'asset': 'jeos-20-64', 'variant': 'JeOS.20'} +- return jeos_info ++ ++ os_info_list = [] ++ ++ cartesian_parser = cartesian_config.Parser() ++ cartesian_parser.parse_file(data_dir.get_backend_cfg_path(test_name, 'guest-os.cfg')) ++ cartesian_parser.only_filter(guest_os) ++ dicts = cartesian_parser.get_dicts(); ++ ++ for params in dicts: ++ image_name = params.get('image_name', 'image').split('/')[-1] ++ shortname = params.get('shortname', guest_os) ++ os_info_list.append({'asset': image_name, 'variant': shortname}) ++ ++ if not os_info_list: ++ logging.error("Could not find any assets compatible with %s for %s", ++ guest_os, test_name) ++ raise ValueError("Missing compatible assets for %s", guest_os) ++ ++ return os_info_list + + + def _get_config_filter(): +@@ -704,7 +720,8 @@ def verify_selinux(datadir, imagesdir, i + def bootstrap(test_name, test_dir, base_dir, default_userspace_paths, + check_modules, online_docs_url, restore_image=False, + download_image=True, interactive=True, selinux=False, +- verbose=False, update_providers=False): ++ verbose=False, update_providers=False, ++ guest_os=defaults.DEFAULT_GUEST_OS): + """ + Common virt test assistant module. + +@@ -723,6 +740,8 @@ def bootstrap(test_name, test_dir, base_ + :param selinux: Whether setup SELinux contexts for shared/data. + :param update_providers: Whether to update test providers if they are already + downloaded. ++ :param guest_os: Specify the guest image used for bootstrapping. By default ++ the JeOS image is used. + + :raise error.CmdError: If JeOS image failed to uncompress + :raise ValueError: If 7za was not found +@@ -790,10 +809,10 @@ def bootstrap(test_name, test_dir, base_ + step += 2 + logging.info("%s - Verifying (and possibly downloading) guest image", + step) +- jeos_info = get_jeos_info() +- jeos_asset = jeos_info['asset'] +- asset.download_asset(jeos_asset, interactive=interactive, +- restore_image=restore_image) ++ for os_info in get_guest_os_info_list(test_name, guest_os): ++ os_asset = os_info['asset'] ++ asset.download_asset(os_asset, interactive=interactive, ++ restore_image=restore_image) + + if check_modules: + logging.info("") +--- /dev/null ++++ b/virttest/defaults.py +@@ -0,0 +1,18 @@ ++DEFAULT_MACHINE_TYPE = "i440fx" ++DEFAULT_GUEST_OS = "JeOS.19" ++ ++ ++def get_default_guest_os_info(): ++ """ ++ Gets the default asset and variant information depending on host OS ++ """ ++ os_info = {'asset': 'jeos-19-64', 'variant': DEFAULT_GUEST_OS} ++ ++ from autotest.client import utils ++ ++ issue_contents = utils.read_file('/etc/issue') ++ ++ if 'Fedora' in issue_contents and '20' in issue_contents: ++ os_info = {'asset': 'jeos-20-64', 'variant': 'JeOS.20'} ++ ++ return os_info +--- a/virttest/standalone_test.py ++++ b/virttest/standalone_test.py +@@ -24,6 +24,7 @@ import arch + import funcatexit + import version + import qemu_vm ++import defaults + + global GUEST_NAME_LIST + GUEST_NAME_LIST = None +@@ -226,7 +227,7 @@ class Test(object): + % error_message) + + except Exception, e: +- if (not t_type is None): ++ if (t_type is not None): + error_message = funcatexit.run_exitfuncs(env, t_type) + if error_message: + logging.error(error_message) +@@ -306,7 +307,7 @@ class Bcolors(object): + allowed_terms = ['linux', 'xterm', 'xterm-256color', 'vt100', + 'screen', 'screen-256color'] + term = os.environ.get("TERM") +- if (not os.isatty(1)) or (not term in allowed_terms): ++ if (not os.isatty(1)) or (term not in allowed_terms): + self.disable() + + def disable(self): +@@ -392,7 +393,7 @@ def print_fail(t_elapsed, open_fd=False) + bcolors.ENDC + " (%.2f s)" % t_elapsed) + fd_fail_msg = (bcolors.FAIL + "FAIL" + + bcolors.ENDC + " (%.2f s) (%s fd)" % +- (t_elapsed, utils_misc.get_virt_test_open_fds())) ++ (t_elapsed, utils_misc.get_virt_test_open_fds())) + if open_fd: + msg = fd_fail_msg + else: +@@ -667,6 +668,8 @@ def bootstrap_tests(options): + else: + restore_image = False + ++ os_info = defaults.get_default_guest_os_info() ++ + kwargs = {'test_name': options.type, + 'test_dir': test_dir, + 'base_dir': data_dir.get_data_dir(), +@@ -677,7 +680,8 @@ def bootstrap_tests(options): + 'selinux': options.selinux_setup, + 'restore_image': restore_image, + 'interactive': False, +- 'update_providers': options.update_providers} ++ 'update_providers': options.update_providers, ++ 'guest_os': options.guest_os or os_info['variant']} + + # Tolerance we have without printing a message for the user to wait (3 s) + tolerance = 3 +@@ -909,7 +913,7 @@ def run_tests(parser, options): + dependencies_satisfied = True + for dep in dct.get("dep"): + for test_name in status_dct.keys(): +- if not dep in test_name: ++ if dep not in test_name: + continue + + if not status_dct[test_name]: diff --git a/recipes-test/virt-test/files/clear_mandatory_header_list.patch b/recipes-test/virt-test/files/clear_mandatory_header_list.patch new file mode 100644 index 0000000..3627b7e --- /dev/null +++ b/recipes-test/virt-test/files/clear_mandatory_header_list.patch @@ -0,0 +1,13 @@ +diff --git a/virttest/bootstrap.py b/virttest/bootstrap.py +index c4e2623..76e3f34 100644 +--- a/virttest/bootstrap.py ++++ b/virttest/bootstrap.py +@@ -29,7 +29,7 @@ mandatory_programs = {'qemu': basic_program_requirements, + 'v2v': basic_program_requirements, + 'libguestfs': basic_program_requirements} + +-mandatory_headers = {'qemu': ['Python.h', 'types.h', 'socket.h', 'unistd.h'], ++mandatory_headers = {'qemu': [], + 'libvirt': [], + 'openvswitch': [], + 'v2v': [], diff --git a/recipes-test/virt-test/files/dnsmasq-virt-test b/recipes-test/virt-test/files/dnsmasq-virt-test new file mode 100644 index 0000000..dc87fea --- /dev/null +++ b/recipes-test/virt-test/files/dnsmasq-virt-test @@ -0,0 +1,2 @@ +interface=virbr0 +dhcp-range=10.99.99.10,10.99.99.254,24 diff --git a/recipes-test/virt-test/files/do_not_upgrade_test_providers.patch b/recipes-test/virt-test/files/do_not_upgrade_test_providers.patch new file mode 100644 index 0000000..1a92622 --- /dev/null +++ b/recipes-test/virt-test/files/do_not_upgrade_test_providers.patch @@ -0,0 +1,27 @@ +commit 7e3029cf20a653170522bcb70d5cf8a98605b466 +Author: Jonas Eriksson +Date: Tue Mar 25 15:10:01 2014 +0100 + + Don't try to upgrade test providers + + This works bad with embedded systems that does not have git installed. + + Signed-off-by: Jonas Eriksson + Upstream-Status: Inappropriate [disable feature] + +diff --git a/virttest/bootstrap.py b/virttest/bootstrap.py +index 7a5d716..d85679f 100644 +--- a/virttest/bootstrap.py ++++ b/virttest/bootstrap.py +@@ -724,11 +724,6 @@ def bootstrap(test_name, test_dir, base_dir, default_userspace_paths, + + logging.info("") + step += 1 +- logging.info("%d - Updating all test providers", step) +- asset.download_all_test_providers(update_providers) +- +- logging.info("") +- step += 1 + logging.info("%d - Checking the mandatory programs and headers", step) + verify_mandatory_programs(test_name) + diff --git a/recipes-test/virt-test/files/enea-image-virt-test-guest.wks b/recipes-test/virt-test/files/enea-image-virt-test-guest.wks new file mode 100644 index 0000000..ae07199 --- /dev/null +++ b/recipes-test/virt-test/files/enea-image-virt-test-guest.wks @@ -0,0 +1,10 @@ +# short-description: Create a 'pcbios' direct disk image +# long-description: Creates a partitioned legacy BIOS disk image that the user +# can directly dd to boot media. + + +part /boot --source bootimg-pcbios --ondisk vda --fstype=msdos --label boot --active --align 1024 +part / --source rootfs --ondisk vda --fstype=ext3 --label platform --align 1024 + +bootloader --timeout=0 --append="rootwait rootfstype=ext3 console=ttyS0" + diff --git a/recipes-test/virt-test/files/fix_asset_uncompress.patch b/recipes-test/virt-test/files/fix_asset_uncompress.patch new file mode 100644 index 0000000..9b2b05c --- /dev/null +++ b/recipes-test/virt-test/files/fix_asset_uncompress.patch @@ -0,0 +1,29 @@ +virt-test: Fixed asset uncompression + +Fix a mismatch in the uncompress command to allow it to work also with +the other compression types. + +Upstream-Status: Accepted +https://github.com/autotest/virt-test/commit/a4f4b89b0bf3adffb0188f4091b5c66d41f7eba7 + +Signed-off-by: Petre Pircalabu + +--- a/virttest/asset.py ++++ b/virttest/asset.py +@@ -91,13 +91,13 @@ def uncompress_asset(asset_info, force=F + if match: + if match.group(1) == 'gz': + uncompress_cmd = ('gzip -cd %s > %s' % +- (destination_uncompressed, destination)) ++ (destination, destination_uncompressed)) + elif match.group(1) == 'xz': + uncompress_cmd = ('xz -cd %s > %s' % +- (destination_uncompressed, destination)) ++ (destination, destination_uncompressed)) + elif match.group(1) == 'bz2': + uncompress_cmd = ('bzip2 -cd %s > %s' % +- (destination_uncompressed, destination)) ++ (destination, destination_uncompressed)) + elif match.group(1) == '7z': + uncompress_cmd = '7za -y e %s' % destination + else: diff --git a/recipes-test/virt-test/files/qemu-tests-clock-getres-config.patch b/recipes-test/virt-test/files/qemu-tests-clock-getres-config.patch new file mode 100644 index 0000000..5319df3 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-clock-getres-config.patch @@ -0,0 +1,20 @@ +commit 99efd456e7bb88c39a036e391a7f05dbc7a38039 +Author: Jonas Eriksson +Date: Thu Mar 27 17:47:21 2014 +0100 + + clock_getres: Add configuration + + Signed-off-by: Jonas Eriksson + Upstream-Status: Inappropriate [configuration] + +diff --git a/generic/tests/cfg/clock_getres.cfg b/generic/tests/cfg/clock_getres.cfg +index b0ae0c1..c9ec791 100644 +--- a/generic/tests/cfg/clock_getres.cfg ++++ b/generic/tests/cfg/clock_getres.cfg +@@ -1,5 +1,5 @@ + - clock_getres: install setup image_copy unattended_install.cdrom + virt_test_type = qemu libvirt +- no JeOS + only Linux + type = clock_getres ++ getres_cmd = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/generic/deps/clock_getres/clock_getres" diff --git a/recipes-test/virt-test/files/qemu-tests-cpuflags-build-avoidance.patch b/recipes-test/virt-test/files/qemu-tests-cpuflags-build-avoidance.patch new file mode 100644 index 0000000..2a082cc --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-cpuflags-build-avoidance.patch @@ -0,0 +1,516 @@ +commit 4f271849224b5a5b3ca93c78e4b5ca8aee350bc6 +Author: Jonas Eriksson +Date: Wed Mar 26 17:29:36 2014 +0100 + + cpuflags: Avoid building on test target + + The cpuflags-test utility is built with different compiler flags + depending on the callee, meaning that pre-building is tricky. By + separating the builds from each other using a suffix based on the + extra flags, we can pre-build multiple versions of the application. + + Signed-off-by: Jonas Eriksson + Upstream-Status: Pending + +diff --git a/provider/cpuflags.py b/provider/cpuflags.py +index 70255cf..ea2031c 100644 +--- a/provider/cpuflags.py ++++ b/provider/cpuflags.py +@@ -2,6 +2,7 @@ + Shared code for tests that make use of cpuflags + """ + import os ++import md5 + from virttest import data_dir + + +@@ -12,19 +13,36 @@ def install_cpuflags_util_on_vm(test, vm, dst_dir, extra_flags=None): + :param vm: virtual machine. + :param dst_dir: Installation path. + :param extra_flags: Extraflags for gcc compiler. ++ :return: The full path to the cpu_flags command built with the supplied ++ extra_flags + """ + if not extra_flags: + extra_flags = "" + +- cpuflags_src = data_dir.get_deps_dir("cpu_flags") ++ # The suffix is the first 8 chars of the hex representation of the md5sum ++ # of the extra flags ++ extra_flags_hash = md5.new() ++ extra_flags_hash.update(extra_flags) ++ suffix = (extra_flags_hash.hexdigest())[:8] ++ + cpuflags_dst = os.path.join(dst_dir, "cpu_flags") ++ cpuflags_cmd = os.path.join(dst_dir, "cpuflags-test-%s" % suffix) + session = vm.wait_for_login() +- session.cmd("rm -rf %s" % +- (cpuflags_dst)) +- session.cmd("sync") +- vm.copy_files_to(cpuflags_src, dst_dir) +- session.cmd("sync") +- session.cmd("cd %s; cd src; make EXTRA_FLAGS='%s';" % +- (cpuflags_dst, extra_flags)) +- session.cmd("sync") ++ ++ if session.cmd_status("test -x '%s'" % cpuflags_cmd): ++ cpuflags_cmd = os.path.join(cpuflags_dst, "cpuflags-test-%s" % suffix) ++ if session.cmd_status("test -x '%s'" % cpuflags_cmd): ++ cpuflags_src = os.path.join(data_dir.get_deps_dir(), "cpu_flags") ++ ++ session.cmd("rm -rf %s" % (cpuflags_dst)) ++ session.cmd("mkdir -p %s" % (dst_dir)) ++ session.cmd("sync") ++ vm.copy_files_to(cpuflags_src, dst_dir) ++ session.cmd("sync") ++ session.cmd("make -C %s EXTRA_FLAGS='%s';" % ++ (cpuflags_dst, extra_flags)) ++ session.cmd("sync") ++ + session.close() ++ ++ return cpuflags_cmd +diff --git a/deps/cpu_flags/src/.gitignore b/deps/cpu_flags/src/.gitignore +new file mode 100644 +index 0000000..1d04e1f +--- /dev/null ++++ b/qemu/deps/cpu_flags/src/.gitignore +@@ -0,0 +1,2 @@ ++build-*/ ++cpuflags-test-* +diff --git a/deps/cpu_flags/src/Makefile b/deps/cpu_flags/src/Makefile +index 1513649..3be1920 100644 +--- a/deps/cpu_flags/src/Makefile ++++ b/deps/cpu_flags/src/Makefile +@@ -45,63 +45,77 @@ CC=gcc + + LIBS=-lgomp + +-.PHONY: default all cpuflags-test clean ++# Use the first 8 characters of the md5sum of the extra flags as suffix ++SUFFIX=$(shell echo -n '$(EXTRA_FLAGS)' | md5sum | cut -c 1-8) ++BUILDDIR=build-$(SUFFIX) ++BUILDDIR_IND=build-$(SUFFIX)/.created + +-default:cpuflags-test ++.PHONY: default all clean suffix + +-all:cpuflags-test ++default: cpuflags-test-$(SUFFIX) + +-cpuflags-test: avx.o fma4.o xop.o sse4a.o sse4.o ssse3.o sse3.o aes.o pclmul.o rdrand.o stress.o stressmem.o +- $(CC) $(CFLAGS) $(LIBS) cpuflags-test.c -o cpuflags-test \ +- aes.o \ +- pclmul.o \ +- rdrand.o \ +- avx.o \ +- fma4.o \ +- xop.o \ +- sse4a.o \ +- sse4.o \ +- ssse3.o \ +- sse3.o \ +- stress.o \ +- stressmem.o \ ++all: cpuflags-test-$(SUFFIX) + +-aes.o: aes.c tests.h +- $(CC) $(CFLAGSAES) $(LIBS) -c aes.c ++suffix: ++ @echo $(SUFFIX) + +-pclmul.o: pclmul.c tests.h +- $(CC) $(CFLAGSPCLMUL) $(LIBS) -c pclmul.c ++# The timestamp of builddir will be updated as we write files, so let the ++# creation of .o files depend on a file (builddir indicator) inside builddir to ++# make sure that builddir is created. ++$(BUILDDIR_IND): ++ $(MKDIR) $(BUILDDIR) ++ touch $(BUILDDIR_IND) + +-rdrand.o: rdrand.c tests.h +- $(CC) $(CFLAGSRDRAND) $(LIBS) -c rdrand.c ++cpuflags-test-$(SUFFIX): cpuflags-test.c \ ++ $(BUILDDIR)/avx.o \ ++ $(BUILDDIR)/fma4.o \ ++ $(BUILDDIR)/xop.o \ ++ $(BUILDDIR)/sse4a.o \ ++ $(BUILDDIR)/sse4.o \ ++ $(BUILDDIR)/ssse3.o \ ++ $(BUILDDIR)/sse3.o \ ++ $(BUILDDIR)/aes.o \ ++ $(BUILDDIR)/pclmul.o \ ++ $(BUILDDIR)/rdrand.o \ ++ $(BUILDDIR)/stress.o \ ++ $(BUILDDIR)/stressmem.o ++ $(CC) $(CFLAGS) $^ $(LIBS) -o $@ + +-fma4.o: fma4.c tests.h +- $(CC) $(CFLAGSFMA4) $(LIBS) -c fma4.c ++$(BUILDDIR)/aes.o: aes.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSAES) $(LIBS) -c aes.c + +-xop.o: xop.c tests.h +- $(CC) $(CFLAGSXOP) $(LIBS) -c xop.c ++$(BUILDDIR)/pclmul.o: pclmul.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSPCLMUL) $(LIBS) -c pclmul.c + +-avx.o: avx.c tests.h +- $(CC) $(CFLAGSAVX) $(LIBS) -c avx.c ++$(BUILDDIR)/rdrand.o: rdrand.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSRDRAND) $(LIBS) -c rdrand.c + +-sse4a.o: sse4a.c tests.h +- $(CC) $(CFLAGSSSE4A) $(LIBS) -c sse4a.c ++$(BUILDDIR)/fma4.o: fma4.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSFMA4) $(LIBS) -c fma4.c + +-sse4.o: sse4.c tests.h +- $(CC) $(CFLAGSSSE4) $(LIBS) -c sse4.c ++$(BUILDDIR)/xop.o: xop.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSXOP) $(LIBS) -c xop.c + +-ssse3.o: ssse3.c tests.h +- $(CC) $(CFLAGSSSSE3) $(LIBS) -c ssse3.c ++$(BUILDDIR)/avx.o: avx.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSAVX) $(LIBS) -c avx.c + +-sse3.o: sse3.c tests.h +- $(CC) $(CFLAGSSSE3) $(LIBS) -c sse3.c ++$(BUILDDIR)/sse4a.o: sse4a.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSSSE4A) $(LIBS) -c sse4a.c + +-stress.o: stress.c tests.h +- $(CC) $(CFLAGSSTRESS) $(LIBS) -c stress.c ++$(BUILDDIR)/sse4.o: sse4.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSSSE4) $(LIBS) -c sse4.c + +-stressmem.o: stressmem.c tests.h +- $(CC) $(CFLAGSSTRESS) $(LIBS) -c stressmem.c ++$(BUILDDIR)/ssse3.o: ssse3.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSSSSE3) $(LIBS) -c ssse3.c + ++$(BUILDDIR)/sse3.o: sse3.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSSSE3) $(LIBS) -c sse3.c ++ ++$(BUILDDIR)/stress.o: stress.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSSTRESS) $(LIBS) -c stress.c ++ ++$(BUILDDIR)/stressmem.o: stressmem.c tests.h $(BUILDDIR_IND) ++ $(CC) -o $@ $(CFLAGSSTRESS) $(LIBS) -c stressmem.c + + ARCHIVE= cpuflags-test + +@@ -110,5 +124,7 @@ tar: clean + + clean: + rm -f *~ +- rm -f *.o +- rm -f cpuflags-test ++ rm -f build-*/*.o ++ rm -f cpuflags-test-* ++ rm -f build-*/.created ++ rmdir build-* || true +diff --git a/qemu/tests/cpuflags.py b/qemu/tests/cpuflags.py +index 75a03bb..cab4f5a 100644 +--- a/qemu/tests/cpuflags.py ++++ b/qemu/tests/cpuflags.py +@@ -24,8 +24,8 @@ def run(test, params, env): + utils_misc.Flag.aliases = utils_misc.kvm_map_flags_aliases + qemu_binary = utils_misc.get_qemu_binary(params) + +- cpuflags_src = os.path.join(data_dir.get_deps_dir("cpu_flags"), "src") +- cpuflags_def = os.path.join(data_dir.get_deps_dir("cpu_flags"), ++ cpuflags_src = os.path.join(qemudir, "deps", "cpu_flags", "src") ++ cpuflags_def = os.path.join(qemudir, "deps", "cpu_flags", + "cpu_map.xml") + smp = int(params.get("smp", 1)) + +@@ -188,9 +188,12 @@ def run(test, params, env): + """ + p = ParseCpuFlags() + cpus = p.parse_file(cpuflags_def) ++ flags = None + for arch in cpus.values(): + if cpumodel in arch.keys(): + flags = arch[cpumodel] ++ if not flags: ++ raise NameError, "Could not resolve flags for cpumodel '%s'" % cpumodel + return set(map(utils_misc.Flag, flags)) + + get_guest_host_cpuflags_BAD = get_guest_host_cpuflags_1350 +@@ -253,7 +256,9 @@ def run(test, params, env): + output = utils.run(cmd).stdout + + cpu_re = re.compile(r"x86\s+\[?(\w+)\]?") +- return cpu_re.findall(output) ++ cpus = cpu_re.findall(output) ++ ++ return [c for c in cpus if not c == 'host'] + + get_cpu_models_BAD = get_cpu_models_1350 + +@@ -432,16 +437,16 @@ def run(test, params, env): + Run stress on vm for timeout time. + """ + ret = False +- install_path = "/tmp" +- cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) +- flags = check_cpuflags_work(vm, install_path, guest_flags) ++ install_path = params.get("cpuflags_install_path", "/tmp") ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) ++ flags = check_cpuflags_work(vm, cpuflags_cmd, guest_flags) + dd_session = vm.wait_for_login() + stress_session = vm.wait_for_login() + dd_session.sendline("dd if=/dev/[svh]da of=/tmp/stressblock" + " bs=10MB count=100 &") + try: +- stress_session.cmd("%s/cpuflags-test --stress %s%s" % +- (os.path.join(install_path, "cpu_flags"), smp, ++ stress_session.cmd("%s --stress %s%s" % ++ (cpuflags_cmd, smp, + utils_misc.kvm_flags_to_stresstests(flags[0])), + timeout=timeout) + except aexpect.ShellTimeoutError: +@@ -613,10 +618,10 @@ def run(test, params, env): + "on guest: %s", str(not_enable_flags)) + logging.info("Check main instruction sets.") + +- install_path = "/tmp" +- cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) ++ install_path = params.get("cpuflags_install_path", "/tmp") ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) + +- Flags = check_cpuflags_work(self.vm, install_path, ++ Flags = check_cpuflags_work(self.vm, cpuflags_cmd, + flags.all_possible_guest_flags) + logging.info("Woking CPU flags: %s", str(Flags[0])) + logging.info("Not working CPU flags: %s", str(Flags[1])) +@@ -814,18 +819,17 @@ def run(test, params, env): + + (self.vm, _) = start_guest_with_cpuflags(cpuf_model, smp) + +- install_path = "/tmp" +- cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) +- flags = check_cpuflags_work(self.vm, install_path, ++ install_path = params.get("cpuflags_install_path", "/tmp") ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) ++ flags = check_cpuflags_work(self.vm, cpuflags_cmd, + flags.guest_flags) + dd_session = self.vm.wait_for_login() + stress_session = self.vm.wait_for_login() + + dd_session.sendline("nohup dd if=/dev/[svh]da of=/tmp/" + "stressblock bs=10MB count=100 &") +- cmd = ("nohup %s/cpuflags-test --stress %s%s &" % +- (os.path.join(install_path, "cpu_flags"), smp, +- utils_misc.kvm_flags_to_stresstests(flags[0]))) ++ cmd = "nohup %s --stress %s%s &" % (cpuflags_cmd, smp, ++ utils_misc.kvm_flags_to_stresstests(flags[0])) + stress_session.sendline(cmd) + + time.sleep(5) +@@ -915,7 +919,7 @@ def run(test, params, env): + for fdel in flags.host_unsupported_flags: + cpuf_model += ",-" + str(fdel) + +- install_path = "/tmp" ++ install_path = params.get("cpuflags_install_path", "/tmp") + + class testMultihostMigration(utils_test.qemu.MultihostMigration): + +@@ -931,9 +935,10 @@ def run(test, params, env): + vm = env.get_vm("vm1") + session = vm.wait_for_login(timeout=self.login_timeout) + +- cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) ++ mig_data.params.update([('cpuflags_cmd', cpuflags_cmd)]) + +- Flags = check_cpuflags_work(vm, install_path, ++ Flags = check_cpuflags_work(vm, cpuflags_cmd, + flags.all_possible_guest_flags) + logging.info("Woking CPU flags: %s", str(Flags[0])) + logging.info("Not working CPU flags: %s", +@@ -946,9 +951,8 @@ def run(test, params, env): + session.sendline("nohup dd if=/dev/[svh]da of=/tmp/" + "stressblock bs=10MB count=100 &") + +- cmd = ("nohup %s/cpuflags-test --stress %s%s &" % +- (os.path.join(install_path, "cpu_flags"), +- smp, ++ cmd = ("nohup %s --stress %s%s &" % ++ (cpuflags_cmd, smp, + utils_misc.kvm_flags_to_stresstests(Flags[0] & + flags.guest_flags))) + logging.debug("Guest_flags: %s", +@@ -971,7 +975,8 @@ def run(test, params, env): + " should be active after" + " migration and it's not.") + +- Flags = check_cpuflags_work(vm, install_path, ++ cpuflags_cmd = mig_data.params.get('cpuflags_cmd') ++ Flags = check_cpuflags_work(vm, cpuflags_cmd, + flags.all_possible_guest_flags) + logging.info("Woking CPU flags: %s", + str(Flags[0])) +@@ -1017,7 +1022,7 @@ def run(test, params, env): + disable_cpus = map(lambda cpu: int(cpu), + params.get("disable_cpus", "").split()) + +- install_path = "/tmp" ++ install_path = params.get("cpuflags_install_path", "/tmp") + + class testMultihostMigration(utils_test.qemu.MultihostMigration): + +@@ -1060,9 +1065,10 @@ def run(test, params, env): + vm = env.get_vm("vm1") + session = vm.wait_for_login(timeout=self.login_timeout) + +- cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) ++ mig_data.params.update([('cpuflags_cmd', cpuflags_cmd)]) + +- Flags = check_cpuflags_work(vm, install_path, ++ Flags = check_cpuflags_work(vm, cpuflags_cmd, + flags.all_possible_guest_flags) + logging.info("Woking CPU flags: %s", str(Flags[0])) + logging.info("Not working CPU flags: %s", +@@ -1103,7 +1109,8 @@ def run(test, params, env): + "disabled on dsthost:%s" % + (disable_cpus, not_disabled)) + +- Flags = check_cpuflags_work(vm, install_path, ++ cpuflags_cmd = mig_data.params.get('cpuflags_cmd') ++ Flags = check_cpuflags_work(vm, cpuflags_cmd, + flags.all_possible_guest_flags) + logging.info("Woking CPU flags: %s", + str(Flags[0])) +diff --git a/qemu/tests/migration_multi_host_cancel.py b/qemu/tests/migration_multi_host_cancel.py +index 89765dd..a4ed11b 100644 +--- a/qemu/tests/migration_multi_host_cancel.py ++++ b/qemu/tests/migration_multi_host_cancel.py +@@ -64,13 +64,12 @@ def run(test, params, env): + vm = mig_data.vms[0] + session = vm.wait_for_login(timeout=self.login_timeout) + +- cpuflags.install_cpuflags_util_on_vm(test, vm, ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, + self.install_path, + extra_flags="-msse3 -msse2") + +- cmd = ("%s/cpuflags-test --stressmem %d,%d %%" % +- (os.path.join(self.install_path, "cpu_flags"), +- self.vm_mem * 10, self.vm_mem / 2)) ++ cmd = ("%s --stressmem %d,%d %%" % ++ (cpuflags_cmd, self.vm_mem * 10, self.vm_mem / 2)) + logging.debug("Sending command: %s" % (cmd)) + session.sendline(cmd) + +diff --git a/qemu/tests/migration_multi_host_downtime_and_speed.py b/qemu/tests/migration_multi_host_downtime_and_speed.py +index 4a06b69..549d1fd 100644 +--- a/qemu/tests/migration_multi_host_downtime_and_speed.py ++++ b/qemu/tests/migration_multi_host_downtime_and_speed.py +@@ -164,13 +164,12 @@ def run(test, params, env): + vm = mig_data.vms[0] + session = vm.wait_for_login(timeout=self.login_timeout) + +- cpuflags.install_cpuflags_util_on_vm(test, vm, ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, + self.install_path, + extra_flags="-msse3 -msse2") + +- cmd = ("nohup %s/cpuflags-test --stressmem %d,%d &" % +- (os.path.join(self.install_path, "cpu_flags"), +- self.vm_mem * 100, self.vm_mem / 2)) ++ cmd = ("nohup %s --stressmem %d,%d &" % ++ (cpuflags_cmd, self.vm_mem * 100, self.vm_mem / 2)) + logging.debug("Sending command: %s" % (cmd)) + session.sendline(cmd) + time.sleep(3) +diff --git a/qemu/tests/migration_multi_host_firewall_block.py b/qemu/tests/migration_multi_host_firewall_block.py +index 3db1dc5..dc70a6b 100644 +--- a/qemu/tests/migration_multi_host_firewall_block.py ++++ b/qemu/tests/migration_multi_host_firewall_block.py +@@ -175,13 +175,12 @@ def run(test, params, env): + vm = mig_data.vms[0] + session = vm.wait_for_login(timeout=self.login_timeout) + +- cpuflags.install_cpuflags_util_on_vm(test, vm, ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, + self.install_path, + extra_flags="-msse3 -msse2") + +- cmd = ("nohup %s/cpuflags-test --stressmem %d,%d &" % +- (os.path.join(self.install_path, "cpu_flags"), +- self.vm_mem * 100, self.vm_mem / 2)) ++ cmd = ("nohup %s --stressmem %d,%d &" % ++ (cpuflags_cmd, self.vm_mem * 100, self.vm_mem / 2)) + logging.debug("Sending command: %s" % (cmd)) + session.sendline(cmd) + time.sleep(3) +diff --git a/qemu/tests/migration_multi_host_ping_pong.py b/qemu/tests/migration_multi_host_ping_pong.py +index 7f7b64e..c6d0d3c 100644 +--- a/qemu/tests/migration_multi_host_ping_pong.py ++++ b/qemu/tests/migration_multi_host_ping_pong.py +@@ -155,15 +155,14 @@ def run(test, params, env): + vm = mig_data.vms[0] + session = vm.wait_for_login(timeout=self.login_timeout) + +- cpuflags.install_cpuflags_util_on_vm(test, vm, ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, + self.install_path, + extra_flags="-msse3 -msse2") + + cmd = ("nohup %s/cpuflags-test --stressmem %d,32" + " > %s &" % +- (os.path.join(self.install_path, "cpu_flags"), +- self.stress_memory, +- self.cpuflags_test_out)) ++ (cpuflags_cmd, self.stress_memory, ++ self.cpuflags_test_out)) + logging.debug("Sending command: %s" % (cmd)) + session.sendline(cmd) + if session.cmd_status("killall -s 0 cpuflags-test") != 0: +diff --git a/qemu/tests/migration_multi_host_with_speed_measurement.py b/qemu/tests/migration_multi_host_with_speed_measurement.py +index e845b90..dbddbf4 100644 +--- a/qemu/tests/migration_multi_host_with_speed_measurement.py ++++ b/qemu/tests/migration_multi_host_with_speed_measurement.py +@@ -128,12 +128,11 @@ def run(test, params, env): + vm = mig_data.vms[0] + session = vm.wait_for_login(timeout=self.login_timeout) + +- cpuflags.install_cpuflags_util_on_vm(test, vm, install_path, ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path, + extra_flags="-msse3 -msse2") + +- cmd = ("%s/cpuflags-test --stressmem %d,%d" % +- (os.path.join(install_path, "cpu_flags"), +- vm_mem * 4, vm_mem / 2)) ++ cmd = ("%s --stressmem %d,%d" % ++ (cpuflags_cmd, vm_mem * 4, vm_mem / 2)) + logging.debug("Sending command: %s" % (cmd)) + session.sendline(cmd) + +diff --git a/qemu/tests/migration_with_speed_measurement.py b/qemu/tests/migration_with_speed_measurement.py +index 47c4231..a88d648 100644 +--- a/qemu/tests/migration_with_speed_measurement.py ++++ b/qemu/tests/migration_with_speed_measurement.py +@@ -82,14 +82,13 @@ def run(test, params, env): + + try: + # Reboot the VM in the background +- cpuflags.install_cpuflags_util_on_vm(test, vm, install_path, ++ cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path, + extra_flags="-msse3 -msse2") + + vm.monitor.migrate_set_speed(mig_speed) + +- cmd = ("%s/cpuflags-test --stressmem %d,%d" % +- (os.path.join(install_path, "cpu_flags"), +- vm_mem * 4, vm_mem / 2)) ++ cmd = ("%s --stressmem %d,%d" % ++ (cpuflags_cmd, vm_mem * 4, vm_mem / 2)) + logging.debug("Sending command: %s" % (cmd)) + session.sendline(cmd) + diff --git a/recipes-test/virt-test/files/qemu-tests-cpuflags-conf.patch b/recipes-test/virt-test/files/qemu-tests-cpuflags-conf.patch new file mode 100644 index 0000000..3bc2f27 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-cpuflags-conf.patch @@ -0,0 +1,41 @@ +commit e56958858553975f7d5fc13441fc0d0a2a94bbc7 +Author: Jonas Eriksson +Date: Wed Mar 26 17:41:15 2014 +0100 + + cpuflags test: Add tool path configuration + + Signed-off-by: Jonas Eriksson + Upstream-Status: Inappropriate [configuration] + +diff --git a/qemu/tests/cfg/cpuflags.cfg b/qemu/tests/cfg/cpuflags.cfg +index 7d99a4c..15d805f 100644 +--- a/qemu/tests/cfg/cpuflags.cfg ++++ b/qemu/tests/cfg/cpuflags.cfg +@@ -1,5 +1,4 @@ + - cpuflags: install setup image_copy unattended_install.cdrom +- no JeOS + type = cpuflags + extra_params += " -snapshot" + auto_cpu_model = no +@@ -20,6 +19,8 @@ + cpu_model_blacklist += " pentium3 coreduo n270" + guest_spec_flags = "fxsr_opt hypervisor ds pdpe1gb osxsave svm tsc-deadline" + host_spec_flags = "pbe tm ds_cpl monitor acpi dtes64 ht tm2 xtpr est pdcm smx" ++ ++ cpuflags_install_path = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/cpu_flags/src" + variants: + - interface: + variants: +diff --git a/qemu/tests/cfg/multi_host.cfg b/qemu/tests/cfg/multi_host.cfg +index 549b102..96eee60 100644 +--- a/qemu/tests/cfg/multi_host.cfg ++++ b/qemu/tests/cfg/multi_host.cfg +@@ -7,7 +7,7 @@ + remove_image_on_check_error = yes + force_image_clone = no + virt_test_type = qemu +- no JeOS ++ cpuflags_install_path = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/cpu_flags/src" + variants multi_host_tests: + - migrate_multi_host: install setup image_copy unattended_install.cdrom + type = migration_multi_host diff --git a/recipes-test/virt-test/files/qemu-tests-cpuflags-migrate-to-provider.patch b/recipes-test/virt-test/files/qemu-tests-cpuflags-migrate-to-provider.patch new file mode 100644 index 0000000..1b948f6 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-cpuflags-migrate-to-provider.patch @@ -0,0 +1,91 @@ +commit a1aa54ba8adbf2e12043b7d91161ee6302e7584c +Author: Jonas Eriksson +Date: Wed Mar 26 14:08:54 2014 +0100 + + cpuflags: Migrate cpuflags test case to provider + + The provider module has a install_cpuflags_util_on_vm function that does + the very same thing as the internal implementation: Use that instead. + + Signed-off-by: Jonas Eriksson + Upstream-Status: Pending + +diff --git a/qemu/tests/cpuflags.py b/qemu/tests/cpuflags.py +index 7b2dca6..eecbf16 100644 +--- a/qemu/tests/cpuflags.py ++++ b/qemu/tests/cpuflags.py +@@ -11,6 +11,7 @@ from autotest.client.shared import error, utils + from virttest import qemu_vm, virt_vm + from virttest import utils_misc, utils_test, aexpect + from autotest.client.shared.syncdata import SyncData ++from provider import cpuflags + + + def run(test, params, env): +@@ -385,21 +386,6 @@ def run(test, params, env): + + return set(online) - set(disabled_cpu) + +- def install_cpuflags_test_on_vm(vm, dst_dir): +- """ +- Install stress to vm. +- +- :param vm: virtual machine. +- :param dst_dir: Installation path. +- """ +- session = vm.wait_for_login() +- vm.copy_files_to(cpuflags_src, dst_dir) +- session.cmd("sync") +- session.cmd("cd %s; make EXTRA_FLAGS='';" % +- os.path.join(dst_dir, "cpu_flags")) +- session.cmd("sync") +- session.close() +- + def check_cpuflags_work(vm, path, flags): + """ + Check which flags work. +@@ -433,7 +419,7 @@ def run(test, params, env): + """ + ret = False + install_path = "/tmp" +- install_cpuflags_test_on_vm(vm, install_path) ++ cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) + flags = check_cpuflags_work(vm, install_path, guest_flags) + dd_session = vm.wait_for_login() + stress_session = vm.wait_for_login() +@@ -614,7 +600,7 @@ def run(test, params, env): + logging.info("Check main instruction sets.") + + install_path = "/tmp" +- install_cpuflags_test_on_vm(self.vm, install_path) ++ cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) + + Flags = check_cpuflags_work(self.vm, install_path, + flags.all_possible_guest_flags) +@@ -815,7 +801,7 @@ def run(test, params, env): + (self.vm, _) = start_guest_with_cpuflags(cpuf_model, smp) + + install_path = "/tmp" +- install_cpuflags_test_on_vm(self.vm, install_path) ++ cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) + flags = check_cpuflags_work(self.vm, install_path, + flags.guest_flags) + dd_session = self.vm.wait_for_login() +@@ -931,7 +917,7 @@ def run(test, params, env): + vm = env.get_vm("vm1") + session = vm.wait_for_login(timeout=self.login_timeout) + +- install_cpuflags_test_on_vm(vm, install_path) ++ cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) + + Flags = check_cpuflags_work(vm, install_path, + flags.all_possible_guest_flags) +@@ -1060,7 +1046,7 @@ def run(test, params, env): + vm = env.get_vm("vm1") + session = vm.wait_for_login(timeout=self.login_timeout) + +- install_cpuflags_test_on_vm(vm, install_path) ++ cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) + + Flags = check_cpuflags_work(vm, install_path, + flags.all_possible_guest_flags) diff --git a/recipes-test/virt-test/files/qemu-tests-cyclictest.patch b/recipes-test/virt-test/files/qemu-tests-cyclictest.patch new file mode 100644 index 0000000..f9ee831 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-cyclictest.patch @@ -0,0 +1,217 @@ +commit 61c087a0386ad04fd5579ad170b9d7933ed90c8c +Author: Jonas Eriksson +Date: Fri Apr 25 16:00:12 2014 +0200 + + Add cyclictest test case + + Cyclictest is a part of rt-tests used to test the responsiveness of a + system. While not developed for non-realtime systems, it can be used to + detect unexpected spikes in latencies within virtual machines. + + Signed-off-by: Jonas Eriksson + Upstream-Status: Pending + +diff --git a/qemu/tests/cfg/cyclictest.cfg b/qemu/tests/cfg/cyclictest.cfg +new file mode 100644 +index 0000000..d142b7d +--- /dev/null ++++ b/qemu/tests/cfg/cyclictest.cfg +@@ -0,0 +1,25 @@ ++- cyclictest: ++ virt_test_type = qemu ++ only Linux ++ type = cyclictest ++ kill_vm = yes ++ kill_vm_gracefully = no ++ backup_image_before_testing = yes ++ ++ # It is possible to tune the arguments to cyclictest using the ++ # cyclictest_args variable. ++ #cyclictest_args = "-D 30m --smp" ++ # It is formatted using a dictionary where a number of properties of the ++ # target is available, for example 'num_cpus' which is the number of cpus, ++ # and 'mask_all_cpus', which is the string "0-[num_cpus - 1]". See ++ # cyclictest.py for all available values. The following is for example ++ # equivalent to "-D 30m --smp": ++ #cyclictest_args = "-D 30m -t %(num_cpus)s -a %(mask_all_cpus)s" ++ # Default timeout is 35 min ++ #cyclictest_timeout_s = 2100 ++ ++ # After the run, the test case will check all values against the below ++ # allowed maximum values of each result. ++ #allowed_max = 50 ++ #allowed_avg = 30 ++ #allowed_act = +diff --git a/qemu/tests/cyclictest.py b/qemu/tests/cyclictest.py +new file mode 100644 +index 0000000..0ad447f +--- /dev/null ++++ b/qemu/tests/cyclictest.py +@@ -0,0 +1,167 @@ ++import logging ++import re ++from autotest.client import utils ++from autotest.client.shared import error ++from virttest import remote, utils_misc, utils_test ++ ++ ++# Information about cyclictest is available here: ++# https://rt.wiki.kernel.org/index.php/Cyclictest ++@error.context_aware ++def run(test, params, env): ++ """ ++ Test Steps: ++ ++ 1. Check availability of cyclictest ++ 2. Get information about the target ++ 3. Run cyclictest ++ 4. Parse and check result ++ ++ Params: ++ :param test: QEMU test object. ++ :param params: Dictionary with the test parameters. ++ :param env: Dictionary with test environment. ++ """ ++ ++ def parse_cyclictest(output_string): ++ """ ++ Parses the output from a cyclictest run into a nested dictionary. ++ ++ Example input: ++ # /dev/cpu_dma_latency set to 0us ++ T: 0 ( 7064) P: 0 I:1000 C: 2000 Min: 1 Act: 2 Avg: 3 Max: 751 ++ T: 1 ( 7065) P: 0 I:1500 C: 1334 Min: 1 Act: 3 Avg: 2 Max: 167 ++ Example output: ++ { '0': { 'Act': '2', ++ 'Avg': '3', ++ 'C': '2000', ++ 'I': '1000', ++ 'Max': '751', ++ 'Min': '1', ++ 'P': '0', ++ 'T': '0 ( 7064)'}, ++ '1': { 'Act': '3', ++ 'Avg': '2', ++ 'C': '1334', ++ 'I': '1500', ++ 'Max': '167', ++ 'Min': '1', ++ 'P': '0', ++ 'T': '1 ( 7065)'} ++ } ++ ++ Params: ++ :param output_string: Output data from cyclictest ++ :returns: Nested dict of parsed output ++ """ ++ output = output_string.split("\n") ++ result = {} ++ for row_string in output: ++ # Only process lines beginning with "T:" ++ if re.match("^T:", row_string): ++ # Since the different segments of a line are not comma ++ # separated (or similar), it is tricky to split them right ++ # away. Instead, match the "header" of an entry (e.g. "P:"), ++ # and add a line break before them. Then split the string using ++ # the added line breaks. ++ row_list = re.sub("\S+:", "\n\g<0>", row_string).split("\n") ++ sub_result = {} ++ for part in row_list: ++ part = re.sub("\s+$", "", part) ++ if not part == "": ++ # The strings are now on the form "P: 0" (for example) ++ kv = re.split(":\s*", part) ++ sub_result[kv[0]] = kv[1] ++ # Use the thread as an index in the outer result dict. Avoid ++ # using an array to be able to process results in any order and ++ # with gaps. ++ thread = (sub_result['T'].split(" "))[0] ++ result[thread] = sub_result ++ return result ++ ++ def check_val_ceiling(allowed_ceil, val, name, cpu): ++ """ ++ Check that the value :val: is not larger than :allowed_ceil:, and if so ++ log the error using :name: as the name of the value. ++ ++ Params: ++ :allowed_ceil: Maximum allowed vaule of :val:. If None, "" or 0, ++ just return 0. ++ :val: The value to be tested ++ :name: The name of the value, for logging ++ :cpu: CPU number for error reporting ++ :returns: Number of errors; 0 if successful. ++ """ ++ if allowed_ceil > 0 and val > allowed_ceil: ++ logging.error("%s value too large: %d for CPU %d" % (name, ++ val, ++ cpu)) ++ return 1 ++ return 0 ++ ++ # Get/setup VM and session ++ vm_name = params.get("vm_name", "main_vm") ++ vm = env.get_vm(params[vm_name]) ++ vm.verify_alive() ++ timeout = int(params.get("timeout", 2400)) ++ session = vm.wait_for_login(timeout=timeout) ++ ++ try: ++ error.context("Check availability of cyclictest") ++ if session.cmd_status("which cyclictest"): ++ raise error.TestFail("Test application not available") ++ ++ error.context("Get information about the target") ++ # Get the number of CPUs on target ++ cmd = "grep -c '^processor[[:space:]]*:' /proc/cpuinfo" ++ output = session.cmd_output(cmd) ++ num_cpus = int(output) ++ if num_cpus == 0: ++ raise error.TestFail("Unable to get number of CPUs on target") ++ ++ # Get arguments from the configuration ++ default_args = "-D 30m --smp" ++ cyclictest_args = params.get("cyclictest_args", default_args) ++ fmt_dict = { ++ 'num_cpus': num_cpus, ++ 'last_cpu': num_cpus - 1, ++ 'mask_all_cpus': "0-%d" % (num_cpus - 1), ++ } ++ formatted_args = cyclictest_args % fmt_dict ++ ++ error.context("Run cyclictest") ++ timeout_s = params.get("cyclictest_timeout_s", 60*35) ++ cmd = "cyclictest -q %s" % formatted_args ++ status, ct_output = session.cmd_status_output(cmd, ++ timeout=timeout_s) ++ if status: ++ logging.error("Cyclic test output: %s" % ct_output) ++ raise error.TestFail("Cyclictest returned %d" % status) ++ ++ error.context("Parse and check result") ++ results = parse_cyclictest(ct_output) ++ if not results: ++ logging.error("Cyclic test output: %s" % ct_output) ++ raise error.TestFail("Parsing of cyclictest output failed") ++ ++ # Get check values. By default, don't check Act. ++ allowed_max = int(params.get("allowed_max", 50)) ++ allowed_avg = int(params.get("allowed_avg", 30)) ++ allowed_act = int(params.get("allowed_act", 0)) ++ ++ fails = 0 ++ for key, result in results.iteritems(): ++ cpu = int(key) ++ max_val = int(result['Max']) ++ avg_val = int(result['Avg']) ++ act_val = int(result['Act']) ++ fails += check_val_ceiling(allowed_max, max_val, "Max", cpu) ++ fails += check_val_ceiling(allowed_avg, avg_val, "Avg", cpu) ++ fails += check_val_ceiling(allowed_act, act_val, "Act", cpu) ++ ++ if fails > 0: ++ logging.error("Cyclic test output: %s" % ct_output) ++ raise error.TestFail("Values out of bounds, see log") ++ ++ finally: ++ session.close() diff --git a/recipes-test/virt-test/files/qemu-tests-multi-nic-stress.patch b/recipes-test/virt-test/files/qemu-tests-multi-nic-stress.patch new file mode 100644 index 0000000..9c916f5 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-multi-nic-stress.patch @@ -0,0 +1,102 @@ +commit df8666dfa327670b680ff05d5c43fff715c62ff9 +Author: Jonas Eriksson +Date: Tue Mar 18 16:11:50 2014 +0100 + + multi_nic_stress: Check if netperf is installed + + To avoid an unnecessary download and build of netperf, check if the + application is present before building. + + Signed-off-by: Jonas Eriksson + Upstream-Status: Pending + +diff --git a/qemu/tests/cfg/multi_nic_stress.cfg b/qemu/tests/cfg/multi_nic_stress.cfg +index 2ec6cb6..36a073e 100644 +--- a/qemu/tests/cfg/multi_nic_stress.cfg ++++ b/qemu/tests/cfg/multi_nic_stress.cfg +@@ -15,6 +15,9 @@ + pkg_md5sum = 9654ffdfd4c4f2c93ce3733cd9ed9236 + remote_dir = /var/tmp + setup_cmd = "cd ${remote_dir} && rm -rf netperf-2.6.0 && tar xvfj netperf-2.6.0.tar.bz2 && cd netperf-2.6.0 && ./configure --enable-burst --enable-demo=yes && make" ++ app_check_cmd = "netperf -V" ++ client_cmd = netperf ++ server_cmd = netserver + l = 30 + protocols = "TCP_STREAM TCP_MAERTS TCP_RR TCP_CRR" + sessions = "1" +diff --git a/qemu/tests/multi_nic_stress.py b/qemu/tests/multi_nic_stress.py +index 698bc99..aaf6d21 100644 +--- a/qemu/tests/multi_nic_stress.py ++++ b/qemu/tests/multi_nic_stress.py +@@ -41,20 +41,24 @@ def run(test, params, env): + """ + error.context("Setup env for %s" % ip_addr) + ssh_cmd(session, "service iptables stop; true") +- netperf_links = params["netperf_links"].split() +- remote_dir = params.get("remote_dir", "/var/tmp") +- for netperf_link in netperf_links: +- if utils.is_url(netperf_link): +- download_dir = data_dir.get_download_dir() +- md5sum = params.get("pkg_md5sum") +- netperf_dir = utils.unmap_url_cache(download_dir, +- netperf_link, md5sum) +- elif netperf_link: +- netperf_dir = os.path.join(data_dir.get_root_dir(), +- "shared/%s" % netperf_link) +- remote.scp_to_remote(ip_addr, shell_port, username, password, +- netperf_dir, remote_dir) +- ssh_cmd(session, params.get("setup_cmd")) ++ app_check_cmd = params.get("app_check_cmd", "") ++ ++ # Install netperf in guest if not already available ++ if not (app_check_cmd and session.cmd_status(app_check_cmd) == 0): ++ netperf_links = params["netperf_links"].split() ++ remote_dir = params.get("remote_dir", "/var/tmp") ++ for netperf_link in netperf_links: ++ if utils.is_url(netperf_link): ++ download_dir = data_dir.get_download_dir() ++ md5sum = params.get("pkg_md5sum") ++ netperf_dir = utils.unmap_url_cache(download_dir, ++ netperf_link, md5sum) ++ elif netperf_link: ++ netperf_dir = os.path.join(data_dir.get_root_dir(), ++ "shared/%s" % netperf_link) ++ remote.scp_to_remote(ip_addr, shell_port, username, password, ++ netperf_dir, remote_dir) ++ ssh_cmd(session, params.get("setup_cmd")) + + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() +@@ -202,8 +206,10 @@ def launch_client(sessions, servers, server_ctl, clients, + # Start netserver + error.context("Start Netserver on guest", logging.info) + remote_dir = params.get("remote_dir", "/var/tmp") +- client_path = os.path.join(remote_dir, "netperf-2.6.0/src/netperf") +- server_path = os.path.join(remote_dir, "netperf-2.6.0/src/netserver") ++ client_path_default = os.path.join(remote_dir, "netperf-2.6.0/src/netperf") ++ client_cmd = params.get("client_cmd", client_path_default) ++ server_path_default = os.path.join(remote_dir, "netperf-2.6.0/src/netserver") ++ server_cmd = params.get("server_cmd", server_path_default) + + if params.get("os_type") == "windows": + winutils_vol = utils_misc.get_winutils_vol(server_ctl) +@@ -219,8 +225,8 @@ def launch_client(sessions, servers, server_ctl, clients, + raise error.TestError(msg) + + else: +- logging.info("Netserver start cmd is '%s'" % server_path) +- ssh_cmd(server_ctl, "pidof netserver || %s" % server_path) ++ logging.info("Netserver start cmd is '%s'" % server_cmd) ++ ssh_cmd(server_ctl, "pidof netserver || %s" % server_cmd) + logging.info("Netserver start successfully") + + # start netperf +@@ -230,7 +236,7 @@ def launch_client(sessions, servers, server_ctl, clients, + for client in clients: + test_timeout = len(clients) * l + server = servers[clients.index(client) % len(servers)] +- netperf_cmd = "%s -H %s -l %s %s" % (client_path, server, ++ netperf_cmd = "%s -H %s -l %s %s" % (client_cmd, server, + int(l), nf_args) + client_threads.append([ssh_cmd, (client, netperf_cmd, test_timeout)]) + diff --git a/recipes-test/virt-test/files/qemu-tests-nx-exploit-config.patch b/recipes-test/virt-test/files/qemu-tests-nx-exploit-config.patch new file mode 100644 index 0000000..92b918a --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-nx-exploit-config.patch @@ -0,0 +1,21 @@ +commit 155bcc2cba379d7eda2b8dbff0e54951bf682ad6 +Author: Jonas Eriksson +Date: Thu Mar 27 17:10:29 2014 +0100 + + nx exploit test: Add configuration + + Signed-off-by: Jonas Eriksson + Upstream-Status: Inappropriate [configuration] + +diff --git a/qemu/tests/cfg/nx.cfg b/qemu/tests/cfg/nx.cfg +index 280df32..cbd7803 100644 +--- a/qemu/tests/cfg/nx.cfg ++++ b/qemu/tests/cfg/nx.cfg +@@ -6,6 +6,7 @@ + virt_test_type = qemu + image_snapshot = yes + kill_vm = yes ++ exploit_cmd = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/nx/nx_exploit" + variants: + - noexec_on: + nx_on = yes diff --git a/recipes-test/virt-test/files/qemu-tests-pipetest-config.patch b/recipes-test/virt-test/files/qemu-tests-pipetest-config.patch new file mode 100644 index 0000000..3f592ce --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-pipetest-config.patch @@ -0,0 +1,26 @@ +commit 6a2f0e98999abb7b4be8a3ea29a5dfd23fffb154 +Author: Jonas Eriksson +Date: Thu Mar 27 10:14:20 2014 +0100 + + pipetest application: Add configuration + + Signed-off-by: Jonas Eriksson + Upstream-Status: Inappropriate [configuration] + +diff --git a/qemu/tests/cfg/ipi_x2apic.cfg b/qemu/tests/cfg/ipi_x2apic.cfg +index f65f2c8..22e8dc3 100644 +--- a/qemu/tests/cfg/ipi_x2apic.cfg ++++ b/qemu/tests/cfg/ipi_x2apic.cfg +@@ -1,10 +1,10 @@ + - ipi_x2apic: + no Host_RHEL.5 +- only RHEL.6 ++ only RHEL.6, JeOS + type = ipi_x2apic + vms = "" + check_x2apic_cmd = dmesg |grep x2apic +- pipetest_cmd = "/tmp/pipetest" ++ pipetest_cmd = "/opt/virt-test/shared/scripts/pipetest" + build_pipetest_cmd = "cd /tmp/ && gcc -o pipetest pipetest.c" + x2apic_check_string = Enabling x2apic, Enabled x2apic, Setting APIC routing to physical x2apic + pre_command += " grep 'flags' /proc/cpuinfo|grep 'ept' && modprobe -r kvm_intel && modprobe kvm_intel ept=1 || echo ok;" diff --git a/recipes-test/virt-test/files/qemu-tests-stress-config.patch b/recipes-test/virt-test/files/qemu-tests-stress-config.patch new file mode 100644 index 0000000..6a2cd0e --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-stress-config.patch @@ -0,0 +1,28 @@ +commit 270cc35ea5c0379df1502f2a83af992db4d65439 +Author: Jonas Eriksson +Date: Fri Mar 28 08:46:49 2014 +0100 + + stress: Add configuration + + Signed-off-by: Jonas Eriksson + Upstream-Status: Inappropriate [configuration] + +diff --git a/qemu/tests/cfg/softlockup.cfg b/qemu/tests/cfg/softlockup.cfg +index 28e4057..1588b6a 100644 +--- a/qemu/tests/cfg/softlockup.cfg ++++ b/qemu/tests/cfg/softlockup.cfg +@@ -1,12 +1,11 @@ + - softlockup: install setup unattended_install.cdrom +- no JeOS + only Linux + type = softlockup + stress_source = stress-1.0.4.tar.gz +- stress_setup_cmd = "cd %s && tar xvf stress-1.0.4.tar.gz && cd stress-1.0.4 && ./configure && make && cd src" ++ monitor_dir = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/softlockup/" + server_setup_cmd = "%s/heartbeat_slu.py --server --threshold %s --file %s --port %s --verbose --check-drift" + client_setup_cmd = "%s/heartbeat_slu.py --client --address %s --file %s --port %s --interval 1" +- stress_cmd = "cd %s && cd stress-1.0.4 && cd src && nohup ./stress -c %s > /dev/null 2>&1&" ++ stress_cmd = "sh -ec 'export dir=%s/stress-run; mkdir -p $dir; cd $dir' && nohup stress -c %s > /dev/null 2>&1 &" + kill_monitor_cmd = "ps aux | grep heart | grep -v grep | awk '{print$2}' | xargs kill -9 > /dev/null 2>&1" + kill_stress_cmd = "pkill -f stress > /dev/null 2>&1" + drift_cmd = "tail -1 %s | awk '{print $7}'" diff --git a/recipes-test/virt-test/files/qemu-tests-time-drift-config.patch b/recipes-test/virt-test/files/qemu-tests-time-drift-config.patch new file mode 100644 index 0000000..16bec8d --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-time-drift-config.patch @@ -0,0 +1,37 @@ +commit 7ce64e2e13a302e3675718aef6238dd649dba5b3 +Author: Jonas Eriksson +Date: Thu Mar 27 10:08:44 2014 +0100 + + time drift test: Add configuration + + Signed-off-by: Jonas Eriksson + Upstream-Status: Inappropriate [configuration] + +diff --git a/qemu/tests/cfg/timedrift_check_clock_offset.cfg b/qemu/tests/cfg/timedrift_check_clock_offset.cfg +index 3395ede..460435d 100644 +--- a/qemu/tests/cfg/timedrift_check_clock_offset.cfg ++++ b/qemu/tests/cfg/timedrift_check_clock_offset.cfg +@@ -8,11 +8,10 @@ + type = timedrift_check_with_syscall + start_vm = yes + only Linux +- no JeOS + tmp_dir = "/tmp" + result_file = "clktest.log" + build_cmd = "gcc -lrt ${tmp_dir}/clktest.c -o clktest" +- test_cmd = "./clktest" ++ test_cmd = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/timedrift/clktest" + check_timeout = 300 + - when_crash: + type = timedrift_check_when_crash +diff --git a/qemu/tests/cfg/tsc_drift.cfg b/qemu/tests/cfg/tsc_drift.cfg +index 26f0cef..a55385c 100644 +--- a/qemu/tests/cfg/tsc_drift.cfg ++++ b/qemu/tests/cfg/tsc_drift.cfg +@@ -6,4 +6,6 @@ + interval = 30 + required_cpu_flags = "constant_tsc" + pre_command = "/usr/bin/python shared/scripts/check_cpu_flag.py" ++ tsc_cmd_host = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/timedrift/get_tsc" ++ tsc_cmd_guest = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/timedrift/get_tsc" + smp_min = 2 diff --git a/recipes-test/virt-test/files/qemu-tests-tsc-sync-build-avoidance.patch b/recipes-test/virt-test/files/qemu-tests-tsc-sync-build-avoidance.patch new file mode 100644 index 0000000..2e078ff --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-tsc-sync-build-avoidance.patch @@ -0,0 +1,194 @@ +commit 58b79263adaaee08a7a913268f36e2f957b330db +Author: Jonas Eriksson +Date: Fri Mar 21 15:21:18 2014 +0100 + + tsc_sync tests: Avoid build and parameterize + + Signed-off-by: Jonas Eriksson + Upstream-Status: Pending + +diff --git a/qemu/tests/timerdevice_clock_drift_with_ntp.py b/qemu/tests/timerdevice_clock_drift_with_ntp.py +index 4498519..28f22c0 100644 +--- a/qemu/tests/timerdevice_clock_drift_with_ntp.py ++++ b/qemu/tests/timerdevice_clock_drift_with_ntp.py +@@ -26,9 +26,11 @@ def run(test, params, env): + :param params: Dictionary with test parameters. + :param env: Dictionary with the test environment. + """ ++ drift_filename = params.get("drift_filename", "/var/lib/ntp/drift") ++ + def _drift_file_exist(): + try: +- session.cmd("test -f /var/lib/ntp/drift") ++ session.cmd("test -f %s" % drift_filename) + return True + except Exception: + return False +@@ -46,20 +48,25 @@ def run(test, params, env): + timeout = int(params.get("login_timeout", 360)) + sess_guest_load = vm.wait_for_login(timeout=timeout) + +- error.context("Copy time-warp-test.c to guest", logging.info) +- src_file_name = os.path.join(data_dir.get_deps_dir(), "time_warp", +- "time-warp-test.c") +- vm.copy_files_to(src_file_name, "/tmp") ++ time_warp_test_cmd = params.get("time_warp_test_cmd", "/tmp/time-warp-test") ++ ++ if sess_guest_load.get_command_status("test -x %s" % time_warp_test_cmd): ++ error.context("Copy time-warp-test.c to guest", logging.info) ++ src_file_name = os.path.join(data_dir.get_deps_dir(), "time_warp", ++ "time-warp-test.c") ++ vm.copy_files_to(src_file_name, "/tmp") + +- error.context("Compile the time-warp-test.c", logging.info) +- cmd = "cd /tmp/;" +- cmd += " yum install -y popt-devel;" +- cmd += " rm -f time-warp-test;" +- cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" +- sess_guest_load.cmd(cmd) ++ error.context("Compile the time-warp-test.c", logging.info) ++ cmd = "cd /tmp/;" ++ cmd += " yum install -y popt-devel;" ++ cmd += " rm -f time-warp-test;" ++ cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" ++ sess_guest_load.cmd(cmd) + + error.context("Stop ntpd and apply load on guest", logging.info) +- sess_guest_load.cmd("yum install -y ntp; service ntpd stop") ++ default_ntp_stop_cmd = "yum install -y ntp; service ntpd stop; rm -f %s" % drift_filename ++ ntp_stop_cmd = params.get("ntp_stop_cmd", default_ntp_stop_cmd) ++ sess_guest_load.cmd(ntp_stop_cmd) + load_cmd = "for ((I=0; I<`grep 'processor id' /proc/cpuinfo| wc -l`; I++));" + load_cmd += " do taskset -c $I /bin/bash -c 'for ((;;)); do X=1; done &';" + load_cmd += " done" +@@ -80,12 +87,12 @@ def run(test, params, env): + + error.context("Run time-warp-test", logging.info) + session = vm.wait_for_login(timeout=timeout) +- cmd = "/tmp/time-warp-test > /dev/null &" ++ cmd = "%s > /dev/null &" % time_warp_test_cmd + session.sendline(cmd) + + error.context("Start ntpd on guest", logging.info) +- cmd = "service ntpd start; sleep 1; echo" +- session.cmd(cmd) ++ ntp_start_cmd = params.get("ntp_start_cmd", "service ntpd start; sleep 1; echo") ++ session.cmd(ntp_start_cmd) + + error.context("Check if the drift file exists on guest", logging.info) + test_run_timeout = float(params["test_run_timeout"]) +@@ -93,10 +100,12 @@ def run(test, params, env): + utils_misc.wait_for(_drift_file_exist, test_run_timeout, step=5) + except aexpect.ShellCmdError, detail: + raise error.TestError("Failed to wait for the creation of" +- " /var/lib/ntp/drift file. Detail: '%s'" % detail) ++ " %s file. Detail: '%s'" % ++ (drift_filename, detail)) + + error.context("Verify the drift file content on guest", logging.info) +- output = session.cmd("cat /var/lib/ntp/drift") ++ output = session.cmd("cat %s" % drift_filename) + if int(abs(float(output))) > 20: + raise error.TestFail("Failed to check the ntp drift." +- " Output: '%s'" % output) ++ " Output from 'cat %s': '%s'" % ++ (drift_filename, output)) +diff --git a/qemu/tests/timerdevice_tscsync_change_host_clksource.py b/qemu/tests/timerdevice_tscsync_change_host_clksource.py +index 5339fce..3ea6cb2 100644 +--- a/qemu/tests/timerdevice_tscsync_change_host_clksource.py ++++ b/qemu/tests/timerdevice_tscsync_change_host_clksource.py +@@ -43,23 +43,27 @@ def run(test, params, env): + if not '0' in output: + raise error.TestFail("Failed to check vsyscall. Output: '%s'" % output) + +- error.context("Copy time-warp-test.c to guest", logging.info) +- src_file_name = os.path.join(data_dir.get_deps_dir(), "tsc_sync", +- "time-warp-test.c") +- vm.copy_files_to(src_file_name, "/tmp") +- +- error.context("Compile the time-warp-test.c", logging.info) +- cmd = "cd /tmp/;" +- cmd += " yum install -y popt-devel;" +- cmd += " rm -f time-warp-test;" +- cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" +- session.cmd(cmd) +- +- error.context("Run time-warp-test", logging.info) ++ time_warp_test_cmd = params.get("time_warp_test_cmd", "/tmp/time-warp-test") ++ ++ if session.get_command_status("test -x %s" % time_warp_test_cmd): ++ error.context("Copy time-warp-test.c to guest", logging.info) ++ src_file_name = os.path.join(data_dir.get_deps_dir(), "tsc_sync", ++ "time-warp-test.c") ++ vm.copy_files_to(src_file_name, "/tmp") ++ ++ error.context("Compile the time-warp-test.c", logging.info) ++ cmd = "cd /tmp/;" ++ cmd += " yum install -y popt-devel;" ++ cmd += " rm -f time-warp-test;" ++ cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" ++ session.cmd(cmd) ++ ++ time_warp_test_cmd = "/tmp/time-warp-test" ++ ++ error.context("Run %s" % time_warp_test_cmd, logging.info) + test_run_timeout = int(params.get("test_run_timeout", 10)) + session.sendline("$(sleep %d; pkill time-warp-test) &" % test_run_timeout) +- cmd = "/tmp/time-warp-test" +- _, output = session.cmd_status_output(cmd, timeout=(test_run_timeout + 60)) ++ _, output = session.cmd_status_output(time_warp_test_cmd, timeout=(test_run_timeout + 60)) + + re_str = "fail:(\d+).*?fail:(\d+).*fail:(\d+)" + fail_cnt = re.findall(re_str, output) +@@ -83,8 +87,7 @@ def run(test, params, env): + logging.info) + cmd = "$(sleep %d; pkill time-warp-test) &" + session.sendline(cmd % test_run_timeout) +- cmd = "/tmp/time-warp-test" +- _, output = session.cmd_status_output(cmd, ++ _, output = session.cmd_status_output(time_warp_test_cmd, + timeout=(test_run_timeout + 60)) + + fail_cnt = re.findall(re_str, output) +diff --git a/qemu/tests/timerdevice_tscsync_longtime.py b/qemu/tests/timerdevice_tscsync_longtime.py +index 47cc659..841be62 100644 +--- a/qemu/tests/timerdevice_tscsync_longtime.py ++++ b/qemu/tests/timerdevice_tscsync_longtime.py +@@ -40,23 +40,25 @@ def run(test, params, env): + timeout = int(params.get("login_timeout", 360)) + session = vm.wait_for_login(timeout=timeout) + +- error.context("Copy time-warp-test.c to guest", logging.info) +- src_file_name = os.path.join(data_dir.get_root_dir(), "shared", "deps", +- "time-warp-test.c") +- vm.copy_files_to(src_file_name, "/tmp") ++ time_warp_test_cmd = params.get("time_warp_test_cmd", "/tmp/time-warp-test") + +- error.context("Compile the time-warp-test.c", logging.info) +- cmd = "cd /tmp/;" +- cmd += " yum install -y popt-devel;" +- cmd += " rm -f time-warp-test;" +- cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" +- session.cmd(cmd) ++ if sess_guest_load.get_command_status("test -x %s", time_warp_test_cmd): ++ error.context("Copy time-warp-test.c to guest", logging.info) ++ src_file_name = os.path.join(data_dir.get_root_dir(), "shared", "deps", ++ "time-warp-test.c") ++ vm.copy_files_to(src_file_name, "/tmp") ++ ++ error.context("Compile the time-warp-test.c", logging.info) ++ cmd = "cd /tmp/;" ++ cmd += " yum install -y popt-devel;" ++ cmd += " rm -f time-warp-test;" ++ cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" ++ session.cmd(cmd) + + error.context("Run time-warp-test for minimum 4 hours", logging.info) + test_run_timeout = int(params.get("test_run_timeout", 14400)) + session.sendline("$(sleep %d; pkill time-warp-test) &" % test_run_timeout) +- cmd = "/tmp/time-warp-test" +- _, output = session.cmd_status_output(cmd, timeout=(test_run_timeout + 60)) ++ _, output = session.cmd_status_output(time_warp_test_cmd, timeout=(test_run_timeout + 60)) + + re_str = "fail:(\d+).*?fail:(\d+).*fail:(\d+)" + fail_cnt = re.findall(re_str, output) diff --git a/recipes-test/virt-test/files/qemu-tests-tsc-sync-config.patch b/recipes-test/virt-test/files/qemu-tests-tsc-sync-config.patch new file mode 100644 index 0000000..8f45b5e --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-tsc-sync-config.patch @@ -0,0 +1,21 @@ +commit ee71d759a8133bf9af53e430eaa2b8fe47cbd283 +Author: Jonas Eriksson +Date: Thu Mar 27 10:11:25 2014 +0100 + + tsc_sync tests: Add configuration + + Signed-off-by: Jonas Eriksson + Upstream-Status: Inappropriate [configuration] + +diff --git a/qemu/tests/cfg/timerdevice.cfg b/qemu/tests/cfg/timerdevice.cfg +index 9ef38c6..02d653c 100644 +--- a/qemu/tests/cfg/timerdevice.cfg ++++ b/qemu/tests/cfg/timerdevice.cfg +@@ -1,6 +1,7 @@ + - timerdevice: + no Host_RHEL.5, Host_RHEL.6 + restart_vm = yes ++ time_warp_test_cmd = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/tsc_sync/time-warp-test" + variants: + - tscwrite: + only Fedora.19, RHEL.7 diff --git a/recipes-test/virt-test/files/qemu-tests-virtual-nic-send-buffer-config.patch b/recipes-test/virt-test/files/qemu-tests-virtual-nic-send-buffer-config.patch new file mode 100644 index 0000000..ee93236 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-virtual-nic-send-buffer-config.patch @@ -0,0 +1,26 @@ +commit ec85c479019a50724d78e41c1820c89b9e1af88a +Author: Jonas Eriksson +Date: Fri Mar 28 13:11:52 2014 +0100 + + virtual_nic_send_buffer test: Add configuration + + Signed-off-by: Jonas Eriksson + Upstream-Status: Inappropriate [configuration] + +diff --git a/qemu/tests/cfg/virtual_nic_send_buffer.cfg b/qemu/tests/cfg/virtual_nic_send_buffer.cfg +index c11715c..d6fc3b8 100644 +--- a/qemu/tests/cfg/virtual_nic_send_buffer.cfg ++++ b/qemu/tests/cfg/virtual_nic_send_buffer.cfg +@@ -8,11 +8,10 @@ + mem = 1024 + copy_protocol = tcp + # Params for sub_test netperf_udp +- hostpasswd = redhat ++ hostpasswd = 123456 + message_size_range = 580 590 1 + sub_test_name = netperf_udp + dsthost = localhost +- netperf_download_link = netperf/netperf-2.6.0.tar.bz2 + test_protocol = UDP_STREAM + Windows: + vm_as_server = yes diff --git a/recipes-test/virt-test/files/remove_7za_dependency.patch b/recipes-test/virt-test/files/remove_7za_dependency.patch new file mode 100644 index 0000000..4eeca94 --- /dev/null +++ b/recipes-test/virt-test/files/remove_7za_dependency.patch @@ -0,0 +1,13 @@ +diff --git a/virttest/bootstrap.py b/virttest/bootstrap.py +index e7644a6..73c103a 100644 +--- a/virttest/bootstrap.py ++++ b/virttest/bootstrap.py +@@ -10,7 +10,7 @@ import asset + import cartesian_config + import utils_selinux + +-basic_program_requirements = ['7za', 'tcpdump', 'nc', 'ip', 'arping'] ++basic_program_requirements = ['tcpdump', 'nc', 'ip', 'arping'] + + recommended_programs = {'qemu': [('qemu-kvm', 'kvm'), ('qemu-img',), + ('qemu-io',)], diff --git a/recipes-test/virt-test/files/remove_gcc_dependency.patch b/recipes-test/virt-test/files/remove_gcc_dependency.patch new file mode 100644 index 0000000..fc4aa04 --- /dev/null +++ b/recipes-test/virt-test/files/remove_gcc_dependency.patch @@ -0,0 +1,13 @@ +diff --git a/virttest/bootstrap.py b/virttest/bootstrap.py +index 73c103a..c4e2623 100644 +--- a/virttest/bootstrap.py ++++ b/virttest/bootstrap.py +@@ -22,7 +22,7 @@ recommended_programs = {'qemu': [('qemu-kvm', 'kvm'), ('qemu-img',), + 'v2v': [], + 'libguestfs': [('perl',)]} + +-mandatory_programs = {'qemu': basic_program_requirements + ['gcc'], ++mandatory_programs = {'qemu': basic_program_requirements, + 'libvirt': basic_program_requirements, + 'openvswitch': basic_program_requirements, + 'lvsb': ['virt-sandbox', 'virt-sandbox-service', 'virsh'], diff --git a/recipes-test/virt-test/files/virt-test-ppc.patch b/recipes-test/virt-test/files/virt-test-ppc.patch new file mode 100644 index 0000000..865f42d --- /dev/null +++ b/recipes-test/virt-test/files/virt-test-ppc.patch @@ -0,0 +1,121 @@ +Enable ppc support in virt-test + +Signed-off-by: Jonas Eriksson +Upstream-Status: Pending +diff --git a/virttest/arch.py b/virttest/arch.py +index d5e92f6..b1f0084 100644 +--- a/virttest/arch.py ++++ b/virttest/arch.py +@@ -3,7 +3,7 @@ from virttest import utils_misc + + ARCH = platform.machine() + +-if ARCH == "ppc64": ++if ARCH == "ppc64" or ARCH == "ppc": + # From include/linux/sockios.h + SIOCSIFHWADDR = 0x8924 + SIOCGIFHWADDR = 0x8927 +@@ -58,5 +58,5 @@ def get_kvm_module_list(): + arch_convert = {'GenuineIntel': 'intel', 'AuthenticAMD': 'amd'} + host_cpu_type = utils_misc.get_cpu_vendor(verbose=False) + return ["kvm", "kvm-%s" % arch_convert[host_cpu_type]] +- elif ARCH == 'ppc64': ++ elif ARCH == 'ppc64' or ARCH == 'ppc': + return ["kvm"] +diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py +index c6a3104..a5098be 100644 +--- a/virttest/utils_misc.py ++++ b/virttest/utils_misc.py +@@ -1589,6 +1590,8 @@ def get_host_cpu_models(): + + if ARCH == 'ppc64': + return ['POWER7'] ++ if ARCH == 'ppc': ++ return ['e500mc'] + + cpu_types = {"AuthenticAMD": ["Opteron_G5", "Opteron_G4", "Opteron_G3", + "Opteron_G2", "Opteron_G1"], +diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py +index 27a6025..3e982bb 100644 +--- a/virttest/qemu_vm.py ++++ b/virttest/qemu_vm.py +@@ -421,20 +421,33 @@ class VM(virt_vm.BaseVM): + cmd += _add_option("mode", "control") + return cmd + +- def add_serial(devices, name, filename): +- if not devices.has_option("chardev"): +- return " -serial unix:'%s',server,nowait" % filename +- +- serial_id = "serial_id_%s" % name ++ def add_serial_chardev(serial_id, filename): + cmd = " -chardev socket" + cmd += _add_option("id", serial_id) + cmd += _add_option("path", filename) + cmd += _add_option("server", "NO_EQUAL_STRING") + cmd += _add_option("nowait", "NO_EQUAL_STRING") ++ return cmd ++ ++ def add_isa_serial(devices, name, filename): ++ if not devices.has_option("chardev"): ++ return " -serial unix:'%s',server,nowait" % filename ++ ++ serial_id = "serial_id_%s" % name ++ cmd = add_serial_chardev(serial_id, filename) + cmd += " -device isa-serial" + cmd += _add_option("chardev", serial_id) + return cmd + ++ def add_direct_serial(devices, name, filename): ++ if not devices.has_option("chardev"): ++ return " -serial unix:'%s',server,nowait" % filename ++ ++ serial_id = "serial_id_%s" % name ++ cmd = add_serial_chardev(serial_id, filename) ++ cmd += " -serial chardev:%s" % serial_id ++ return cmd ++ + def add_virtio_port(devices, name, bus, filename, porttype, chardev, + name_prefix=None, index=None, extra_params=""): + """ +@@ -1190,7 +1203,11 @@ class VM(virt_vm.BaseVM): + # Add serial console redirection + for serial in params.objects("isa_serials"): + serial_filename = vm.get_serial_console_filename(serial) +- cmd = add_serial(devices, serial, serial_filename) ++ cmd = add_isa_serial(devices, serial, serial_filename) ++ devices.insert(StrDev('SER-%s' % serial, cmdline=cmd)) ++ for serial in params.objects("direct_serials"): ++ serial_filename = vm.get_serial_console_filename(serial) ++ cmd = add_direct_serial(devices, serial, serial_filename) + devices.insert(StrDev('SER-%s' % serial, cmdline=cmd)) + + # Add virtio_serial ports +@@ -1473,10 +1490,10 @@ class VM(virt_vm.BaseVM): + continue + cpu_model = model + break +- else: +- cpu_model = model +- logging.error("Non existing CPU model %s will be passed " +- "to qemu (wrong config or negative test)", model) ++ else: ++ cpu_model = model ++ logging.error("Non existing CPU model %s will be passed " ++ "to qemu (wrong config or negative test)", model) + + if use_default_cpu_model: + cpu_model = params.get("default_cpu_model") +@@ -2230,9 +2247,11 @@ class VM(virt_vm.BaseVM): + # Add this monitor to the list + self.monitors += [monitor] + +- # Create isa serial ports. ++ # Create serial ports. + for serial in params.objects("isa_serials"): + self.serial_ports.append(serial) ++ for serial in params.objects("direct_serials"): ++ self.serial_ports.append(serial) + + # Create virtio_ports (virtio_serialports and virtio_consoles) + i = 0 diff --git a/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch b/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch new file mode 100644 index 0000000..016a6d2 --- /dev/null +++ b/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch @@ -0,0 +1,32 @@ +commit 00c37654013d216243383453de309a639f2599f3 +Author: Jonas Eriksson +Date: Mon Apr 14 08:41:33 2014 +0200 + + qemu_vm: Add monotonic start time + + For tests that would like to fetch the monotonic start time, expose it + through the start_monotonic_time member. + + Signed-off-by: Jonas Eriksson + Upstream-Status: Backport + +diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py +index 0a58362..6ed2736 100644 +--- a/virttest/qemu_vm.py ++++ b/virttest/qemu_vm.py +@@ -150,6 +150,7 @@ class VM(virt_vm.BaseVM): + self.instance = state['instance'] + self.qemu_command = '' + self.start_time = 0.0 ++ self.start_monotonic_time = 0.0 + self.last_boot_index = 0 + self.last_driver_index = 0 + +@@ -2169,6 +2170,7 @@ class VM(virt_vm.BaseVM): + logging.info("Created qemu process with parent PID %d", + self.process.get_pid()) + self.start_time = time.time() ++ self.start_monotonic_time = utils_misc.monotonic_time() + + # test doesn't need to hold tapfd's open + for nic in self.virtnet: diff --git a/recipes-test/virt-test/files/virt-test-search-qemu-system-arch.patch b/recipes-test/virt-test/files/virt-test-search-qemu-system-arch.patch new file mode 100644 index 0000000..2199317 --- /dev/null +++ b/recipes-test/virt-test/files/virt-test-search-qemu-system-arch.patch @@ -0,0 +1,21 @@ +diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py +index c6a3104..61ffb23 100644 +--- a/virttest/utils_misc.py ++++ b/virttest/utils_misc.py +@@ -21,6 +21,7 @@ import tarfile + import shutil + import getpass + import ctypes ++import platform + from autotest.client import utils, os_dep + from autotest.client.shared import error, logging_config + from autotest.client.shared import git +@@ -1697,7 +1698,7 @@ def get_qemu_binary(params): + qemu_binary = find_command('qemu-kvm') + logging.debug('Found %s', qemu_binary) + except ValueError: +- qemu_binary = find_command('kvm') ++ qemu_binary = find_command('qemu-system-%s' % platform.machine()) + logging.debug('Found %s', qemu_binary) + else: + library_path = os.path.join(_get_backend_dir(params), 'install_root', 'lib') diff --git a/recipes-test/virt-test/files/virttest-passfd-compiler-fix.patch b/recipes-test/virt-test/files/virttest-passfd-compiler-fix.patch new file mode 100644 index 0000000..cdbb8ef --- /dev/null +++ b/recipes-test/virt-test/files/virttest-passfd-compiler-fix.patch @@ -0,0 +1,24 @@ +commit f97e66a1308b41fa70d662643de03d0e8a7c71cb +Author: Jonas Eriksson +Date: Tue Apr 1 10:53:31 2014 +0200 + + passfd_setup: Configure the compiler + + In order to pull cross-compilation information from the environment, the + compiler needs to be customized. + + Signed-off-by: Jonas Eriksson + Upstream-Status: Pending + +diff --git a/virttest/passfd_setup.py b/virttest/passfd_setup.py +index d6fe590..9dc7750 100644 +--- a/virttest/passfd_setup.py ++++ b/virttest/passfd_setup.py +@@ -26,6 +26,7 @@ def passfd_setup(output_dir=OUTPUT_DIR): + output_file = os.path.join(output_dir, SHARED_OBJECT) + + c = distutils.ccompiler.new_compiler() ++ distutils.sysconfig.customize_compiler(c) + objects = c.compile(SOURCES, include_dirs=[PYTHON_HEADERS], + output_dir=data_dir.get_tmp_dir(), + extra_postargs=['-fPIC']) diff --git a/recipes-test/virt-test/files/virttest-utils-misc-cpu-flags-fix.patch b/recipes-test/virt-test/files/virttest-utils-misc-cpu-flags-fix.patch new file mode 100644 index 0000000..68b59ba --- /dev/null +++ b/recipes-test/virt-test/files/virttest-utils-misc-cpu-flags-fix.patch @@ -0,0 +1,25 @@ +commit 6a22985e22876351874d9d9687a0e44b3488f055 +Author: Jonas Eriksson +Date: Tue Apr 1 13:30:50 2014 +0200 + + utils_misc: Use re.split to do regexp split + + The .split() method of python's standard string type does not take a + regexp as an argument, only another string. Switch to re.split(). + + Signed-off-by: Jonas Eriksson + Upstream-Status: Pending + +diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py +index d63aaef..2396be8 100644 +--- a/virttest/utils_misc.py ++++ b/virttest/utils_misc.py +@@ -1495,7 +1495,7 @@ def get_cpu_flags(cpu_info=""): + if not cpu_flag_lists: + return [] + cpu_flags = cpu_flag_lists[0] +- return cpu_flags.strip().split('\s+') ++ return re.split("\s+", cpu_flags.strip()) + + + def get_cpu_vendor(cpu_info="", verbose=True): diff --git a/recipes-test/virt-test/virt-test-libvirt_git.bb b/recipes-test/virt-test/virt-test-libvirt_git.bb new file mode 100644 index 0000000..c14a242 --- /dev/null +++ b/recipes-test/virt-test/virt-test-libvirt_git.bb @@ -0,0 +1,26 @@ +SUMMARY = "Linux Virtualization Tests - libvirt tests" +DESCRIPTION = "Libvirt tests for the virt-test test framework" +HOMEPAGE = "https://github.com/autotest/tp-libvirt" +SECTION = "console/tests" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=17f870b05bb22b9c31f4d593711edf58" + +RDEPENDS_${PN} = "virt-test" + +# Use date of commit pointed to by SRCREV +PV = "2014.03.07" +SRCREV = "9d4c278ed36e8bd4104cf94e77dc7e89f4ccb917" + +SRC_URI = "git://github.com/autotest/tp-libvirt" + +S = "${WORKDIR}/git" +B = "${S}" + +DESTDIR = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-libvirt/" + +FILES_${PN} += "${DESTDIR}" + +do_install() { + install -d ${D}/${DESTDIR} + cp -r --preserve=mode,links ${B}/* ${D}/${DESTDIR} +} diff --git a/recipes-test/virt-test/virt-test-qemu_git.bb b/recipes-test/virt-test/virt-test-qemu_git.bb new file mode 100644 index 0000000..40f4e56 --- /dev/null +++ b/recipes-test/virt-test/virt-test-qemu_git.bb @@ -0,0 +1,118 @@ +SUMMARY = "Linux Virtualization Tests - qemu tests" +DESCRIPTION = "Qemu tests for the virt-test test framework" +HOMEPAGE = "https://github.com/autotest/tp-qemu" +SECTION = "console/tests" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=575f01e0b7a35e73c8e52ca65fd72bdc" + +def if_arch_re(regexp, trueval, falseval, d): + import re + target_arch = bb.data.getVar('TARGET_ARCH', d, 1) + return trueval if re.match(regexp, target_arch) else falseval + +RDEPENDS_${PN} = "virt-test iperf ntpdate stress python-netserver \ + ${@if_arch_re("^(i[3-9]86|x86_64)", "virt-test-qemu-guest-timedrift virt-test-qemu-guest-cpuflags", "", d)} \ + " +DEPENDS += "popt" + +# Use date of commit pointed to by SRCREV +PV = "2014.04.16" +SRCREV = "3e15869b4b838c47ce9ea0d4916e1edb89ccc58e" + +SRC_URI = "git://github.com/autotest/tp-qemu \ + file://qemu-tests-multi-nic-stress.patch \ + file://qemu-tests-time-drift-config.patch \ + file://qemu-tests-tsc-sync-build-avoidance.patch \ + file://qemu-tests-tsc-sync-config.patch \ + file://qemu-tests-pipetest-config.patch \ + file://qemu-tests-nx-exploit-config.patch \ + file://qemu-tests-clock-getres-config.patch \ + file://qemu-tests-stress-config.patch \ + file://qemu-tests-virtual-nic-send-buffer-config.patch \ + file://qemu-tests-cpuflags-migrate-to-provider.patch \ + file://qemu-tests-cpuflags-build-avoidance.patch \ + file://qemu-tests-cpuflags-conf.patch \ + file://qemu-tests-cyclictest.patch \ + " + +S = "${WORKDIR}/git" +B = "${S}" + +DESTDIR = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu" + +FILES_${PN} += "${DESTDIR}" + +FILES_${PN}-dbg = " \ + ${DESTDIR}/qemu/deps/timedrift/.debug/* \ + ${DESTDIR}/qemu/deps/tsc_sync/.debug/* \ + ${DESTDIR}/qemu/deps/nx/.debug/* \ + ${DESTDIR}/generic/deps/clock_getres/.debug/clock_getres \ + ${DESTDIR}/deps/cpu_flags/src/.debug/cpuflags-test-* \ + " + +PACKAGES =+ "${PN}-guest-timedrift ${PN}-guest-tsc-sync ${PN}-guest-nx \ + ${PN}-guest-clock-getres ${PN}-guest-cpuflags" + +DESCRIPTION_${PN}-guest-timedrift= "Clock test application for time drift test case" +FILES_${PN}-guest-timedrift = "${DESTDIR}/qemu/deps/timedrift/clktest \ + ${DESTDIR}/qemu/deps/timedrift/get_tsc" + +DESCRIPTION_${PN}-guest-tsc-sync = "Clock test application for time warp test case" +FILES_${PN}-guest-tsc-sync = "${DESTDIR}/qemu/deps/tsc_sync/time-warp-test" + +DESCRIPTION_${PN}-guest-nx = "Test application for the NX (no execution) flag" +FILES_${PN}-guest-nx = "${DESTDIR}/qemu/deps/nx/nx_exploit" + +DESCRIPTION_${PN}-guest-clock-getres = "Clock resolution test application" +FILES_${PN}-guest-clock-getres = "${DESTDIR}/generic/deps/clock_getres/clock_getres" + +DESCRIPTION_${PN}-guest-cpuflags = "CPU flag test application" +FILES_${PN}-guest-cpuflags = "${DESTDIR}/deps/cpu_flags/src/cpuflags-test-*" +RDEPENDS_${PN}-guest-cpuflags =+ "libgomp" + +do_compile_x86() { + # guest-timedrift + cd ${S}/qemu/deps/timedrift/ + ${CC} get_tsc.c -o get_tsc + + # guest-tsc-sync + cd ${S}/qemu/deps/tsc_sync/ + ${CC} -I${STAGING_DIR_TARGET}/usr/include -Wall -o time-warp-test time-warp-test.c -lrt + + # guest-nx + cd ${S}/qemu/deps/nx/ + ${CC} -o nx_exploit x64_sc_rdo.c + + # guest-cpuflags + # Note: The $GCC_INCLUDEDIR should be searched for include files according to + # http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html. However, it seems that + # gcc-cross searches in e.g. + # .../sysroots/x86_64-linux/usr/lib/corei7-64-enea-linux/gcc/x86_64-enea-linux/4.8.2/include/ + # instead of + # .../sysroots/chiefriver/usr/lib/gcc/x86_64-enea-linux/4.8.2/include, + # despite --sysroot= pointing to the latter (.../sysroots/chiefriver). + export TARGET=`${CC} -v 2>&1 | grep ^Target | cut -d' ' -f2` + export GCC_VERSION=`${CC} -v 2>&1 | grep '^gcc version' | cut -d' ' -f3` + export GCC_INCLUDEDIR=$PKG_CONFIG_SYSROOT_DIR$libdir/gcc/$TARGET/$GCC_VERSION/include + make -C ${S}/deps/cpu_flags/src/ CFLAGS="-I$GCC_INCLUDEDIR" EXTRA_FLAGS='' + make -C ${S}/deps/cpu_flags/src/ CFLAGS="-I$GCC_INCLUDEDIR" EXTRA_FLAGS='-msse3 -msse2' + # Avoid .o files in the package + rm -rf ${S}/qemu/deps/cpu_flags/src/build-* +} + +do_compile() { + # guest-timedrift + cd ${S}/qemu/deps/timedrift/ + ${CC} clktest.c -o clktest -lrt + + # guest-clock-getres + make -C ${S}/generic/deps/clock_getres/ + + # Architecture-specific applications + ${@if_arch_re("^(i[3-9]86|x86_64)", "do_compile_x86", "", d)} +} + +do_install() { + install -d ${D}/${DESTDIR} + cp -r --preserve=mode,links ${B}/* ${D}/${DESTDIR} +} diff --git a/recipes-test/virt-test/virt-test_git.bb b/recipes-test/virt-test/virt-test_git.bb new file mode 100644 index 0000000..ea588f0 --- /dev/null +++ b/recipes-test/virt-test/virt-test_git.bb @@ -0,0 +1,77 @@ +SUMMARY = "Linux Virtualization Tests" +DESCRIPTION = "virt-test is a Linux virtualization test suite, intended to be used in conjunction with the autotest framework" +HOMEPAGE = "https://github.com/autotest/virt-test" +SECTION = "console/tests" +LICENSE = "GPLv2 & MIT & PSF" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ca2697f94d6c6ecb0c4ed70d4bca81e2 \ + file://README.rst;md5=3f0b5623cfac6b30670bd27eb823e12e" + +RDEPENDS_${PN} = "autotest tcpdump iputils netcat-openbsd virt-manager procps \ + less python-logging python-shell python-resource python-subprocess \ + python-netclient python-email python-compression python-unixadmin \ + python-ctypes python-html python-terminal python-distutils \ + python-math python-numbers python-xml python-db" + +DEPENDS += "python" + +# We cannot use the default do_compile etc. from distutils, so just use +# distutils-base to get all the correct paths. +inherit distutils-base + +# SRCREV reflects the packaged PV +PV = "2014.04.14" +SRCREV = "b6ee5f288e16d5a72e562a567295d40d3a890fcb" + +SRC_URI = "git://github.com/autotest/virt-test \ + file://remove_7za_dependency.patch \ + file://remove_gcc_dependency.patch \ + file://clear_mandatory_header_list.patch \ + file://do_not_upgrade_test_providers.patch \ + file://allow_bootstrap_3rd_party_image.patch \ + file://add_enea_linux_support.patch \ + file://virt-test-qemu_vm-add-monotonic-start-time.patch \ + file://dnsmasq-virt-test \ + file://virt-test-search-qemu-system-arch.patch \ + file://virt-test-ppc.patch \ +" + +S = "${WORKDIR}/git" +B = "${S}" + +FILES_${PN} += "/opt /etc/dnsmasq.d/virt-test" +FILES_${PN}-dbg += "/opt/${PN}/virttest/.debug/* /opt/${PN}/shared/scripts/.debug/*" + +PACKAGES =+ "${PN}-guest-scripts-bin" + +DESCRIPTION_${PN}-guest-scripts-bin = "Guest test binaries for virt-test" +FILES_${PN}-guest-scripts-bin = "/opt/${PN}/shared/scripts/pipetest" + +python do_devshell_prepend() { + os.environ['BUILD_SYS']="${BUILD_SYS}" + os.environ['HOST_SYS']="${HOST_SYS}" + os.environ['STAGING_INCDIR']="${STAGING_INCDIR}" + os.environ['STAGING_LIBDIR']="${STAGING_LIBDIR}" +} + +do_compile() { + # _passfd.so + export BUILD_SYS="${BUILD_SYS}" + export HOST_SYS="${HOST_SYS}" + export STAGING_INCDIR="${STAGING_INCDIR}" + export STAGING_LIBDIR="${STAGING_LIBDIR}" + cd ${S}/virttest + python passfd_setup.py ${DISTUTILS_BUILD_ARGS} + + # guest-scripts-bin + cd ${S}/shared/scripts/ + ${CC} ${CFLAGS} ${LDFLAGS} pipetest.c -o pipetest +} + +do_install() { + install -d ${D}/opt/${PN} + cp -r --preserve=mode,links ${B}/* ${D}/opt/${PN} + rm -f ${D}/opt/${PN}/shared/data + mkdir -p ${D}/opt/${PN}/shared/data + mkdir -p ${D}/etc/dnsmasq.d/ + cp --preserve=mode,links ${WORKDIR}/dnsmasq-virt-test ${D}/etc/dnsmasq.d/virt-test +} -- cgit v1.2.3-54-g00ecf