btrfs: source common/module when requiring module reload
authorMarcos Paulo de Souza <mpdesouza@suse.com>
Fri, 23 Jul 2021 18:18:00 +0000 (15:18 -0300)
committerEryu Guan <guaneryu@gmail.com>
Sun, 25 Jul 2021 14:37:12 +0000 (22:37 +0800)
Tests 163, 219, 225 and 242 require the btrfs module to be reloaded
in the middle of the test. If btrfs is compiled builtin, these tests
should be skipped, since we cannot unload it.

Today, this is what happens:

    QA output created by 242
    +./common/btrfs: line 405: _require_loadable_fs_module: command not found

Sourcing common/module in these tests fixes the issue by skipping the
test:
    btrfs/242       [not run] btrfs: must be a module.
    Ran: btrfs/242
    Not run: btrfs/242

Other tests liker btrfs/124 and btrfs/125 already source the same file
for the same reason, so follow the pattern.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/163
tests/btrfs/219
tests/btrfs/225
tests/btrfs/242

index 1dc081f1d9e1d97f1b4618c61b1fc7200aba9e3e..765538311472addceb20e613233d48c554f21eb8 100755 (executable)
@@ -27,6 +27,7 @@ _cleanup()
 # Import common functions.
 . ./common/filter
 . ./common/filter.btrfs
+. ./common/module
 
 # real QA test starts here
 
index 528175b8a4b901a79886495fde7685880ed360ca..1cd5daae9af68ecebc4dfd5496ac53da16fe9ff0 100755 (executable)
@@ -35,6 +35,7 @@ _cleanup()
 
 # Import common functions.
 . ./common/filter
+. ./common/module
 
 # real QA test starts here
 
index 408c03d2074c4047c6cabc06bddd61d0267ffebc..ce1818db773ca425c32c868f5fbaf4a90e7071ad 100755 (executable)
@@ -25,6 +25,7 @@ _cleanup()
 
 # Import common functions.
 . ./common/filter
+. ./common/module
 
 # real QA test starts here
 
index 6ce620810ce22bcdcb895cb52a7185a0d1eda678..e1c102aec16eaa6d1d0c9e5fa92de4dce8e15a08 100755 (executable)
@@ -13,6 +13,7 @@ _begin_fstest auto quick volume trim
 
 # Import common functions.
 . ./common/filter
+. ./common/module
 
 # real QA test starts here
 _supported_fs btrfs