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 "bind: shared child to shared parent" 14 15 fs_bind_makedir rshared dir1 16 mkdir dir1/1 dir1/1/2 dir1/1/2/3 dir1/1/2/fs_bind_check dir2 dir3 dir4 17 touch dir4/ls 18 19 EXPECT_PASS mount --bind dir1/1/2 dir2 20 EXPECT_PASS mount --make-rslave dir1 21 EXPECT_PASS mount --make-rshared dir1 22 23 EXPECT_PASS mount --bind dir1/1/2/3 dir3 24 EXPECT_PASS mount --make-rslave dir1 25 26 EXPECT_PASS mount --bind dir4 dir2/fs_bind_check 27 fs_bind_check dir1/1/2/fs_bind_check/ dir4 28 29 EXPECT_PASS umount dir2/fs_bind_check 30 EXPECT_PASS umount dir3 31 EXPECT_PASS umount dir2 32 EXPECT_PASS umount dir1 33} 34 35tst_run 36