From 7eee7ce2feee7d47d1d4a4cc33a82450b01d88c3 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 29 Jan 2016 11:23:42 +0100 Subject: [PATCH] Add an ostree-tests package, and use it for autopkgtest --- debian/changelog | 1 + debian/control | 20 ++++++++++++++++++++ debian/ostree-tests.install | 2 ++ debian/rules | 9 +++++++++ debian/tests/build | 22 ++++++++++++++++++++++ debian/tests/control | 5 +++++ debian/tests/gnome-desktop-testing | 6 ++++++ 7 files changed, 65 insertions(+) create mode 100644 debian/ostree-tests.install create mode 100755 debian/tests/build create mode 100644 debian/tests/control create mode 100755 debian/tests/gnome-desktop-testing diff --git a/debian/changelog b/debian/changelog index 63e6aaf4..3f4f10ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ ostree (2016.1-1) UNRELEASED; urgency=medium * Use dh_install --fail-missing to catch mistakes * Add a symbols file * Add missing dependency on libglib2.0-dev + * Add an ostree-tests package, and use it for autopkgtest -- Simon McVittie Wed, 27 Jan 2016 13:04:34 +0100 diff --git a/debian/control b/debian/control index eacbbeb4..f2fba538 100644 --- a/debian/control +++ b/debian/control @@ -123,3 +123,23 @@ Description: GRUB 2 configuration for ostree disadvantages) of both. . This package contains configuration snippets for using ostree with GRUB 2. + +Package: ostree-tests +Architecture: any +Depends: + ${misc:Depends}, + ${shlibs:Depends}, + attr, + ca-certificates, + gir1.2-gsystem-1.0, + gir1.2-ostree-1.0, + gjs, + ostree, + python, +Description: content-addressed filesystem for operating system binaries - tests + OSTree is a tool for managing bootable, immutable, versioned filesystem trees. + It is not a package system; nor is it a tool for managing full disk images. + Instead, it sits between those levels, offering a blend of the advantages (and + disadvantages) of both. + . + This package contains automated tests. diff --git a/debian/ostree-tests.install b/debian/ostree-tests.install new file mode 100644 index 00000000..2c3436b4 --- /dev/null +++ b/debian/ostree-tests.install @@ -0,0 +1,2 @@ +usr/lib/*/ostree/installed-tests +usr/share/installed-tests/ostree diff --git a/debian/rules b/debian/rules index 53cc4a1c..18ad63d9 100755 --- a/debian/rules +++ b/debian/rules @@ -15,11 +15,20 @@ override_dh_auto_configure: dh_auto_configure -- \ --disable-silent-rules \ --enable-gtk-doc \ + --enable-installed-tests \ --with-dracut \ --with-grub2 \ --with-systemdsystemunitdir=/lib/systemd/system \ $(NULL) + chmod +x tests/*.js override_dh_install: rm -f debian/tmp/usr/lib/*/*.la + rm -f debian/tmp/usr/lib/*/ostree/installed-tests/*.la dh_install --fail-missing + +override_dh_fixperms: + dh_fixperms -X'*.js' + chmod -v +x debian/tmp/usr/lib/*/ostree/installed-tests/*.js + chmod -v +x debian/tmp/usr/lib/*/ostree/installed-tests/*.py + chmod -v +x debian/tmp/usr/lib/*/ostree/installed-tests/*.sh diff --git a/debian/tests/build b/debian/tests/build new file mode 100755 index 00000000..594e4f77 --- /dev/null +++ b/debian/tests/build @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e +exec 2>&1 +set -x + +cd "$ADTTMP" + +cat > trivial.c < + +int main (void) +{ + g_object_unref (ostree_repo_new_default ()); + return 0; +} +EOF + +gcc -o trivial trivial.c $(pkg-config --cflags --libs ostree-1 gobject-2.0) +test -x trivial +./trivial +echo "ok 3 run it" diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 00000000..88ffde7f --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,5 @@ +Tests: gnome-desktop-testing +Depends: gnome-desktop-testing, ostree-tests + +Tests: build +Depends: build-essential, libostree-dev, pkg-config diff --git a/debian/tests/gnome-desktop-testing b/debian/tests/gnome-desktop-testing new file mode 100755 index 00000000..e3015ccb --- /dev/null +++ b/debian/tests/gnome-desktop-testing @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e +exec 2>&1 + +exec gnome-desktop-testing-runner ostree