From 3a434e0ecac4387bb900a078b7d65c751b99f3bb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 8 Oct 2016 20:21:35 +0100 Subject: Test suite: import-nonnative: Enhanced and finished Use t-git-next-date. (Our GIT_AUTHOR_DATE settings were wrong and therefore ineffective.) Add a 1.0 with diff test. Add some comments about package format. Now the test is finished. Signed-off-by: Ian Jackson --- debian/tests/control | 2 +- tests/tests/import-nonnative | 78 ++++++++++++++++++++++++++++++++++++++++++++ tests/tests/import-quilt | 74 ----------------------------------------- 3 files changed, 79 insertions(+), 75 deletions(-) create mode 100755 tests/tests/import-nonnative delete mode 100755 tests/tests/import-quilt diff --git a/debian/tests/control b/debian/tests/control index 1139029..4b0afe6 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -21,7 +21,7 @@ Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts Restrictions: x-dgit-git-only -Tests: build-modes build-modes-asplit build-modes-gbp-asplit clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast import-native import-quilt inarchivecopy newtag-clone-nogit oldnewtagalt oldtag-clone-nogit overwrite-chkclog overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay +Tests: build-modes build-modes-asplit build-modes-gbp-asplit clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast import-native import-nonnative inarchivecopy newtag-clone-nogit oldnewtagalt oldtag-clone-nogit overwrite-chkclog overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts diff --git a/tests/tests/import-nonnative b/tests/tests/import-nonnative new file mode 100755 index 0000000..98076f0 --- /dev/null +++ b/tests/tests/import-nonnative @@ -0,0 +1,78 @@ +#!/bin/bash +set -e +. tests/lib + +t-tstunt-parsechangelog + +chk () { + p=$1 + v=$2 + + t-archive $p $v + t-git-none + t-dgit --no-rm-on-error clone $p + + # And now we make an update using the same orig tarball, and + # check that the orig import is stable. + + cd $p + + git branch first-import + + m='Commit for import check' + echo "$m" >>import-check + + v=${v%-*}-99 + dch -v $v -D unstable -m "$m" + + git add import-check debian/changelog + git commit -m "$m" + + t-dgit -wgf quilt-fixup + t-dgit -wgf build-source + + # The resulting .dsc does not have a Dgit line (because dgit push + # puts that in). So we just shove it in the archive now + + ln ../${p}_${v}.* $tmp/mirror/pool/main/ + t-archive-query + + t-dgit fetch + + git branch first-2nd-import remotes/dgit/dgit/sid + + t-git-next-date + + git update-ref refs/remotes/dgit/dgit/sid first-import + + t-dgit fetch + + t-refs-same-start + t-ref-same refs/remotes/dgit/dgit/sid + t-ref-same refs/heads/first-2nd-import + + for orig in ../${p}_${v%-*}.orig*.tar.*; do + orig=${orig#../} + pat="^Import ${orig//./\\.}\$" + t-refs-same-start + for start in first-import first-2nd-import; do + git log --pretty='tformat:%H' --grep "$pat" $start \ + >../t.imp + test $(wc -l <../t.imp) = 1 + imp=$(cat ../t.imp) + t-ref-same-val "$orig $start" "$imp" + done + done + cd .. +} + +# 1.0 with diff +chk pari-extra 3-1 + +# 3.0 (quilt), multiple patches, multiple origs +chk example 1.0-1 + +# 3.0 (quilt), single-debian-patch, one orig +chk sunxi-tools 1.2-2.~~dgittest + +echo done. diff --git a/tests/tests/import-quilt b/tests/tests/import-quilt deleted file mode 100755 index 08ea866..0000000 --- a/tests/tests/import-quilt +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -set -e -. tests/lib - -t-tstunt-parsechangelog - -chk () { - p=$1 - v=$2 - - t-archive $p $v - t-git-none - t-dgit --no-rm-on-error clone $p - - echo xxx do some basic checks - - # And now we make an update using the same orig tarball, and - # check that the orig import is stable. - - cd $p - - git branch first-import - - m='Commit for import check' - echo "$m" >>import-check - - v=${v%-*}-99 - dch -v $v -D unstable -m "$m" - - git add import-check debian/changelog - git commit -m "$m" - - t-dgit -wgf quilt-fixup - t-dgit -wgf build-source - - # The resulting .dsc does not have a Dgit line (because dgit push - # puts that in). So we just shove it in the archive now - - ln ../${p}_${v}.* $tmp/mirror/pool/main/ - t-archive-query - - t-dgit fetch - - git branch first-2nd-import remotes/dgit/dgit/sid - - export GIT_AUTHOR_DATE=1475947851 - export GIT_COMMITTER_DATE=1475947851 - - t-dgit fetch - - t-refs-same-start - t-ref-same refs/remotes/dgit/dgit/sid - t-ref-same refs/heads/first-2nd-import - - for orig in ../${p}_${v%-*}.orig*.tar.*; do - orig=${orig#../} - pat="^Import ${orig//./\\.}\$" - t-refs-same-start - for start in first-import first-2nd-import; do - git log --pretty='tformat:%H' --grep "$pat" $start \ - >../t.imp - test $(wc -l <../t.imp) = 1 - imp=$(cat ../t.imp) - t-ref-same-val "$orig $start" "$imp" - done - done - cd .. -} - -chk example 1.0-1 - -chk sunxi-tools 1.2-2.~~dgittest - -echo xxx need more. -- cgit v1.2.3