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 - and then move to another share subtree" 14 15 fs_bind_makedir rshared parent1 16 mkdir parent1/a parent2 17 EXPECT_PASS mount --bind parent1 parent2 18 19 fs_bind_check parent1 parent2 20 21 EXPECT_PASS mount --move parent1 parent2/a 22 23 fs_bind_check parent2 parent2/a parent2/a/a 24 25 fs_bind_makedir rshared tmp1 26 mkdir tmp2 tmp1/1 27 28 EXPECT_PASS mount --bind tmp1 tmp2 29 EXPECT_PASS mount --move parent2 tmp1/1 30 31 EXPECT_PASS umount tmp1/1/a/a 32 EXPECT_PASS umount tmp1/1 33 EXPECT_PASS umount tmp1 34 EXPECT_PASS umount tmp2 35} 36 37tst_run 38