[packages/criu] add tests bcond (requires root)

glen glen at pld-linux.org
Sun Aug 21 10:46:08 CEST 2016


commit a93492469e0ffcdac217999222517bb6c6d9025f
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Aug 21 11:45:00 2016 +0300

    add tests bcond (requires root)
    
    at least one test did:
    
    mount: only root can use "--options" option
    subprocess.CalledProcessError: Command '['flock', 'zdtm_mount_cgroups.lock', './zdtm_mount_cgroups']' returned non-zero exit st atus 1

 criu.spec   | 10 ++++++++++
 tests.patch | 13 +++++++++++++
 2 files changed, 23 insertions(+)
---
diff --git a/criu.spec b/criu.spec
index 07cae54..987cc78 100644
--- a/criu.spec
+++ b/criu.spec
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_with	tests		# build and run tests (requires root)
+
 Summary:	Checkpoint/restore functionality for Linux in userspace
 Summary(pl.UTF-8):	Funkcja checkpoint/restore w przestrzeni użytkownika dla Linuksa
 Name:		criu
@@ -8,6 +12,7 @@ Group:		Applications/System
 Source0:	http://download.openvz.org/criu/%{name}-%{version}.tar.bz2
 # Source0-md5:	5d5115454d110adb744e885d82d2c1f6
 Patch0:		%{name}-python.patch
+Patch1:		tests.patch
 URL:		http://criu.org/
 BuildRequires:	asciidoc
 BuildRequires:	libcap-devel
@@ -95,6 +100,7 @@ Pythonowy interfejs do CRIU. Ten pakiet zawiera także narzędzie crit.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %{__sed} -i -e 's#-O2 -g#$(OPT)#g' Makefile
 
@@ -113,6 +119,10 @@ Pythonowy interfejs do CRIU. Ten pakiet zawiera także narzędzie crit.
 	V=1
 %{__make}
 
+%if %{with tests}
+%{__make} test
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 %{__make} install \
diff --git a/tests.patch b/tests.patch
new file mode 100644
index 0000000..4643b02
--- /dev/null
+++ b/tests.patch
@@ -0,0 +1,13 @@
+--- criu-2.5/test/zdtm/static/Makefile~	2016-08-21 11:41:39.000000000 +0300
++++ criu-2.5/test/zdtm/static/Makefile	2016-08-21 11:41:42.142986535 +0300
+@@ -402,6 +402,10 @@
+ stopped02:	override CFLAGS += -DZDTM_STOPPED_TKILL
+ stopped12:	override CFLAGS += -DZDTM_STOPPED_KILL -DZDTM_STOPPED_TKILL
+ 
++# grantpt, etc troubles
++tty%:	override CFLAGS += -Wno-error=implicit-function-declaration -Wno-error=int-conversion
++pty%:	override CFLAGS += -Wno-error=implicit-function-declaration -Wno-error=int-conversion
++
+ $(LIB):	force
+ 	$(Q) $(MAKE) -C $(LIBDIR)
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/criu.git/commitdiff/a93492469e0ffcdac217999222517bb6c6d9025f



More information about the pld-cvs-commit mailing list