Source: polarssl
Severity: wishlist
Hi,
Please add some simple autopkg test so that when working on
e.g. security updates one can easily verify that one didn't break things
totally.
Attached patch does two things:
* Exercise some of the shipped helpers
* Link one example to the _installed_ library so we know the dev
package is sane
Would be great if this could be applied (maybe to mbed TLS as well).
Cheers
-- Guido
>From 812c4051dab47c97a46ec19759b5021bf75485e4 Mon Sep 17 00:00:00 2001
Message-Id: <812c4051dab47c97a46ec19759b5021bf75485e4.1453564830.git....@sigxcpu.org>
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <[email protected]>
Date: Sat, 23 Jan 2016 16:14:17 +0100
Subject: [PATCH] Add simple smoe test
---
debian/tests/build-test | 10 ++++++++++
debian/tests/control | 5 +++++
debian/tests/smoke | 17 +++++++++++++++++
3 files changed, 32 insertions(+)
create mode 100755 debian/tests/build-test
create mode 100644 debian/tests/control
create mode 100755 debian/tests/smoke
diff --git a/debian/tests/build-test b/debian/tests/build-test
new file mode 100755
index 0000000..42b7127
--- /dev/null
+++ b/debian/tests/build-test
@@ -0,0 +1,10 @@
+#!/usr/bin/make -f
+
+CFLAGS = -O2 -D_FILE_OFFSET_BITS=64 -Wall
+LDFLAGS += -lpolarssl
+
+a.out: programs/hash/hello.c
+ $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS)
+ @echo "Build test of $< succeeded"
+ ./a.out
+ @rm -f a.out
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..9b777fd
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+Tests: smoke
+Depends: libpolarssl-runtime
+
+Tests: build-test
+Depends: libpolarssl-dev
diff --git a/debian/tests/smoke b/debian/tests/smoke
new file mode 100755
index 0000000..03df087
--- /dev/null
+++ b/debian/tests/smoke
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+# Excercise some of the demos
+polarssl_hello
+polarssl_mpi_demo
+
+# Make sure output is identical to coreutil versions
+[ "$(polarssl_sha1sum /etc/passwd)" = "$(sha1sum /etc/passwd)" ]
+[ "$(polarssl_md5sum /etc/passwd)" = "$(md5sum /etc/passwd)" ]
+
+# Run the selftest
+polarssl_selftest
+
+echo 'Smoke test of polarssl succesful'
+exit 0
--
2.7.0.rc3