public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcos Paulo de Souza <marcos@mpdesouza.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Marcos Paulo de Souza <mpdesouza@suse.com>,
	dsterba@suse.com, linux-btrfs@vger.kernel.org
Subject: [PATCH 3/3] progs: tests: misc: btrfs-{find-root,select-super} are internal commands
Date: Sun,  1 Mar 2020 00:33:44 -0300	[thread overview]
Message-ID: <20200301033344.808-4-marcos@mpdesouza.com> (raw)
In-Reply-To: <20200301033344.808-1-marcos@mpdesouza.com>

From: Marcos Paulo de Souza <mpdesouza@suse.com>

With this commit, testsuite works as expected.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
 tests/common                                        | 13 +++++++++----
 tests/misc-tests/012-find-root-no-result/test.sh    |  2 +-
 .../020-fix-superblock-corruption/test.sh           |  2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/common b/tests/common
index 605cf72c..26190d85 100644
--- a/tests/common
+++ b/tests/common
@@ -305,13 +305,18 @@ run_mustfail_stdout()
 
 check_prereq()
 {
-	if [ "$1" = "btrfs-corrupt-block" -o "$1" = "fssum" ]; then
+	case "$1" in
+	btrfs-corrupt-block|btrfs-find-root|btrfs-select-super|fssum)
 		if ! [ -f "$INTERNAL_BIN/$1" ]; then
 			_fail "Failed prerequisites: $INTERNAL_BIN/$1";
 		fi
-	elif ! [ -f "$TOP/$1" ]; then
-		_fail "Failed prerequisites: $TOP/$1";
-	fi
+		;;
+	*)
+		if ! [ -f "$TOP/$1" ]; then
+			_fail "Failed prerequisites: $TOP/$1";
+		fi
+		;;
+	esac
 }
 
 check_global_prereq()
diff --git a/tests/misc-tests/012-find-root-no-result/test.sh b/tests/misc-tests/012-find-root-no-result/test.sh
index 6dd447f3..edfdfd38 100755
--- a/tests/misc-tests/012-find-root-no-result/test.sh
+++ b/tests/misc-tests/012-find-root-no-result/test.sh
@@ -11,7 +11,7 @@ check_prereq btrfs-image
 run_check "$TOP/btrfs-image" -r first_meta_chunk.btrfs-image test.img || \
 	_fail "failed to extract first_meta_chunk.btrfs-image"
 
-result=$(run_check_stdout "$TOP/btrfs-find-root" test.img | sed '/^Superblock/d')
+result=$(run_check_stdout "$INTERNAL_BIN/btrfs-find-root" test.img | sed '/^Superblock/d')
 
 if [ -z "$result" ]; then
 	_fail "btrfs-find-root failed to find tree root"
diff --git a/tests/misc-tests/020-fix-superblock-corruption/test.sh b/tests/misc-tests/020-fix-superblock-corruption/test.sh
index 404d416b..d67a87c3 100755
--- a/tests/misc-tests/020-fix-superblock-corruption/test.sh
+++ b/tests/misc-tests/020-fix-superblock-corruption/test.sh
@@ -25,7 +25,7 @@ test_superblock_restore()
 		_fail "btrfs check should detect corruption"
 
 	# Copy backup superblock to primary
-	run_check "$TOP/btrfs-select-super" -s 1 "$TEST_DEV"
+	run_check "$INTERNAL_BIN/btrfs-select-super" -s 1 "$TEST_DEV"
 
 	# Perform btrfs check
 	run_check "$TOP/btrfs" check "$TEST_DEV"
-- 
2.25.0


  parent reply	other threads:[~2020-03-01  3:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01  3:33 [PATCH 0/3] progs: fix testsuite Marcos Paulo de Souza
2020-03-01  3:33 ` [PATCH 1/3] progs: Remove manpages of not packaged binaries Marcos Paulo de Souza
2020-03-01  8:26   ` Qu Wenruo
2020-03-01 14:28     ` Marcos Paulo de Souza
2020-03-02 20:02       ` David Sterba
2020-03-01  3:33 ` [PATCH 2/3] progs: Include btrfs-find-root and btrfs-select-super in testsuite Marcos Paulo de Souza
2020-03-02  0:02   ` Qu Wenruo
2020-03-01  3:33 ` Marcos Paulo de Souza [this message]
2020-03-02  0:03   ` [PATCH 3/3] progs: tests: misc: btrfs-{find-root,select-super} are internal commands Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200301033344.808-4-marcos@mpdesouza.com \
    --to=marcos@mpdesouza.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mpdesouza@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox