summaryrefslogtreecommitdiffstats
path: root/recipes-test/virt-test/virt-test_git.bb
blob: ea588f06ee57c845725850e937fdd26dbabe0beb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
SUMMARY = "Linux Virtualization Tests"
DESCRIPTION = "virt-test is a Linux virtualization test suite, intended to be used in conjunction with the autotest framework"
HOMEPAGE = "https://github.com/autotest/virt-test"
SECTION = "console/tests"
LICENSE = "GPLv2 & MIT & PSF"
LIC_FILES_CHKSUM = "file://LICENSE;md5=ca2697f94d6c6ecb0c4ed70d4bca81e2 \
		 file://README.rst;md5=3f0b5623cfac6b30670bd27eb823e12e"

RDEPENDS_${PN} = "autotest tcpdump iputils netcat-openbsd virt-manager procps \
     less python-logging python-shell python-resource python-subprocess \
     python-netclient python-email python-compression python-unixadmin \
     python-ctypes python-html python-terminal python-distutils \
     python-math python-numbers python-xml python-db"

DEPENDS += "python"

# We cannot use the default do_compile etc. from distutils, so just use
# distutils-base to get all the correct paths.
inherit distutils-base

# SRCREV reflects the packaged PV
PV = "2014.04.14"
SRCREV = "b6ee5f288e16d5a72e562a567295d40d3a890fcb"

SRC_URI = "git://github.com/autotest/virt-test \
	file://remove_7za_dependency.patch \
	file://remove_gcc_dependency.patch \
	file://clear_mandatory_header_list.patch \
	file://do_not_upgrade_test_providers.patch \
	file://allow_bootstrap_3rd_party_image.patch \
	file://add_enea_linux_support.patch \
	file://virt-test-qemu_vm-add-monotonic-start-time.patch \
	file://dnsmasq-virt-test \
	file://virt-test-search-qemu-system-arch.patch \
	file://virt-test-ppc.patch \
"

S = "${WORKDIR}/git"
B = "${S}"

FILES_${PN} += "/opt /etc/dnsmasq.d/virt-test"
FILES_${PN}-dbg += "/opt/${PN}/virttest/.debug/* /opt/${PN}/shared/scripts/.debug/*"

PACKAGES =+ "${PN}-guest-scripts-bin"

DESCRIPTION_${PN}-guest-scripts-bin = "Guest test binaries for virt-test"
FILES_${PN}-guest-scripts-bin = "/opt/${PN}/shared/scripts/pipetest"

python do_devshell_prepend() {
    os.environ['BUILD_SYS']="${BUILD_SYS}"
    os.environ['HOST_SYS']="${HOST_SYS}"
    os.environ['STAGING_INCDIR']="${STAGING_INCDIR}"
    os.environ['STAGING_LIBDIR']="${STAGING_LIBDIR}"
}

do_compile() {
  # _passfd.so
  export BUILD_SYS="${BUILD_SYS}"
  export HOST_SYS="${HOST_SYS}"
  export STAGING_INCDIR="${STAGING_INCDIR}"
  export STAGING_LIBDIR="${STAGING_LIBDIR}"
  cd ${S}/virttest
  python passfd_setup.py ${DISTUTILS_BUILD_ARGS}

  # guest-scripts-bin
  cd ${S}/shared/scripts/
  ${CC} ${CFLAGS} ${LDFLAGS} pipetest.c -o pipetest
}

do_install() {
	install -d ${D}/opt/${PN}
	cp -r --preserve=mode,links ${B}/* ${D}/opt/${PN}
	rm -f ${D}/opt/${PN}/shared/data
	mkdir -p ${D}/opt/${PN}/shared/data
	mkdir -p ${D}/etc/dnsmasq.d/
	cp --preserve=mode,links ${WORKDIR}/dnsmasq-virt-test ${D}/etc/dnsmasq.d/virt-test
}