mkdir test1 test2 test3 tmp
mount -t tmpfs propagation-tests-src test1
mount --make-shared test1
mount --bind test1 test2
mount --make-slave test2
mount --make-shared test2
mount --bind test2 test3
mount --make-slave test3
mount --make-shared test3
mount --bind test3 tmp
mount --make-slave tmp
mkdir tmp/sub

mount --bind test1 test2/sub
mount --make-rprivate test1
umount -l test1
mount --make-rprivate test3/sub
umount -l test3/sub

mount --rbind test2 test3/sub
mount --make-rprivate test2
umount -l test2
mount --make-rprivate tmp/sub
umount -l tmp/sub

mount --rbind test3 tmp/sub
mount --make-rprivate test3
umount -l test3

echo "------------"
cat /proc/self/mountinfo | grep propagation-tests-src
echo "------------"
