summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-07-17 15:37:07 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-07-31 22:55:01 +0100
commit8eb4d3531c65dc7afa2bbfe56d535faa756da073 (patch)
tree9f70408170cfc0712d6fee9ea960466668b19391 /tests
parent8a178bf100d49ad948f5f3ec5540da1ff9c74c3e (diff)
Tag change: Test suite: Introduce $tagpfx
Currently this is `test-dummy' (the distro the tests work with). Have checked that after this commit find tests -type f | xargs perl -i~ -pe 's/\$tagpfx/test-dummy/g' puts everything back. (This does not prove I have changed the right set of occurrences, but it does suggest that each actual change is good.) No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib4
-rwxr-xr-xtests/tests/debpolicy-dbretry2
-rwxr-xr-xtests/tests/debpolicy-newreject4
-rwxr-xr-xtests/tests/drs-push-rejects10
-rwxr-xr-xtests/tests/trustingpolicy-replay14
5 files changed, 18 insertions, 16 deletions
diff --git a/tests/lib b/tests/lib
index 7b7bcfb..4bdd1e8 100644
--- a/tests/lib
+++ b/tests/lib
@@ -62,6 +62,8 @@ incoming = $tmp/incoming
run_dinstall = 0
END
+: ${tagpfx:=test-dummy}
+
t-git-next-date () {
GIT_COMMITTER_DATE="$(( ${GIT_COMMITTER_DATE%% *} + 1 )) ${GIT_COMMITTER_DATE#* }"
GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE"
@@ -427,7 +429,7 @@ t-refs-notexist () {
}
t-v-tag () {
- echo refs/tags/test-dummy/${v//\~/_}
+ echo refs/tags/$tagpfx/${v//\~/_}
}
t-check-pushed-master () {
diff --git a/tests/tests/debpolicy-dbretry b/tests/tests/debpolicy-dbretry
index 4122691..b2d8093 100755
--- a/tests/tests/debpolicy-dbretry
+++ b/tests/tests/debpolicy-dbretry
@@ -22,7 +22,7 @@ t-commit 'Make something to autotaint'
t-dgit build
t-dgit push --new
-autotaint=`t-git-get-ref "refs/tags/test-dummy/$v"`
+autotaint=`t-git-get-ref "refs/tags/$tagpfx/$v"`
git reset --hard start
t-commit 'Thing which will autotaint'
diff --git a/tests/tests/debpolicy-newreject b/tests/tests/debpolicy-newreject
index ed4a144..4da568c 100755
--- a/tests/tests/debpolicy-newreject
+++ b/tests/tests/debpolicy-newreject
@@ -51,7 +51,7 @@ t-git-dir-check enoent
t-commit 'should require --deliberately...questionable'
t-dgit build
-t-expect-push-fail E:"tag test-dummy/${vanished//./\\.} referred to this object.*all previously pushed versions were found to have been removed" \
+t-expect-push-fail E:"tag $tagpfx/${vanished//./\\.} referred to this object.*all previously pushed versions were found to have been removed" \
t-dgit push --new
t-git-dir-check enoent
@@ -102,7 +102,7 @@ t-commit 'Check taint is no longer there'
t-dgit build
t-dgit push
-git checkout -b stoats test-dummy/$vanished
+git checkout -b stoats $tagpfx/$vanished
t-commit 'Simulate accidentally building on rejected version'
t-dgit build
t-expect-push-fail "HEAD is not a descendant of the archive's version" \
diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects
index 1a57374..e4cf944 100755
--- a/tests/tests/drs-push-rejects
+++ b/tests/tests/drs-push-rejects
@@ -31,7 +31,7 @@ prep () {
cp $tmp/masters/* $tmp/.
tag_signer='-u Senatus'
tag_message="$p release $version for $suite ($csuite) [dgit]"
- tag_name=test-dummy/$version
+ tag_name=$tagpfx/$version
push_spec1="HEAD:refs/dgit/$csuite"
push_spec2="refs/tags/$tag_name"
push_spec="$push_spec1 $push_spec2"
@@ -102,7 +102,7 @@ mustfail 'push is missing tag ref update' $push_spec1
mustfail 'push is missing head ref update' +$push_spec2
mustfail 'pushing unexpected ref' $push_spec HEAD:refs/wombat
mustfail 'pushing multiple heads' $push_spec HEAD:refs/dgit/wombat
-mustfail 'pushing multiple tags' $push_spec HEAD:refs/tags/test-dummy/wombat
+mustfail 'pushing multiple tags' $push_spec HEAD:refs/tags/$tagpfx/wombat
prep unstable sid
mktag
@@ -129,11 +129,11 @@ mktag HEAD~:
mustfail 'tag refers to wrong kind of object' $push_spec
prep unstable sid
-tag_name=test-dummy/wombat
+tag_name=$tagpfx/wombat
mktag
-#git update-ref test-dummy/$version test-dummy/wombat
+#git update-ref $tagpfx/$version $tagpfx/wombat
mustfail 'tag name in tag is wrong' \
- refs/tags/test-dummy/wombat:refs/tags/test-dummy/$version $push_spec1
+ refs/tags/$tagpfx/wombat:refs/tags/$tagpfx/$version $push_spec1
prep unstable sid
mktag
diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay
index 517f98a..8cc205c 100755
--- a/tests/tests/trustingpolicy-replay
+++ b/tests/tests/trustingpolicy-replay
@@ -20,7 +20,7 @@ t-dgit build
t-dgit push
t-rm-dput-dropping
-git checkout test-dummy/1.0
+git checkout $tagpfx/1.0
t-dgit build
t-dgit push --deliberately-fresh-repo
@@ -28,8 +28,8 @@ remote="`git config dgit-distro.test-dummy.git-url`/$p.git"
t-expect-push-fail 'Replay of previously-rewound upload' \
git push "$remote" \
- test-dummy/1.1 \
- test-dummy/1.1~0:refs/dgit/sid
+ $tagpfx/1.1 \
+ $tagpfx/1.1~0:refs/dgit/sid
git checkout master
@@ -57,11 +57,11 @@ prepare-replay () {
attempt-replay () {
local mpat=$1
- git show test-dummy/$replayv | grep -e $delib
+ git show $tagpfx/$replayv | grep -e $delib
t-expect-push-fail "$mpat" \
git push "$remote" \
- test-dummy/$replayv \
- +test-dummy/$replayv~0:refs/dgit/sid
+ $tagpfx/$replayv \
+ +$tagpfx/$replayv~0:refs/dgit/sid
}
prepare-replay --deliberately-fresh-repo
@@ -77,7 +77,7 @@ t-commit 'later version to stop not fast forward rewinding'
t-dgit build
t-dgit push
-attempt-replay "does not declare previously tags/test-dummy/$v"
+attempt-replay "does not declare previously tags/$tagpfx/$v"
echo ok.