File virt-test.spec of Package virt-test

#%define git 1a610ed19a
%define _localstatedir /var
%define _sysconfdir /etc
Name: 		virt-test
Version: 	0.1
Release: 	1
Summary: 	Framework to do Virtualization test
Group: 		Applications/System
License: 	GPL-3.0+
Url:        https://github.com/autotest/virt-test
#BuildArch: 	noarch
Source0: 	%{name}-%{version}.tar.bz2
Source1:    virttest-bashrc
source2:    virttest-sudoers
Patch0:     virttest_data_dir_fix.patch
Patch1:     disable_qemu-io_check.patch
Patch2:     assign_xen100_as_url_auto_ip.patch
Patch5:     add-necessary-config-for-os123-unattended_inst.patch
Patch6:     add-necessary-code-for-unattended_inst.patch
Patch7:     disable_ssh_strict_host_key_checking.patch
Patch10:    _add-support-for-2nd-phase-of-installation.patch
Patch11:    fix-oldname-autodir-cpuflags-control.patch
Patch12:    assign-correct-value-to-subtest_dirs-from-provider.patch
Patch13:    disable_io-github-autotest-qemu_libvirt.patch
Patch14:    virttest_fix_path_sudo.patch
Patch16:    update-os12-autoyast.patch
BuildRoot: 	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

Requires: python >= 2.4
Requires: autotest-framework
Requires: p7zip
Requires: tcpdump
Requires: nmap
Requires: netcat-openbsd
Requires: qemu
Requires: python-imaging
Requires: python-devel
Requires: cdrkit-cdrtools-compat
Requires: guestfs-data
Requires: guestfs-tools
Requires: openvswitch
Requires: python-openvswitch
Requires: openvswitch-controller
Requires: libvirt
Requires: libvirt-client
Requires: python-virtinst
Requires: bridge-utils
Requires: sudo
Requires: tp-qemu
Requires: tp-libvirt
%if 0%{?suse_version} >=1230
Requires: libvirt-daemon
Requires: qemu-tools
Requires: virt-v2v
Requires(pre): libvirt-daemon
%endif
BuildRequires: python >= 2.4
Requires(pre): pwdutils


%description
virt-test is a Linux virtualization test suite, intended to be used
in conjunction with the autotest framework [1], although it can be
also used separately, on a virt developer's machine, to run tests
quicker and smaller in scope, as an auxiliary tool of the development
process.

This test suite aims to have test tools for a wide range of testing scenarios:
* Guest OS install, for both Windows (WinXP - Win7) and Linux 
 (RHEL, Fedora, OpenSUSE) and any generic one, through a 'step engine' mechanism.
* Serial output for Linux guests
* Migration, networking, timedrift and other types of tests
* Monitor control for both human and QMP protocols
* Build and use qemu using various methods (source tarball, git repo, rpm)
* Performance testing
* Call other kvm test projects, such as kvm-unit-tests

We support x86_64 hosts with hardware virtualization support (AMD and Intel)
and Intel 32 and 64 bit guest operating systems, and work is underway to
support PPC hosts.


%prep
%setup -q -n %{name}-%{version}
%patch0 -p0
%if 0%{?suse_version} <=1220
%patch1 -p0
%endif
%patch2 -p0
%patch5 -p0
%patch7 -p0
%patch10 -p0
%patch6 -p0
%patch11 -p0
%patch12 -p0
%patch13 -p0
%patch14 -p0
%patch16 -p0

%build
echo "nothing to build..."


%install
rm -rf %{buildroot}
# creating needed directory
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{python_sitelib}/virttest
install -d %{buildroot}%{_datadir}/virttest
install -d %{buildroot}%{_datadir}/virttest
install -d %{buildroot}%{_localstatedir}/lib/virttest/shared/downloads
install -d %{buildroot}%{_localstatedir}/lib/virttest/shared/cfg
install -d %{buildroot}%{_localstatedir}/lib/virttest/test-providers.d/downloads
install -d %{buildroot}%{_localstatedir}/lib/virttest/tmp
install -d %{buildroot}%{_sysconfdir}/profile.d/
install -d %{buildroot}%{_sysconfdir}/sudoers.d

# clean up c and cpp files
rm -f virttest/staging/backports/simplejson/*.c
rm -f shared/deps/finish/*.cpp
rm -f shared/scripts/*.c
rm -f shared/deps/rss/*.cpp
rm -f virttest/*.c

chmod +x samples/*.sh
cp -af samples tools virttest %{buildroot}%{python_sitelib}/
cp -af shared/autoit %{buildroot}%{python_sitelib}/shared/
cp -af shared/blkdebug %{buildroot}%{python_sitelib}/shared/
cp -af shared/control %{buildroot}%{python_sitelib}/shared/
cp -af shared/deps %{buildroot}%{python_sitelib}/shared/
cp -af shared/scripts %{buildroot}%{python_sitelib}/shared/
cp -af shared/steps %{buildroot}%{python_sitelib}/shared/
cp -af shared/unattended %{buildroot}%{python_sitelib}/shared/
cp -af backends %{buildroot}%{_localstatedir}/lib/virttest/
cp -af shared/cfg %{buildroot}%{_localstatedir}/lib/virttest/shared/
cp -af shared/downloads %{buildroot}%{_localstatedir}/lib/virttest/shared/
cp -af test-providers.d %{buildroot}%{_localstatedir}/lib/virttest
cp -af dropin %{buildroot}%{_localstatedir}/lib/virttest
cp -af run %{buildroot}%{_bindir}/virt-test
cp -af %{SOURCE1} %{buildroot}%{_localstatedir}/lib/virttest/.bashrc
cp -af %{SOURCE2} %{buildroot}%{_sysconfdir}/sudoers.d/10_virttest

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc CODING_STYLE LICENSE MAINTAINERS README.rst
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/libguestfs
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/libvirt
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/lvsb
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/openvswitch
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/qemu
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/v2v
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/shared
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/shared/cfg
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/shared/downloads
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/dropin
%dir %attr(0755, virttest, root) %{_localstatedir}/lib/virttest/test-providers.d
%dir %attr(0755, root, root) %{_sysconfdir}/sudoers.d/
%dir %{python_sitelib}/virttest
%dir %{python_sitelib}/samples
%dir %{python_sitelib}/shared
%dir %{python_sitelib}/tools
%{python_sitelib}/virttest/*
%{python_sitelib}/samples/*
%{python_sitelib}/tools/*
%{python_sitelib}/shared/*
%{_localstatedir}/lib/virttest/.bashrc
%attr(0600, root, root) %{_sysconfdir}/sudoers.d/10_virttest
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/libguestfs/*
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/libvirt/*
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/lvsb/*
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/openvswitch/*
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/qemu/*
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/backends/v2v/*
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/shared/cfg/*
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/shared/downloads/*
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/test-providers.d/*
%attr(0755, virttest, root) %{_localstatedir}/lib/virttest/dropin/*
%{_bindir}/virt-test

%changelog
* Wed Feb 19 2014 Antoine Ginies <aginies@suse.com> 0.1
- first release

openSUSE Build Service is sponsored by