• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "bind: bind within same tree - root to child"
13
14	fs_bind_makedir rshared parent
15	fs_bind_makedir rshared parent/child1
16	fs_bind_makedir rshared parent/child2
17
18	EXPECT_PASS mount --bind parent parent/child2/
19	fs_bind_check parent parent/child2/
20
21	EXPECT_PASS mount --bind "$FS_BIND_DISK3" parent/child2/child1
22	fs_bind_check parent/child1 parent/child2/child1
23
24	EXPECT_PASS umount parent/child2/child1
25	fs_bind_check parent/child1 parent/child2/child1
26
27	EXPECT_PASS mount --bind "$FS_BIND_DISK4" parent/child2/child1
28	fs_bind_check parent/child1 parent/child2/child1
29
30	EXPECT_PASS umount parent/child1
31	fs_bind_check parent/child1 parent/child2/child1
32
33	EXPECT_PASS umount parent/child1
34	EXPECT_PASS umount parent/child2
35	EXPECT_PASS umount parent/child2
36	EXPECT_PASS umount parent
37}
38
39. fs_bind_lib.sh
40tst_run
41