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 "cloneNS: namespace with shared dirs" 14 15 fs_bind_makedir rshared dir1 16 fs_bind_makedir rshared dir2 17 18 EXPECT_PASS mount --bind "$FS_BIND_DISK1" dir1 19 EXPECT_PASS mount --bind dir1 dir2 20 21 fs_bind_create_ns 22 23 EXPECT_PASS mount --bind "$FS_BIND_DISK2" dir2/a 24 fs_bind_check dir1/a dir2/a 25 26 fs_bind_check -s "$FS_BIND_DISK2" dir1/a dir2/a 27 fs_bind_exec_ns mount --bind "$PWD/$FS_BIND_DISK3" $PWD/dir1/b 28 fs_bind_check -s dir1/b dir2/b 29 30 EXPECT_PASS umount dir1/b 31 EXPECT_PASS umount dir2/a 32 EXPECT_PASS umount dir2 33 EXPECT_PASS umount dir1 34 EXPECT_PASS umount dir2 35 EXPECT_PASS umount dir1 36} 37 38tst_run 39