summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-08 20:20:45 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-08 20:20:45 +0100
commit0624408b94b3338fc7b7e9361b15943ab5648afb (patch)
treec7ac8814da89891d664acbcf82338105a17ffe87
parent2d32065922bf75bab3ae460457d474c2d08bb1de (diff)
Test suite: import-native: New test
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r--debian/tests/control2
-rwxr-xr-xtests/tests/import-native69
2 files changed, 70 insertions, 1 deletions
diff --git a/debian/tests/control b/debian/tests/control
index 08d5f77..1139029 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-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-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-Directory: tests/tests
Depends: dgit, dgit-infrastructure, devscripts
diff --git a/tests/tests/import-native b/tests/tests/import-native
new file mode 100755
index 0000000..d07cd9d
--- /dev/null
+++ b/tests/tests/import-native
@@ -0,0 +1,69 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-setup-import examplegit
+t-tstunt-parsechangelog
+
+mkdir $tmp/aside
+
+versions=""
+for f in $(find $tmp/mirror -name \*.dsc | sort); do
+ perl -i -pe '
+ $_="" if m/^-----BEGIN PGP SIGNED/..!m/\S/;
+ $_="" if m/^-----BEGIN PGP SIGNATURE/..0;
+ $_="" if m/^Dgit: /;
+ ' $f
+ mv $f $tmp/aside/.
+ version="${f%.dsc}"
+ version="${version##*/${p}_}"
+ versions+=" $version"
+done
+
+echo $versions
+
+rm -rf $tmp/git/$p.git
+t-archive-none $p
+
+cd $p
+
+lrref=refs/remotes/dgit/dgit/sid
+
+git update-ref -d $lrref
+
+for v in $versions; do
+ git show-ref
+
+ mv $tmp/aside/${p}_${v}.dsc $tmp/mirror/pool/main/
+ t-archive-query
+
+ t-dgit fetch
+
+ set +e
+ git merge-base HEAD remotes/dgit/dgit/sid
+ rc=$?
+ set -e
+ test $rc = 1
+
+ t-refs-same-start
+ t-ref-same-exact refs/tags/$p/$v:
+ t-ref-same-exact refs/remotes/dgit/dgit/sid:
+
+ first_imp=first-import/$v
+ git tag first-import/$v $lrref
+
+ if [ "$lastv_imp" ]; then
+ git update-ref $lrref $lastv_imp
+
+ t-git-next-date
+ t-dgit fetch
+
+ t-refs-same-start
+ t-ref-same $first_imp
+ t-ref-same $lrref
+ fi
+
+ lastv_imp=$this_imp
+done
+
+echo ok.