[packages/tini] run smoke tests
glen
glen at pld-linux.org
Mon Mar 21 08:10:30 CET 2016
commit e079dbb933e58cd456cb05110535dfe9c4750b1d
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Mon Mar 21 09:10:06 2016 +0200
run smoke tests
taken from tini/ci/run_build.sh
tini.spec | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
---
diff --git a/tini.spec b/tini.spec
index 3b56ce0..b4dba4e 100644
--- a/tini.spec
+++ b/tini.spec
@@ -1,6 +1,7 @@
#
# Conditional build:
%bcond_without static # don't build static version
+%bcond_without tests # Smoke tests (actual tests need Docker to run)
Summary: A tiny but valid init process for containers
Name: tini
@@ -46,6 +47,33 @@ cd build
%cmake ..
%{__make}
+%if %{with tests}
+# Smoke tests
+for tini in ./tini %{?with_static:./tini-static}; do
+ echo "Smoke test for $tini"
+ $tini -h
+
+ echo "Testing $tini with: true"
+ $tini -vvv true
+
+ echo "Testing $tini with: false"
+ if $tini -vvv false; then
+ exit 1
+ fi
+
+ # Test stdin / stdout are handed over to child
+ echo "Testing pipe"
+ echo "exit 0" | $tini -vvv sh
+ if [ ! "$?" -eq "0" ]; then
+ echo "Pipe test failed"
+ exit 1
+ fi
+
+# echo "Checking hardening on $tini"
+# hardening-check --nopie --nostackprotector --nobindnow $tini
+done
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
%{__make} -C build install \
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/tini.git/commitdiff/e079dbb933e58cd456cb05110535dfe9c4750b1d
More information about the pld-cvs-commit
mailing list