Skip to contentSkip to conversation

nbd/003: improve the test

PATCH In review Sun Ke 2 participants 3 messages Feb 24, 2020 – Mar 5, 2020 Block layer

lore
Share & tools
lore

Sun Ke

author
#0 lore raw

PATCH 1/1 nbd/003: improve the test

Modify the DESCRIPTION, remove the umount and add rm.

---
 tests/nbd/003 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/nbd/003 +2 -2
index 57fb63a..49ca30e 100644
@@ -7,7 +7,7 @@
 
 . tests/nbd/rc
 
-DESCRIPTION="mount/unmount concurrently with NBD_CLEAR_SOCK"
+DESCRIPTION="connected by ioctl, mount/unmount concurrently with NBD_CLEAR_SOCK"
 QUICK=1
 
 requires() {
@@ -23,8 +23,8 @@ test() {
 
 	mkdir -p "${TMPDIR}/mnt"
 	src/mount_clear_sock /dev/nbd0 "${TMPDIR}/mnt" ext4 5000
-	umount "${TMPDIR}/mnt" > /dev/null 2>&1
 
 	nbd-client -d /dev/nbd0 >> "$FULL" 2>&1
+	rm -rf "${TMPDIR}/mnt"
 	_stop_nbd_server
 }
Signature · 1 line
2.13.6
#1 lore raw
Quoted 21 lines · Sun Ke

Modify the DESCRIPTION, remove the umount and add rm.

---
 tests/nbd/003 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/nbd/003 +1 -1
index 57fb63a..49ca30e 100644
@@ -7,7 +7,7 @@
 
 . tests/nbd/rc
 
-DESCRIPTION="mount/unmount concurrently with NBD_CLEAR_SOCK"
+DESCRIPTION="connected by ioctl, mount/unmount concurrently with NBD_CLEAR_SOCK"
 QUICK=1
 
 requires() {

tests/nbd/003 test() { · line 26

Quoted 4 lines
tests/nbd/003 +0 -1
@@ -23,8 +23,8 @@ test() {
 
 	mkdir -p "${TMPDIR}/mnt"
 	src/mount_clear_sock /dev/nbd0 "${TMPDIR}/mnt" ext4 5000
-	umount "${TMPDIR}/mnt" > /dev/null 2>&1

Is the umount causing problems?

tests/nbd/003 test() { · line 28

Quoted 3 lines
tests/nbd/003 +1 -0
 	nbd-client -d /dev/nbd0 >> "$FULL" 2>&1
+	rm -rf "${TMPDIR}/mnt"

The test harness already removes the TMPDIR directory. Why is this necessary?

author
#2 lore raw
Quoted 20 lines · Omar Sandoval
Quoted 19 lines · Sun Ke

Modify the DESCRIPTION, remove the umount and add rm.

---
  tests/nbd/003 | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tests/nbd/003 +1 -1
index 57fb63a..49ca30e 100644
@@ -7,7 +7,7 @@
 
  . tests/nbd/rc
 
-DESCRIPTION="mount/unmount concurrently with NBD_CLEAR_SOCK"
+DESCRIPTION="connected by ioctl, mount/unmount concurrently with NBD_CLEAR_SOCK"
  QUICK=1
 
Quoted 8 lines

tests/nbd/003 test() { · line 26

Quoted 6 lines
tests/nbd/003 +0 -1
  requires() {
@@ -23,8 +23,8 @@ test() {
 
  	mkdir -p "${TMPDIR}/mnt"
  	src/mount_clear_sock /dev/nbd0 "${TMPDIR}/mnt" ext4 5000
-	umount "${TMPDIR}/mnt" > /dev/null 2>&1

Is the umount causing problems?

No, it do not cause problems, but it is redundant.

Quoted 8 lines

tests/nbd/003 test() { · line 28

Quoted 4 lines
tests/nbd/003 +1 -0
  	nbd-client -d /dev/nbd0 >> "$FULL" 2>&1
+	rm -rf "${TMPDIR}/mnt"

The test harness already removes the TMPDIR directory. Why is this necessary?

I see.

Thanks,
Sun Ke