1#!/bin/bash 2 3SETS_DEFAULTS="${TCID=test07-2} ${TST_COUNT=1} ${TST_TOTAL=1}" 4declare -r TCID 5declare -r TST_COUNT 6declare -r TST_TOTAL 7export TCID TST_COUNT TST_TOTAL 8 9tst_resm TINFO "***************TEST07***************" 10tst_resm TINFO "rbind: create slave then mount master - slave still propagates." 11tst_resm TINFO "************************************" 12 13. "${FS_BIND_ROOT}/bin/setup" || (tst_resm TWARN "Setup of rbind/test07-2 failed" && tst_exit) 14export result=0 15 16 17 18trap 'ERR=$? ; ERR_MSG="caught error near: ${BASH_SOURCE[0]}:${FUNCNAME[0]}:${LINENO}:$_ (returned ${ERR})"; break' ERR 19 20while /bin/true ; do 21 # This loop is for error recovery purposes only 22 23 24 "${FS_BIND_ROOT}/bin/makedir" share parent2 25 "${FS_BIND_ROOT}/bin/makedir" share share2 26 27 mount --rbind share2 parent2 28 "${FS_BIND_ROOT}/bin/makedir" slave parent2 29 mount --rbind "$disk1" share2 30 31 check parent2 share2 32 33 mount --rbind "$disk2" parent2/a 34 35 check -n parent2/a share2/a 36 37 break 38done 39trap 'ERR=$? ; tst_resm TWARN "rbind/test07-2: caught error near: ${BASH_SOURCE[0]}:${FUNCNAME[0]}:${LINENO}:$_ (returned ${ERR})"' ERR 40if [ -n "${ERR_MSG}" ]; then 41 tst_resm TWARN "rbind/test07-2: ${ERR_MSG}" 42 ERR_MSG="" 43 result=$ERR 44fi 45trap '' ERR 46{ 47 umount parent2/a 48 umount parent2 49 umount parent2 50 umount parent2 51 52 umount share2 53 umount share2 54 55 56 rm -rf parent* share* 57 cleanup 58} >& /dev/null 59if [ $result -ne 0 ] 60then 61 tst_resm TFAIL "rbind/test07-2: FAILED: rbind: create slave then mount master - slave still propagates." 62 exit 1 63else 64 tst_resm TPASS "rbind/test07-2: PASSED" 65 exit 0 66fi 67 68 69tst_exit 70