From 0176351eb14fa112e99327b236f2ce48664e0d7c Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 15 May 2016 05:13:45 +0200 Subject: [PATCH] Add autopkg tests --- debian/tests/control | 3 +++ debian/tests/run-testsuite-if-acls-enabled | 21 +++++++++++++++++++++ debian/tests/simple | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 debian/tests/control create mode 100755 debian/tests/run-testsuite-if-acls-enabled create mode 100755 debian/tests/simple diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..ddf064e --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,3 @@ +Tests: simple run-testsuite-if-acls-enabled +Depends: @, acl +Restrictions: allow-stderr diff --git a/debian/tests/run-testsuite-if-acls-enabled b/debian/tests/run-testsuite-if-acls-enabled new file mode 100755 index 0000000..d5a00d5 --- /dev/null +++ b/debian/tests/run-testsuite-if-acls-enabled @@ -0,0 +1,21 @@ +#!/bin/sh + +TESTFILE="$ADTTMP/foo" + +touch "$TESTFILE" + +if setfacl -m u:root:r "$TESTFILE"; then + echo "Temporary directory '$ADTTMP' has ACLs enabled, running tests" + export TEST_DIR="$ADTTMP" + echo "* testing Python 2" + python2 test/test_acls.py + echo "* testing Python 2 debug package" + python2-dbg test/test_acls.py + echo "* testing Python 3" + python3 test/test_acls.py + echo "* testing Python 3 debug package" + python3-dbg test/test_acls.py +else + echo "Temporary directory '$ADTTMP' doesn't have extended attributes enabled" + echo "Skipping the tests :(" +fi diff --git a/debian/tests/simple b/debian/tests/simple new file mode 100755 index 0000000..4bdfcfc --- /dev/null +++ b/debian/tests/simple @@ -0,0 +1,6 @@ +#!/bin/sh + +python2 -c 'import posix1e; print posix1e' +python2-dbg -c 'import posix1e; print posix1e' +python3 -c 'import posix1e; print(posix1e)' +python3-dbg -c 'import posix1e; print(posix1e)' -- 2.39.2