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