[devscripts] 03/03: integration test for various scripts
Nicholas Bamber
periapt at moszumanska.debian.org
Sat Dec 5 12:40:27 UTC 2015
This is an automated email from the git hooks/post-receive script.
periapt pushed a commit to branch master
in repository devscripts.
commit 97a382d981dc134b3035aa43ca870bd393787922
Author: Nicholas Bamber <nicholas at periapt.co.uk>
Date: Sat Dec 5 12:40:08 2015 +0000
integration test for various scripts
---
debian/changelog | 3 +-
test/test_package_lifecycle | 150 ++++++++++++++++++++++++++++++--------------
2 files changed, 105 insertions(+), 48 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 249fef7..06ba13b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,7 +29,8 @@ devscripts (2.15.10) UNRELEASED; urgency=medium
+ Added test for licensecheck versus Software::License
+ Resolved failure to find license from Software::License generated
files from Artistic and Mozilla licenses
- * Added test for life cycle of package
+ * Added test for life cycle of package:
+ + debuild, dscverify, dscextract, list-unreleased, debdiff
[ Dominique Dumont ]
* licensecheck:
diff --git a/test/test_package_lifecycle b/test/test_package_lifecycle
index 842e565..17e42a2 100755
--- a/test/test_package_lifecycle
+++ b/test/test_package_lifecycle
@@ -15,15 +15,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+WORKDIR=$(readlink -f "${0%/*}")
+declare _ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
+
if test "$1" = --installed; then
- INSTALLED=1
shift
else
- INSTALLED=0
+ PATH=${WORKDIR}/../scripts:${PATH}
+ PERL5LIB=${WORKDIR}/../lib:${PERL5LIB}
+ export PATH PERL5LIB
fi
-WORKDIR=$(readlink -f "${0%/*}")
-
GPG=/usr/bin/gpg
if [ ! -x $GPG ];then
echo "$GPG missing"
@@ -91,7 +93,7 @@ runCommandOutCmpFile() {
local exp_retval=$4
local stdoutF="${SHUNIT_TMPDIR}/stdout"
local stderrF="${SHUNIT_TMPDIR}/stderr"
- eval "${COMMAND} $param" 2> ${stderrF} | sed -e's!^ -- Testophilus Testownik <tester at testity.org>.*! -- Testophilus Testownik <tester at testity.org>!' > ${stdoutF}
+ eval "${COMMAND} $param" 2> ${stderrF} | grep -v File::FcntlLock | sed -e's!^ -- Testophilus Testownik <tester at testity.org>.*! -- Testophilus Testownik <tester at testity.org>!' > ${stdoutF}
retval=$?
eval "cmp ${stdoutF} ${exp_stdoutfile}" 3>&1 >/dev/null
local diffretval=$?
@@ -104,12 +106,7 @@ runCommandOutCmpFile() {
test_debuild() {
export GNUPGHOME=$GPGHOME
cd ${WORKDIR}/package_lifecycle/test
- if [[ $INSTALLED == "1" ]]; then
- COMMAND='debuild --no-conf'
- else
- COMMAND="perl -I ${WORKDIR}/../lib ${WORKDIR}/../scripts/debuild.pl --no-conf"
- fi
- local _ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
+ COMMAND='debuild --no-conf --no-lintian --preserve-envvar=PATH --preserve-envvar=PERL5LIB --preserve-envvar=DEBFULLNAME --preserve-envvar=DEBEMAIL --preserve-envvar=GNUPGHOME'
cat > ${WORKDIR}/package_lifecycle/debuild.txt <<-EOS
dpkg-buildpackage -rfakeroot -D -us -uc
dpkg-buildpackage: source package test
@@ -117,7 +114,7 @@ test_debuild() {
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Testophilus Testownik <tester at testity.org>
dpkg-source --before-build test
- dpkg-buildpackage: host architecture amd64
+ dpkg-buildpackage: host architecture ${_ARCH}
fakeroot debian/rules clean
dh clean
dh_testdir
@@ -155,23 +152,10 @@ test_debuild() {
dpkg-genchanges: including full source code in upload
dpkg-source --after-build test
dpkg-buildpackage: full upload (original source is included)
- Now running lintian...
- W: test source: debhelper-but-no-misc-depends test
- E: test source: package-uses-debhelper-but-lacks-build-depends
- W: test source: package-needs-versioned-debhelper-build-depends 9
- W: test source: no-debian-copyright
- I: test source: debian-watch-file-is-missing
- P: test: no-upstream-changelog
- W: test: new-package-should-close-itp-bug
- E: test: no-copyright-file
- I: test: extended-description-is-probably-too-short
- P: test: no-homepage-field
- W: test: empty-binary-package
- Finished running lintian.
Now signing changes and any dsc files...
signfile test_1.0-1.dsc uscan test key (no secret) <none at debian.org>
- signfile test_1.0-1_amd64.changes uscan test key (no secret) <none at debian.org>
+ signfile test_1.0-1_${_ARCH}.changes uscan test key (no secret) <none at debian.org>
Successfully signed dsc and changes files
EOS
@@ -181,11 +165,7 @@ EOS
test_dscverify () {
cd ${WORKDIR}/package_lifecycle
- if [[ $INSTALLED == "1" ]]; then
- COMMAND='dscverify --no-conf --keyring $GPGHOME/pubring.gpg'
- else
- COMMAND="perl -I ${WORKDIR}/../lib ${WORKDIR}/../scripts/dscverify.pl --no-conf --keyring $GPGHOME/pubring.gpg"
- fi
+ COMMAND='dscverify --no-conf --keyring $GPGHOME/pubring.gpg'
cat > ${WORKDIR}/package_lifecycle/dscverify.txt <<-EOS
${WORKDIR}/package_lifecycle/test_1.0-1.dsc:
Good signature found
@@ -199,11 +179,7 @@ EOS
test_dscextractControl () {
cd ${WORKDIR}/package_lifecycle
- if [[ $INSTALLED == "1" ]]; then
- COMMAND='dscextract'
- else
- COMMAND="${WORKDIR}/../scripts/dscextract.sh"
- fi
+ COMMAND='dscextract'
cat > ${WORKDIR}/package_lifecycle/dscextractControl.txt <<-EOS
Source: test
Section: devel
@@ -223,11 +199,7 @@ EOS
test_dscextractChangelog () {
cd ${WORKDIR}/package_lifecycle
- if [[ $INSTALLED == "1" ]]; then
- COMMAND='dscextract'
- else
- COMMAND="${WORKDIR}/../scripts/dscextract.sh"
- fi
+ COMMAND='dscextract'
cat > ${WORKDIR}/package_lifecycle/dscextractChangelog.txt <<-EOS
test (1.0-1) unstable; urgency=low
@@ -241,11 +213,7 @@ EOS
test_debchange () {
cd ${WORKDIR}/package_lifecycle/test
- if [[ $INSTALLED == "1" ]]; then
- COMMAND='debchange'
- else
- COMMAND="perl -I ${WORKDIR}/../lib ${WORKDIR}/../scripts/debchange.pl"
- fi
+ COMMAND='debchange'
export DEBFULLNAME='Testophilus Testownik'
export DEBEMAIL='tester at testity.org'
cat > ${WORKDIR}/package_lifecycle/debchange.txt <<-EOS
@@ -267,8 +235,96 @@ EOS
cd ${WORKDIR}
}
+test_list_unreleased () {
+ cd ${WORKDIR}/package_lifecycle/test
+ COMMAND='list-unreleased'
+ cat > ${WORKDIR}/package_lifecycle/list-unreleased.txt <<-EOS
+ test (1.0-2) UNRELEASED; urgency=medium
+
+ * new killer app functionality
+
+ -- Testophilus Testownik <tester at testity.org>
+EOS
+ runCommandOutCmpFile "-c -R" "../list-unreleased.txt" "" 0
+ cd ${WORKDIR}
+}
+
+
+test_debuild2() {
+ export GNUPGHOME=$GPGHOME
+ cd ${WORKDIR}/package_lifecycle/test
+ COMMAND='debuild --no-conf --no-lintian --preserve-envvar=PATH --preserve-envvar=PERL5LIB --preserve-envvar=DEBFULLNAME --preserve-envvar=DEBEMAIL --preserve-envvar=GNUPGHOME'
+ cat > ${WORKDIR}/package_lifecycle/debuild.txt <<-EOS
+ dpkg-buildpackage -rfakeroot -D -us -uc
+ dpkg-buildpackage: source package test
+ dpkg-buildpackage: source version 1.0-2
+ dpkg-buildpackage: source distribution UNRELEASED
+ dpkg-buildpackage: source changed by Testophilus Testownik <tester at testity.org>
+ dpkg-source --before-build test
+ dpkg-buildpackage: host architecture ${_ARCH}
+ fakeroot debian/rules clean
+ dh clean
+ dh_testdir
+ dh_auto_clean
+ dh_clean
+ dpkg-source -b test
+ dpkg-source: info: using source format '3.0 (quilt)'
+ dpkg-source: info: building test using existing ./test_1.0.orig.tar.xz
+ dpkg-source: info: building test in test_1.0-2.debian.tar.xz
+ dpkg-source: info: building test in test_1.0-2.dsc
+ debian/rules build
+ dh build
+ dh_testdir
+ dh_auto_configure
+ dh_auto_build
+ dh_auto_test
+ fakeroot debian/rules binary
+ dh binary
+ dh_testroot
+ dh_prep
+ dh_auto_install
+ dh_installdocs
+ dh_installchangelogs
+ dh_perl
+ dh_link
+ dh_strip_nondeterminism
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+ dpkg-deb: building package 'test' in '../test_1.0-2_all.deb'.
+ dpkg-genchanges >../test_1.0-2_${_ARCH}.changes
+ dpkg-genchanges: not including original source code in upload
+ dpkg-source --after-build test
+ dpkg-buildpackage: binary and diff upload (original source NOT included)
+ Now signing changes and any dsc files...
+ signfile test_1.0-2.dsc uscan test key (no secret) <none at debian.org>
+
+ signfile test_1.0-2_${_ARCH}.changes uscan test key (no secret) <none at debian.org>
+
+ Successfully signed dsc and changes files
+EOS
+ runCommandOutCmpFile "-k'uscan test key (no secret) <none at debian.org>'" "${WORKDIR}/package_lifecycle/debuild.txt" "" 0
+ cd ${WORKDIR}
+}
+
+test_debdiff () {
+ cd ${WORKDIR}/package_lifecycle
+ COMMAND='debdiff'
+ cat > ${WORKDIR}/package_lifecycle/debdiff.txt <<-EOS
+ File lists identical (after any substitutions)
+
+ Control files: lines which differ (wdiff format)
+ ------------------------------------------------
+ Version: [-1.0-1-] {+1.0-2+}
+EOS
+ runCommandOutCmpFile "test_1.0-1_${_ARCH}.changes test_1.0-2_${_ARCH}.changes" "debdiff.txt" "" 0
+ cd ${WORKDIR}
+}
cd ${WORKDIR}
. shunit2
-#rm -rf ${WORKDIR}/package_lifecycle
+rm -rf ${WORKDIR}/package_lifecycle
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git
More information about the devscripts-devel
mailing list