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 10test() 11{ 12 tst_res TINFO "move: shared tree within a tree it is bound to" 13 14 mkdir parent1 parent2 15 EXPECT_PASS mount --bind "$FS_BIND_DISK1" parent1 16 EXPECT_PASS mount --make-rshared parent1 17 18 EXPECT_PASS mount --bind parent1 parent2 19 20 fs_bind_check parent1 parent2 21 22 EXPECT_PASS mount --move parent1 parent2/a 23 24 fs_bind_check parent2 parent2/a parent2/a/a 25 26 EXPECT_PASS mount --bind "$FS_BIND_DISK2" parent2/b 27 28 fs_bind_check parent2/b parent2/a/b parent2/a/a/b 29 30 EXPECT_PASS mount --bind "$FS_BIND_DISK3" parent2/a/c 31 32 fs_bind_check parent2/c parent2/a/c parent2/a/a/c 33 34 EXPECT_PASS umount parent2/a/a/c 35 36 fs_bind_check parent2/c parent2/a/c parent2/a/a/c 37 38 EXPECT_PASS umount parent2/b 39 EXPECT_PASS umount parent2/a/a 40 EXPECT_PASS umount parent2 41} 42 43. fs_bind_lib.sh 44tst_run 45