1#!/bin/sh 2# SPDX-License-Identifier: GPL-2.0-or-later 3# Copyright (c) International Business Machines Corp., 2005 4# Copyright (c) 2021 Joerg Vehlow <joerg.vehlow@aox-tech.de> 5# Author: Avantika Mathur (mathurav@us.ibm.com) 6 7FS_BIND_TESTFUNC=test 8 9. fs_bind_lib.sh 10 11test() 12{ 13 tst_res TINFO "move: shared tree within a tree it is bound to" 14 15 mkdir parent1 parent2 16 EXPECT_PASS mount --bind "$FS_BIND_DISK1" parent1 17 EXPECT_PASS mount --make-rshared parent1 18 19 EXPECT_PASS mount --bind parent1 parent2 20 21 fs_bind_check parent1 parent2 22 23 EXPECT_PASS mount --move parent1 parent2/a 24 25 fs_bind_check parent2 parent2/a parent2/a/a 26 27 EXPECT_PASS mount --bind "$FS_BIND_DISK2" parent2/b 28 29 fs_bind_check parent2/b parent2/a/b parent2/a/a/b 30 31 EXPECT_PASS mount --bind "$FS_BIND_DISK3" parent2/a/c 32 33 fs_bind_check parent2/c parent2/a/c parent2/a/a/c 34 35 EXPECT_PASS umount parent2/a/a/c 36 37 fs_bind_check parent2/c parent2/a/c parent2/a/a/c 38 39 EXPECT_PASS umount parent2/b 40 EXPECT_PASS umount parent2/a/a 41 EXPECT_PASS umount parent2 42} 43 44tst_run 45