From 74d51c8c3e18a8b6738aff0c6f7ff706fd70eaa6 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 26 Jun 2014 13:57:02 +0200 Subject: initial commit for Enea Linux 4.0 Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau --- recipes-append/busybox/busybox_1.22.1.bbappend | 3 + .../configure-Add-with-python-install-dir.patch | 60 +++++ recipes-append/libxml/libxml2_2.9.1.bbappend | 26 +++ recipes-append/netperf/netperf_2.6.0.bbappend | 4 + recipes-append/qemu/qemu_1.7.0.bbappend | 6 + .../systest-runner/files/tests/virt-test | 247 +++++++++++++++++++++ .../systest-runner/systest-runner.bbappend | 12 + 7 files changed, 358 insertions(+) create mode 100644 recipes-append/busybox/busybox_1.22.1.bbappend create mode 100644 recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch create mode 100644 recipes-append/libxml/libxml2_2.9.1.bbappend create mode 100644 recipes-append/netperf/netperf_2.6.0.bbappend create mode 100644 recipes-append/qemu/qemu_1.7.0.bbappend create mode 100755 recipes-append/systest-runner/files/tests/virt-test create mode 100644 recipes-append/systest-runner/systest-runner.bbappend (limited to 'recipes-append') diff --git a/recipes-append/busybox/busybox_1.22.1.bbappend b/recipes-append/busybox/busybox_1.22.1.bbappend new file mode 100644 index 0000000..edabf7e --- /dev/null +++ b/recipes-append/busybox/busybox_1.22.1.bbappend @@ -0,0 +1,3 @@ +do_prepare_config_append () { + sed -i -e 's/# CONFIG_CHPASSWD is not set/CONFIG_CHPASSWD=y/' .config +} diff --git a/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch b/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch new file mode 100644 index 0000000..174be5f --- /dev/null +++ b/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch @@ -0,0 +1,60 @@ +From df85edda5f6632f12f5802173a5012a35b19ccdd Mon Sep 17 00:00:00 2001 +From: Jonas Eriksson +Date: Thu, 6 Mar 2014 08:22:23 +0100 +Subject: [PATCH] configure: Add --with-python-install-dir + +Cross-compiling the python bindings is a bit difficult today, as the +configure script will figure out the site packages dir +(PYTHON_SITE_PACKAGES) by either: + +- Generating the path to the site-package target directories using + libdir, and see if it exists. As it is not possible to point to the + full path of the sysroot, since that will yield the wrong install + path, and that the directory does not neccessarily exist on the host, + this approach will not work. + +- Fetch the site packages dir from the python interpreter as pointed to + by --with-python. Since this python interpreter will point to the + sysroot, the install dir generated will be inside the sysroot and thus + not work. + +This patch approaches the problem by adding the possibility of +explicitly stating the install dir of the python packages, leaving it up +to the cross-compilation environment to specify it. The patch does not +affect the default case (non-cross compilation). + +Signed-off-by: Jonas Eriksson + +Upstream-Status: Submitted [xml@gnome.org] +--- + configure.in | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/configure.in b/configure.in +index ecaa403..21ad1e7 100644 +--- a/configure.in ++++ b/configure.in +@@ -148,6 +148,9 @@ AC_ARG_WITH(push, + [ --with-push add the PUSH parser interfaces (on)]) + AC_ARG_WITH(python, + [ --with-python[[=DIR]] build Python bindings if found]) ++AC_ARG_WITH(python_install_dir, ++[ --with-python-install-dir=DIR ++ install Python bindings in DIR]) + AC_ARG_WITH(reader, + [ --with-reader add the xmlReader parsing interface (on)]) + AC_ARG_WITH(readline, +@@ -866,6 +869,10 @@ if test "$with_python" != "no" ; then + fi + fi + fi ++ if test "$with_python_install_dir" != "" ++ then ++ PYTHON_SITE_PACKAGES="$with_python_install_dir" ++ fi + if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = "" + then + if test -d $libdir/python$PYTHON_VERSION/site-packages +-- +1.9.0 + diff --git a/recipes-append/libxml/libxml2_2.9.1.bbappend b/recipes-append/libxml/libxml2_2.9.1.bbappend new file mode 100644 index 0000000..98745d8 --- /dev/null +++ b/recipes-append/libxml/libxml2_2.9.1.bbappend @@ -0,0 +1,26 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://configure-Add-with-python-install-dir.patch" + +PACKAGES += "${PN}-python ${PN}-python-staticdev ${PN}-python-dbg" + +DEPENDS += "python-dev" + +FILES_${PN}-python = " \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.so \ + ${PYTHON_SITEPACKAGES_DIR}/drv_libxml2.py \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2.py \ + " +FILES_${PN}-python-staticdev += " \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.a \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.la \ + " +FILES_${PN}-python-dbg += " \ + ${PYTHON_SITEPACKAGES_DIR}/.debug/libxml2mod.so \ + " + +# +: --with-catalog, --with-python-install-dir +EXTRA_OECONF = "--with-python=${STAGING_BINDIR}/python --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} --without-debug --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions" + +# +: --with-python-install-dir +EXTRA_OECONF_linuxstdbase = "--with-python=${STAGING_BINDIR}/python --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} --with-debug --with-legacy --with-catalog --with-docbook --with-c14n --without-lzma" diff --git a/recipes-append/netperf/netperf_2.6.0.bbappend b/recipes-append/netperf/netperf_2.6.0.bbappend new file mode 100644 index 0000000..0115d4f --- /dev/null +++ b/recipes-append/netperf/netperf_2.6.0.bbappend @@ -0,0 +1,4 @@ +PACKAGECONFIG ??= "sctp" +PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools," + +RRECOMMENDS_${PN} += "${@base_contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}" diff --git a/recipes-append/qemu/qemu_1.7.0.bbappend b/recipes-append/qemu/qemu_1.7.0.bbappend new file mode 100644 index 0000000..d633a19 --- /dev/null +++ b/recipes-append/qemu/qemu_1.7.0.bbappend @@ -0,0 +1,6 @@ +# Fixes the DEPENDS variable to not require x11 +DEPENDS = "glib-2.0 zlib alsa-lib pixman dtc libsdl \ + ${@base_contains('DISTRO_FEATURES', 'x11', 'virtual/libx11', '', d)}" + +PACKAGECONFIG += "virtfs" +PACKAGECONFIG_class-nativesdk ??= "" diff --git a/recipes-append/systest-runner/files/tests/virt-test b/recipes-append/systest-runner/files/tests/virt-test new file mode 100755 index 0000000..500b6ef --- /dev/null +++ b/recipes-append/systest-runner/files/tests/virt-test @@ -0,0 +1,247 @@ +#!/bin/sh + +filter_output() { + test_name="$1" + debug_dir="" + while read row; do + echo "# $row" + # Output is colorized; remove escape characters + row_cleaned=`echo "$row" | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"` + # Transform "SETUP: PASS|FAIL" to "SETUP ($test_name): PASS|FAIL" + row_cleaned=`echo "$row_cleaned" | sed "s/^SETUP:/SETUP ($test_name):/"` + if echo "$row_cleaned" | grep -q '^[^:]*: \(PASS\|FAIL\|ERROR\)\( \[result=[^]]*\]\)\? ([0-9\.]\{1,\} s)$'; then + # The row is a test result + test_case=`echo "$row_cleaned" | grep -o '^\(SETUP\|([0-9]\{1,\}/[0-9]\{1,\})\)[^:]*' | sed 's|^([0-9]\{1,\}/[0-9]\{1,\}) ||'` + status=`echo "$row_cleaned" | grep -o ': \(PASS\|FAIL\|ERROR\)' | sed -e 's/^: //' -e 's/ERROR/FAIL/'` + echo -n "$status: $test_case" + # Are there any textual results to be appended? + keyval_file="$debug_dir/$test_case/keyval" + if [ -n "$debug_dir" -a -e "$keyval_file" ]; then + result=`grep '^result=' $keyval_file | sed 's/^result=//'` + if [ -n "$result" ]; then + echo -n " [result=$result]" + fi + fi + echo "" + elif echo "$row_cleaned" | grep -q '^DEBUG LOG: '; then + # The row specifies the path to the debug log: Extract the debug directory and save it + debug_dir=`echo "$row_cleaned" | sed -e 's,^DEBUG LOG: ,,' -e 's,/debug\.log$,,'` + fi + done +} + +create_empty_image() { + IMAGE_NAME="$1" + COMPRESSION_TYPE="$2" + + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}.${COMPRESSION_TYPE}" + if [ -z "$COMPRESSION_TYPE" ]; then + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}" + fi + SHA1_NAME="${COMPRESSED_IMAGE_NAME}.sha1" + + pushd /opt/virt-test/shared/data/images/ &> /dev/null + + rm -f "$IMAGE_NAME" "$SHA1_NAME" "$COMPRESSED_IMAGE_NAME" + rm -f "${IMAGE_NAME}.backup" + + echo "# Creating empty image ${IMAGE_NAME}" + qemu-img create -f qcow2 ${IMAGE_NAME} 10M + case "$COMPRESSION_TYPE" in + bz2) + bzip2 -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" + ;; + gz) + gzip -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" + ;; + xz) + xz -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" + ;; + *) + echo "ERROR: Invalid compression type: $COMPRESSION_TYPE" + popd + exit 1 + ;; + esac + sha1sum "$COMPRESSED_IMAGE_NAME" > "$SHA1_NAME" + + cp "$IMAGE_NAME" "${IMAGE_NAME}.backup" + + echo "# Empty image $IMAGE_NAME created" + echo + + popd &> /dev/null +} + +get_image() { + URL_BASE="$1" + IMAGE_NAME="$2" + COMPRESSION_TYPE="$3" + + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}.${COMPRESSION_TYPE}" + if [ -z "$COMPRESSION_TYPE" ]; then + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}" + fi + SHA1_NAME="${COMPRESSED_IMAGE_NAME}.sha1" + COMPRESSED_IMAGE_URL="${URL_BASE}/${COMPRESSED_IMAGE_NAME}" + SHA1_URL="${URL_BASE}/${SHA1_NAME}" + + pushd /opt/virt-test/shared/data/images/ &> /dev/null + + rm -f "$IMAGE_NAME" "$SHA1_NAME" "$COMPRESSED_IMAGE_NAME" + rm -f "${IMAGE_NAME}.backup" + + echo "# Downloading $COMPRESSED_IMAGE_URL" + wget $COMPRESSED_IMAGE_URL + wget $SHA1_URL + + if ! sha1sum -c "$SHA1_NAME" > /dev/null; then + echo "ERROR: Invalid sha1 sum!" + exit 1 + fi + + echo "# Uncompressing $COMPRESSED_IMAGE_NAME -> $IMAGE_NAME" + case "$COMPRESSION_TYPE" in + bz2) + bunzip2 -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" + ;; + gz) + gunzip -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" + ;; + xz) + unxz -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" + ;; + "") + ;; + *) + echo "ERROR: Invalid compression type: $COMPRESSION_TYPE" + popd + exit 1 + ;; + esac + + cp "$IMAGE_NAME" "${IMAGE_NAME}.backup" + + echo "# Download of $IMAGE_NAME completed" + echo + + popd &> /dev/null +} + +# Verbose? +VERBOSE= +if [ "$1" = '-v' ]; then + VERBOSE=1 + set -x +fi + +# Servers +NTP_SERVER=ntp.enea.se + +# Architecture +ARCH=`uname -m` + +# Needed by virt-test +export AUTOTEST_PATH="/opt/autotest/" + +# Init LVM +DEST_DIR=/opt/virt-test/shared/data +if ! [ -e /dev/rootvg ]; then + vgchange -ay + udevadm settle # Wait for device nodes +fi +if [ -e /dev/rootvg ]; then + if ! [ -e /dev/rootvg/virttestdatalv ]; then + if ! lvcreate -L30G -n virttestdatalv /dev/rootvg; then + echo "ERROR: Unable to create virttestdatalv!" >&2 + exit 1 + fi + udevadm settle + if ! mkfs.ext4 /dev/rootvg/virttestdatalv; then + echo "ERROR: Unable to format virttestdatalv!" >&2 + exit 1 + fi + fi + + # Mount the virttestdatalv + mkdir -p $DEST_DIR + if ! mountpoint -q $DEST_DIR; then + if ! mount /dev/rootvg/virttestdatalv $DEST_DIR; then + echo "ERROR: Unable to mount virttestdatalv!" >&2 + exit 1 + fi + fi +else + echo "WARNING: No rootvg volume group! Continuing anyway" >&2 +fi +( + cd $DEST_DIR + mkdir -p gpg images isos steps_data +) + +# Sync the clock before starting tests, as some tests will do this, and thereby +# cause tests that run for a negative amount of time unless the time is synced +# from the very beginning +ntpdate $NTP_SERVER + +# Download/create images, kernel, initrd +JEOS_VERSION="19-64" +ENEA_VERSION="4.0" +# virt-test will try to unpack the images for all architectures, even though +# they are not used, so always create the (empty) images. +create_empty_image "enea-${ENEA_VERSION}-x86_64.qcow2" "gz" +create_empty_image "enea-${ENEA_VERSION}-ppc.qcow2" "gz" +create_empty_image "enea-${ENEA_VERSION}-ppc64.qcow2" "gz" +if [ "$ARCH" = "x86_64" ]; then + #get_image "http://172.21.3.124/~jori/jeos/" "jeos-${JEOS_VERSION}.qcow2" "bz2" + get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.qcow2" "gz" +elif [ "$ARCH" = "ppc" -o "$ARCH" = "ppc64" ]; then + get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.uImage" "" + get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.cpio.gz" "" +else + echo "ERROR: Architecture '$ARCH' not supported" + exit 1 +fi + +# Create virbr0 +if ! [ -e /sys/class/net/virbr0 ]; then + ip link add virbr0 type bridge + ip addr add dev virbr0 10.99.99.1/24 + ip link set virbr0 up + /etc/init.d/dnsmasq stop + sleep 5 + /etc/init.d/dnsmasq start +fi + +# Run tests +cd /opt/virt-test/ +QEMU_BIN=`which qemu-system-$ARCH` +OPTS="--qemu-bin=$QEMU_BIN --qemu_sandbox=off --no-downloads" +if ! [ "$VERBOSE" = "" ]; then + OPTS="$OPTS -v" +fi + +declare -a TEST_SUITE TEST_SUITE_EXTRAOPTS TEST_CASES + +TEST_SUITE[0]="qemu" +TEST_SUITE_EXTRAOPTS[0]="" +TEST_CASES[0]="check_clock_offset.with_syscall,migrate.default.fd" + +TEST_SUITE[1]="libvirt" +TEST_SUITE_EXTRAOPTS[1]="" +if [ "$ARCH" = "x86_64" ]; then + TEST_SUITE_EXTRAOPTS[1]="--machine-type=q35" +fi +TEST_CASES[1]="virsh.volume" + +for (( i=0; i<${#TEST_SUITE[@]}; i++ )); do + # Update machine.cfg + cp /opt/virt-test/shared/cfg/machines.cfg \ + /opt/virt-test/backends/${TEST_SUITE[$i]}/cfg/ + + # Run tests + echo "# Running ${TEST_SUITE[$i]} tests ${TEST_CASES[$i]}" + ./run $OPTS ${TEST_SUITE_EXTRAOPTS[$i]} -g Enea -t "${TEST_SUITE[$i]}" \ + --tests="${TEST_CASES[$i]}" --arch=$ARCH 2>&1 \ + | filter_output "${TEST_SUITE[$i]}" +done diff --git a/recipes-append/systest-runner/systest-runner.bbappend b/recipes-append/systest-runner/systest-runner.bbappend new file mode 100644 index 0000000..9c6dc67 --- /dev/null +++ b/recipes-append/systest-runner/systest-runner.bbappend @@ -0,0 +1,12 @@ +FILESEXTRAPATHS_append := ":${THISDIR}/files" + +VIRT_TEST_SRC_URI = "file://tests/virt-test" +SRC_URI_append_corei7-64-intel-common = "${VIRT_TEST_SRC_URI}" +SRC_URI_append_e500mc = "${VIRT_TEST_SRC_URI}" +SRC_URI_append_b4860qds-64b = "${VIRT_TEST_SRC_URI}" + +VIRT_TEST_RDEPENDS = "lvm2 e2fsprogs virt-test virt-test-libvirt virt-test-qemu \ + ntpdate bzip2 coreutils" +RDEPENDS_${PN}_append_corei7-64-intel-common = "${VIRT_TEST_RDEPENDS}" +RDEPENDS_${PN}_append_e500mc = "${VIRT_TEST_RDEPENDS}" +RDEPENDS_${PN}_append_b4860qds-64b = "${VIRT_TEST_RDEPENDS}" -- cgit v1.2.3-54-g00ecf