summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2022-12-11 13:18:39 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2022-12-11 16:18:33 +0000
commitfafbdd204732cb295b4c35e255c38acff7ad9de7 (patch)
tree9028c17a961db5bc4bc490d95b7edb68d385173c /tests
parent296169a6d876fd37e99bdb43dd959dcb21ab0800 (diff)
dgit: tests: include-binaries: Test forbidden stuff (2)
Check that we get the expected warnings, and that dpkg-source hates a named pipe. (In practice if I nobble the code in dgit which checks all this, we get a different quilt fixup error, but not after dgit caused tar to read files it shouldn't and make unreferenced git objects out of them, which is still bad.) Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tests/quilt-include-binaries33
1 files changed, 31 insertions, 2 deletions
diff --git a/tests/tests/quilt-include-binaries b/tests/tests/quilt-include-binaries
index 56c72f8..c193e0b 100755
--- a/tests/tests/quilt-include-binaries
+++ b/tests/tests/quilt-include-binaries
@@ -56,8 +56,13 @@ t-make-some-bin () {
' >"$file"
}
-t-roundtrips () {
- t-dgit --quilt=nofix --since-version=$v0 build-source
+t-try-build-source () {
+ LC_MESSAGES=C LANGUAGE=C \
+ t-dgit --quilt=nofix --since-version=$v0 "$@" build-source
+}
+
+t-roundtrips-1 () {
+ t-try-build-source "$@" 2>&1 | tee ../build-source-out.$r
t-dgit import-dsc ../${p}_${v}.dsc +reimport
set +e
git --no-pager grep SHOULD-NOT-APPEAR reimport --
@@ -67,6 +72,11 @@ t-roundtrips () {
git diff --exit-code work reimport --
}
+t-roundtrips () {
+ t-roundtrips-1
+ t-roundtrips-1 --include-dirty
+}
+
t-prep 'straightforward'
mkdir bins
@@ -76,6 +86,13 @@ git commit -m 'add bin'
t-roundtrips
+for wrongness in \
+ "forbidden path component '..'" \
+ "path starts with 'debian'" \
+; do
+ grep "$wrongness" ../build-source-out.$r
+done
+
t-prep 'bin via link'
linktarget="$tmp"
@@ -97,4 +114,16 @@ git commit -m 'add bins'
t-roundtrips
+t-prep 'ignored weird file'
+
+mkdir bins
+mkfifo bins/file
+
+t-roundtrips-1 -wdn
+
+grep "'bins/file' not a plain file or directory" ../build-source-out.$r
+
+t-expect-fail E:'dpkg-source: error: *new version is named pipe' \
+t-try-build-source -wdn --ignore-dirty
+
t-ok