common/btrfs: source module file and remove duplicates
authorLuis Chamberlain <mcgrof@kernel.org>
Fri, 5 Nov 2021 15:59:47 +0000 (08:59 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 7 Nov 2021 13:58:17 +0000 (21:58 +0800)
btrfs/249 fails with:

QA output created by 249
./common/btrfs: line 425: _require_loadable_fs_module: command not found
./common/btrfs: line 432: _reload_fs_module: command not found
ERROR: not a btrfs filesystem: /media/scratch

This is because the test is failing to source common/module.
Fix this by sourcing common/module in the btrfs common file.

While it it remove duplication of sourcing this file from other
tests in btrfs so that this is only done once in one place.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/btrfs
tests/btrfs/124
tests/btrfs/125
tests/btrfs/163
tests/btrfs/164
tests/btrfs/219
tests/btrfs/225
tests/btrfs/242

index 5d938c19b56ad9dfd35c90ad2fc144e4ce429b7a..2eab4b299387a6aed245bd49a1078376bd46b68a 100644 (file)
@@ -2,6 +2,8 @@
 # Common btrfs specific functions
 #
 
+. common/module
+
 _btrfs_get_subvolid()
 {
        mnt=$1
index 5c05ffae1b8f842aa745d8b8c0268de0acbae2a2..8771a3c12f8ba0f6f29f99e4c16a5ad5620e8a6a 100755 (executable)
@@ -35,7 +35,6 @@ _cleanup()
 
 # Import common functions.
 . ./common/filter
-. ./common/module
 
 # real QA test starts here
 
index e46b194d0139531c348abc8773567b81007cbc10..b6a28f5cf47ca4ccadf49e9538b5bb8678a79df0 100755 (executable)
@@ -34,7 +34,6 @@ _cleanup()
 
 # Import common functions.
 . ./common/filter
-. ./common/module
 
 # real QA test starts here
 
index 765538311472addceb20e613233d48c554f21eb8..1dc081f1d9e1d97f1b4618c61b1fc7200aba9e3e 100755 (executable)
@@ -27,7 +27,6 @@ _cleanup()
 # Import common functions.
 . ./common/filter
 . ./common/filter.btrfs
-. ./common/module
 
 # real QA test starts here
 
index 59a9c90ea77c8cf365f52d77b326b51d4c4dce64..3e69b35fb641b4dc0c8c6c082f4ffaf50028c9fd 100755 (executable)
@@ -20,9 +20,6 @@ _cleanup()
        _btrfs_rescan_devices
 }
 
-# Import common functions.
-. ./common/module
-
 # real QA test starts here
 
 # Modify as appropriate.
index 1cd5daae9af68ecebc4dfd5496ac53da16fe9ff0..528175b8a4b901a79886495fde7685880ed360ca 100755 (executable)
@@ -35,7 +35,6 @@ _cleanup()
 
 # Import common functions.
 . ./common/filter
-. ./common/module
 
 # real QA test starts here
 
index ce1818db773ca425c32c868f5fbaf4a90e7071ad..408c03d2074c4047c6cabc06bddd61d0267ffebc 100755 (executable)
@@ -25,7 +25,6 @@ _cleanup()
 
 # Import common functions.
 . ./common/filter
-. ./common/module
 
 # real QA test starts here
 
index e1c102aec16eaa6d1d0c9e5fa92de4dce8e15a08..6ce620810ce22bcdcb895cb52a7185a0d1eda678 100755 (executable)
@@ -13,7 +13,6 @@ _begin_fstest auto quick volume trim
 
 # Import common functions.
 . ./common/filter
-. ./common/module
 
 # real QA test starts here
 _supported_fs btrfs