Add a patch to fix the new test-help.sh when ostree trivial-httpd is enabled
At the moment we still build that tool.
This commit is contained in:
parent
8f5e0a5127
commit
48256e0743
|
|
@ -7,6 +7,8 @@ ostree (2017.11-1) UNRELEASED; urgency=medium
|
|||
don't install it yet
|
||||
* Stop copying an old ostree-trivial-httpd.xml from debian/dist/
|
||||
into source tree. Upstream distributes it again.
|
||||
* Add a patch to fix the new test-help.sh when ostree trivial-httpd
|
||||
is enabled. At the moment we still build that tool.
|
||||
|
||||
-- Simon McVittie <smcv@debian.org> Wed, 30 Aug 2017 10:09:26 +0100
|
||||
|
||||
|
|
|
|||
72
debian/patches/Fix-test-help.sh-for-the-case-where-ostree-trivial-httpd-.patch
vendored
Normal file
72
debian/patches/Fix-test-help.sh-for-the-case-where-ostree-trivial-httpd-.patch
vendored
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
From: Simon McVittie <smcv@collabora.com>
|
||||
Date: Fri, 15 Sep 2017 15:15:43 +0100
|
||||
Subject: Fix test-help.sh for the case where ostree trivial-httpd is enabled
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It's deprecated, but as long as it's still supported at all, it
|
||||
shouldn't make the tests fail.
|
||||
|
||||
$ ostree trivial-httpd --help
|
||||
Usage:
|
||||
/usr/lib/libostree/ostree-trivial-httpd [OPTION…] [DIR] - Simple webserver
|
||||
|
||||
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
||||
---
|
||||
tests/test-help.sh | 15 ++++++++++-----
|
||||
1 file changed, 10 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tests/test-help.sh b/tests/test-help.sh
|
||||
index 75fe0c1..2fda2c3 100755
|
||||
--- a/tests/test-help.sh
|
||||
+++ b/tests/test-help.sh
|
||||
@@ -25,13 +25,13 @@ echo "1..1"
|
||||
|
||||
test_usage_output() {
|
||||
file=$1; shift
|
||||
- cmd=$1; shift
|
||||
+ regex=$1; shift
|
||||
assert_file_has_content $file '^Usage'
|
||||
# check that it didn't print twice somehow
|
||||
if [ "$(grep --count '^Usage' $file)" != 1 ]; then
|
||||
_fatal_print_file "$file" "File '$file' has '^Usage' more than once."
|
||||
fi
|
||||
- assert_file_has_content $file "$cmd"
|
||||
+ assert_file_has_content $file "$regex"
|
||||
}
|
||||
|
||||
# check that we found at least one command with subcommands
|
||||
@@ -42,8 +42,13 @@ test_recursive() {
|
||||
|
||||
echo "$cmd" 1>&2
|
||||
$cmd --help 1>out 2>err
|
||||
+
|
||||
+ # Usage for "ostree foo" can contain either "ostree foo" or "ostree-foo"
|
||||
+ # (the latter for ostree trivial-httpd)
|
||||
+ regex="${cmd/ostree /ostree[- ]}"
|
||||
+
|
||||
# --help message goes to standard output
|
||||
- test_usage_output out "$cmd"
|
||||
+ test_usage_output out "$regex"
|
||||
assert_file_empty err
|
||||
|
||||
builtins=`sed -n '/^Builtin \("[^"]*" \)\?Commands:$/,/^$/p' <out | tail -n +2`
|
||||
@@ -60,7 +65,7 @@ test_recursive() {
|
||||
fi
|
||||
|
||||
# error message and usage goes to standard error
|
||||
- test_usage_output err "$cmd"
|
||||
+ test_usage_output err "$regex"
|
||||
assert_file_has_content err 'No \("[^"]*" sub\)\?command specified'
|
||||
assert_file_empty out
|
||||
|
||||
@@ -70,7 +75,7 @@ test_recursive() {
|
||||
assert_not_reached "non-existent subcommand but 0 exit status"
|
||||
fi
|
||||
|
||||
- test_usage_output err "$cmd"
|
||||
+ test_usage_output err "$regex"
|
||||
assert_file_has_content err 'Unknown \("[^"]*" sub\)\?command'
|
||||
assert_file_empty out
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
Fix-test-help.sh-for-the-case-where-ostree-trivial-httpd-.patch
|
||||
Loading…
Reference in New Issue