Skip to contentSkip to conversation

generic: test mount move semantics

PATCH In review Zorro Lang 2 participants 2 messages Sep 21, 2017 – Sep 22, 2017

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 generic: test mount move semantics

This's a functional test case for mount --move operation, it verifies below semantics:

---------------------------------------------------------------------------

  |         MOVE MOUNT OPERATION                                            |
  |**************************************************************************
  |source(A)->| shared       |       private  |       slave    | unbindable |
  | dest(B)  |               |                |                |            |
  |   |      |               |                |                |            |
  |   v      |               |                |                |            |
  |**************************************************************************
  |  shared  | shared        |     shared     | shared & slave |  invalid   |
  |          |               |                |                |            |
  |non-shared| shared        |      private   |      slave     | unbindable |

***************************************************************************
NOTE: moving a mount residing under a shared mount is invalid.

This case uses fsstress to produce a little random load, to make sure basic operations won't break the the moved mountpoints.

---
 common/rc             |   6 +
 tests/generic/461     | 192 ++++++++++++++++++++++++++
 tests/generic/461.out | 374 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/group   |   1 +
 4 files changed, 573 insertions(+)
 create mode 100755 tests/generic/461
 create mode 100644 tests/generic/461.out
common/rc +6 -0
index cd53a373..1e6ebe3b 100644
@@ -200,6 +200,12 @@ _get_mount()
 
 	_mount $*
 	if [ $? -eq 0 ]; then
+		# mount --move operation updates the mountpoint, so remove
+		# the old one and insert the new one
+		if [[ "$*" =~ --move|-M ]]; then
+			MOUNTED_POINT_STACK=`echo $MOUNTED_POINT_STACK | \
+						cut -d\  -f2-`
+		fi
 		MOUNTED_POINT_STACK="$mnt_point $MOUNTED_POINT_STACK"
 	else
 		return 1
tests/generic/461 new file +192 -0

192 lines not on this page · raw message

tests/generic/461.out new file +374 -0

374 lines not on this page · raw message

tests/generic/group +1 -0
index f922b496..7482fd0c 100644
@@ -463,3 +463,4 @@
 458 auto quick clone
 459 auto dangerous
 460 auto quick rw
+461 auto quick mount
Signature · 1 line
2.13.5
#1 lore raw
Quoted 14 lines · Zorro Lang

This's a functional test case for mount --move operation, it verifies below semantics:

---------------------------------------------------------------------------

  |         MOVE MOUNT OPERATION                                            |
  |**************************************************************************
  |source(A)->| shared       |       private  |       slave    | unbindable |
  | dest(B)  |               |                |                |            |
  |   |      |               |                |                |            |
  |   v      |               |                |                |            |
  |**************************************************************************
  |  shared  | shared        |     shared     | shared & slave |  invalid   |
  |          |               |                |                |            |
  |non-shared| shared        |      private   |      slave     | unbindable |
Quoted 7 lines

***************************************************************************
NOTE: moving a mount residing under a shared mount is invalid.

This case uses fsstress to produce a little random load, to make sure basic operations won't break the the moved mountpoints.

Thanks for the test! As what we discussed just now, the --move semantics test is hard to follow, please add more comments inline to describe your test steps and purpose.

Thanks,
Eryu