Skip to contentSkip to conversation

tests: Add check-block to "make check"

PATCH Superseded Fam Zheng 4 participants 15 messages Oct 28, 2014 – Nov 25, 2014

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

cover tests: Add check-block to "make check"

qemu-iotests contains useful tests that have a nice coverage of block layer code. Adding check-block (which calls tests/qemu-iotests-quick.sh) to "make check" is good for developers' self-testing.

With the first patch, this set takes a half minute on my laptop. If "-j" option is used, it only takes a few more seconds than what we have now.

Fam Zheng (2):
qemu-iotests: Speed up make check-block
tests/Makefile: Add check-block to make check

 tests/Makefile              | 2 +-
 tests/qemu-iotests-quick.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.3
author
#1 lore raw

PATCH 1/2 qemu-iotests: Speed up make check-block

Using /tmp (usually mounted as tmpfs) and cache=writeback, the quick group can be quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.

---
 tests/qemu-iotests-quick.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests-quick.sh +1 -1
index 12af731..0b54dbf 100755
@@ -3,6 +3,6 @@
 cd tests/qemu-iotests
 
 ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=/tmp/qemu-iotests-quick-$$ ./check -T -qcow2 -g quick -c writeback || ret=1
 
 exit $ret
Signature · 1 line
1.9.3
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Speed up make check-block

Quoted 23 lines · Fam Zheng

Using /tmp (usually mounted as tmpfs) and cache=writeback, the quick group can be quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.

---
 tests/qemu-iotests-quick.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests-quick.sh +1 -1
index 12af731..0b54dbf 100755
@@ -3,6 +3,6 @@
 cd tests/qemu-iotests
 
 ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=/tmp/qemu-iotests-quick-$$ ./check -T -qcow2 -g quick -c

writeback || ret=1

Quoted 1 line

exit $ret

Should we let users specify another directory in the environment?

Like this:

: ${TEST_DIR=/tmp/qemu-iotests-quick-$$}
ret=0
./check -T -qcow2 -g quick || ret=1

#3 lore raw

Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Speed up make check-block

In reply to Fam Zheng
Quoted 16 lines · Fam Zheng

Using /tmp (usually mounted as tmpfs) and cache=writeback, the quick group can be quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.

---
  tests/qemu-iotests-quick.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests-quick.sh +0 -0
index 12af731..0b54dbf 100755

tests/qemu-iotests-quick.sh line 6

Quoted 5 lines
tests/qemu-iotests-quick.sh +1 -1
@@ -3,6 +3,6 @@
  cd tests/qemu-iotests
 
  ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=/tmp/qemu-iotests-quick-$$ ./check -T -qcow2 -g quick -c writeback || ret=1

There are (at least) two tests which don't work with -c writeback (026 and 039), one of them is in the quick group (039). Why not use -c writethrough? It doesn't make any difference on tmpfs anyway (we can't omit it because that will break 091).

And thank you, I didn't know about TEST_DIR. I always built the full qemu in /tmp. *g*

Max

Quoted 1 line
tests/qemu-iotests-quick.sh +0 -0
  exit $ret
#4 lore raw

Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Speed up make check-block

Am 25.11.2014 um 10:12 hat Max Reitz geschrieben:

Quoted 12 lines · Fam Zheng
Quoted 11 lines

Using /tmp (usually mounted as tmpfs) and cache=writeback, the quick group can be quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.

---
 tests/qemu-iotests-quick.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

tests/qemu-iotests-quick.sh line 5

Quoted 9 lines
tests/qemu-iotests-quick.sh +1 -1
index 12af731..0b54dbf 100755
@@ -3,6 +3,6 @@
 cd tests/qemu-iotests
 ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=/tmp/qemu-iotests-quick-$$ ./check -T -qcow2 -g quick -c writeback || ret=1

There are (at least) two tests which don't work with -c writeback (026 and 039), one of them is in the quick group (039). Why not use -c writethrough? It doesn't make any difference on tmpfs anyway (we can't omit it because that will break 091).

Why use any -c? The default is the fast option writeback, and for those test cases that don't support writeback, something working is chosen instead.

Kevin

#5 lore raw

Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Speed up make check-block

Quoted 26 lines · Kevin Wolf

Am 25.11.2014 um 10:12 hat Max Reitz geschrieben:

Quoted 12 lines · Fam Zheng
Quoted 11 lines

Using /tmp (usually mounted as tmpfs) and cache=writeback, the quick group can be quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.

---
  tests/qemu-iotests-quick.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

tests/qemu-iotests-quick.sh line 5

Quoted 9 lines
tests/qemu-iotests-quick.sh +1 -1
index 12af731..0b54dbf 100755
@@ -3,6 +3,6 @@
  cd tests/qemu-iotests
  ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=/tmp/qemu-iotests-quick-$$ ./check -T -qcow2 -g quick -c writeback || ret=1

There are (at least) two tests which don't work with -c writeback (026 and 039), one of them is in the quick group (039). Why not use -c writethrough? It doesn't make any difference on tmpfs anyway (we can't omit it because that will break 091).

Quoted 3 lines

Why use any -c? The default is the fast option writeback, and for those test cases that don't support writeback, something working is chosen instead.

Because that breaks 091.

Max

#6 lore raw

Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Speed up make check-block

Am 25.11.2014 um 10:21 hat Max Reitz geschrieben:

Quoted 27 lines · Kevin Wolf
Quoted 26 lines

Am 25.11.2014 um 10:12 hat Max Reitz geschrieben:

Quoted 25 lines · Fam Zheng
Quoted 16 lines

Using /tmp (usually mounted as tmpfs) and cache=writeback, the quick group can be quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.

---
 tests/qemu-iotests-quick.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests-quick.sh +0 -0
index 12af731..0b54dbf 100755

tests/qemu-iotests-quick.sh line 5

Quoted 4 lines
tests/qemu-iotests-quick.sh +1 -1
@@ -3,6 +3,6 @@
 cd tests/qemu-iotests
 ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=/tmp/qemu-iotests-quick-$$ ./check -T -qcow2 -g quick -c writeback || ret=1

There are (at least) two tests which don't work with -c writeback (026 and 039), one of them is in the quick group (039). Why not use -c writethrough? It doesn't make any difference on tmpfs anyway (we can't omit it because that will break 091).

Quoted 5 lines
Quoted 3 lines

Why use any -c? The default is the fast option writeback, and for those test cases that don't support writeback, something working is chosen instead.

Because that breaks 091.

That's unfortunate. I wish tmpfs supported O_DIRECT...

But let's just remove it from quick then - it doesn't really matter if it doesn't run because of the cache mode or because we didn't include it in the group.

-c writethrough is okay as long as you really have tmpfs on your /tmp, but it really hurts when you don't (and I for one don't, standard RHEL 7 installation).

Kevin

#7 lore raw

Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Speed up make check-block

Quoted 31 lines · Kevin Wolf

Am 25.11.2014 um 10:21 hat Max Reitz geschrieben:

Quoted 30 lines · Kevin Wolf
Quoted 29 lines

Am 25.11.2014 um 10:12 hat Max Reitz geschrieben:

Quoted 12 lines · Fam Zheng
Quoted 11 lines

Using /tmp (usually mounted as tmpfs) and cache=writeback, the quick group can be quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.

---
  tests/qemu-iotests-quick.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

tests/qemu-iotests-quick.sh line 5

Quoted 9 lines
tests/qemu-iotests-quick.sh +1 -1
index 12af731..0b54dbf 100755
@@ -3,6 +3,6 @@
  cd tests/qemu-iotests
  ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=/tmp/qemu-iotests-quick-$$ ./check -T -qcow2 -g quick -c writeback || ret=1

There are (at least) two tests which don't work with -c writeback (026 and 039), one of them is in the quick group (039). Why not use -c writethrough? It doesn't make any difference on tmpfs anyway (we can't omit it because that will break 091).

Why use any -c? The default is the fast option writeback, and for those test cases that don't support writeback, something working is chosen instead.

Quoted 6 lines
Quoted 1 line

Because that breaks 091.

That's unfortunate. I wish tmpfs supported O_DIRECT...

But let's just remove it from quick then - it doesn't really matter if it doesn't run because of the cache mode or because we didn't include it in the group.

Fine with me.

Max

Quoted 3 lines

-c writethrough is okay as long as you really have tmpfs on your /tmp, but it really hurts when you don't (and I for one don't, standard RHEL 7 installation).

author
#8 lore raw

Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Speed up make check-block

Quoted 29 lines · Max Reitz
Quoted 28 lines · Kevin Wolf

Am 25.11.2014 um 10:21 hat Max Reitz geschrieben:

Quoted 27 lines · Kevin Wolf
Quoted 26 lines

Am 25.11.2014 um 10:12 hat Max Reitz geschrieben:

Quoted 25 lines · Fam Zheng
Quoted 16 lines

Using /tmp (usually mounted as tmpfs) and cache=writeback, the quick group can be quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.

---
 tests/qemu-iotests-quick.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests-quick.sh +0 -0
index 12af731..0b54dbf 100755

tests/qemu-iotests-quick.sh line 5

Quoted 4 lines
tests/qemu-iotests-quick.sh +1 -1
@@ -3,6 +3,6 @@
 cd tests/qemu-iotests
 ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=/tmp/qemu-iotests-quick-$$ ./check -T -qcow2 -g quick -c writeback || ret=1

There are (at least) two tests which don't work with -c writeback (026 and 039), one of them is in the quick group (039). Why not use -c writethrough? It doesn't make any difference on tmpfs anyway (we can't omit it because that will break 091).

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

Why use any -c? The default is the fast option writeback, and for those test cases that don't support writeback, something working is chosen instead.

Because that breaks 091.

That's unfortunate. I wish tmpfs supported O_DIRECT...

Indeed unfortunate!

Quoted 4 lines
Quoted 4 lines

But let's just remove it from quick then - it doesn't really matter if it doesn't run because of the cache mode or because we didn't include it in the group.

Will do it when respin.

Quoted 4 lines
Quoted 3 lines

-c writethrough is okay as long as you really have tmpfs on your /tmp, but it really hurts when you don't (and I for one don't, standard RHEL 7 installation).

Oh, do you have any better idea than hardcoding to /tmp then?

Fam

#9 lore raw

Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Speed up make check-block

Am 25.11.2014 um 10:44 hat Fam Zheng geschrieben:

Quoted 43 lines · Max Reitz
Quoted 29 lines · Kevin Wolf
Quoted 28 lines

Am 25.11.2014 um 10:21 hat Max Reitz geschrieben:

Quoted 27 lines · Kevin Wolf
Quoted 26 lines

Am 25.11.2014 um 10:12 hat Max Reitz geschrieben:

Quoted 25 lines · Fam Zheng
Quoted 16 lines

Using /tmp (usually mounted as tmpfs) and cache=writeback, the quick group can be quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.

---
 tests/qemu-iotests-quick.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests-quick.sh +0 -0
index 12af731..0b54dbf 100755

tests/qemu-iotests-quick.sh line 5

Quoted 4 lines
tests/qemu-iotests-quick.sh +1 -1
@@ -3,6 +3,6 @@
 cd tests/qemu-iotests
 ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=/tmp/qemu-iotests-quick-$$ ./check -T -qcow2 -g quick -c writeback || ret=1

There are (at least) two tests which don't work with -c writeback (026 and 039), one of them is in the quick group (039). Why not use -c writethrough? It doesn't make any difference on tmpfs anyway (we can't omit it because that will break 091).

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

Why use any -c? The default is the fast option writeback, and for those test cases that don't support writeback, something working is chosen instead.

Because that breaks 091.

That's unfortunate. I wish tmpfs supported O_DIRECT...

Indeed unfortunate!

Quoted 4 lines
Quoted 4 lines

But let's just remove it from quick then - it doesn't really matter if it doesn't run because of the cache mode or because we didn't include it in the group.

Quoted 8 lines

Will do it when respin.

Quoted 4 lines
Quoted 3 lines

-c writethrough is okay as long as you really have tmpfs on your /tmp, but it really hurts when you don't (and I for one don't, standard RHEL 7 installation).

Oh, do you have any better idea than hardcoding to /tmp then?

I think /tmp is fine. It helps those of us who do have a tmpfs there, and it shouldn't hurt the rest at least. Just don't combine it with writethrough, but leave out -c.

Kevin

author
#10 lore raw

PATCH 2/2 tests/Makefile: Add check-block to make check

In reply to Fam Zheng
---
 tests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/Makefile +1 -1
index 16f0e4c..f430b18 100644
@@ -463,7 +463,7 @@ check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
 check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
 check-unit: $(patsubst %,check-%, $(check-unit-y))
 check-block: $(patsubst %,check-%, $(check-block-y))
-check: check-qapi-schema check-unit check-qtest
+check: check-qapi-schema check-unit check-qtest check-block
 check-clean:
 	$(MAKE) -C tests/tcg clean
 	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
Signature · 1 line
1.9.3
Reviewed-by on v1 2/2
#11 lore raw

Re: [Qemu-devel] [PATCH 2/2] tests/Makefile: Add check-block to make check

Quoted 10 lines · Fam Zheng
---
  tests/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/Makefile +0 -0
index 16f0e4c..f430b18 100644

tests/Makefile check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y)) · line 469

Quoted 8 lines
tests/Makefile +1 -1
@@ -463,7 +463,7 @@ check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
  check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
  check-unit: $(patsubst %,check-%, $(check-unit-y))
  check-block: $(patsubst %,check-%, $(check-block-y))
-check: check-qapi-schema check-unit check-qtest
+check: check-qapi-schema check-unit check-qtest check-block
  check-clean:
  	$(MAKE) -C tests/tcg clean
  	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)

Even regardless of patch 1:

But we must fix 039 first (I remember some other test failing sometimes, but I can't remember which).

#12 lore raw
In reply to Fam Zheng
Quoted 6 lines · Fam Zheng

qemu-iotests contains useful tests that have a nice coverage of block layer code. Adding check-block (which calls tests/qemu-iotests-quick.sh) to "make check" is good for developers' self-testing.

With the first patch, this set takes a half minute on my laptop. If "-j" option is used, it only takes a few more seconds than what we have now.

Different data point: elderly machine, spinning rust, /tmp is tmpfs, no -j: elapsed time increases from ~2 to ~3 minutes.

#13 lore raw
Quoted 6 lines · Markus Armbruster
Quoted 4 lines · Fam Zheng

qemu-iotests contains useful tests that have a nice coverage of block layer code. Adding check-block (which calls tests/qemu-iotests-quick.sh) to "make check" is good for developers' self-testing.

Quoted 6 lines
Quoted 3 lines

With the first patch, this set takes a half minute on my laptop. If "-j" option
is used, it only takes a few more seconds than what we have now.

Different data point: elderly machine, spinning rust, /tmp is tmpfs, no -j: elapsed time increases from ~2 to ~3 minutes.

I'm very much in favour of actually running the tests we have.

Running all the block tests for all the formats would be too slow, and that's why you run just the "quick" group, and only for qcow2. Quick enough?

Any ideas on speeding it up further? Trimming image sizes, perhaps?

What are the slowest tests in the quick group? Why are they slow? How are tests selected for the quick group anyway?

#14 lore raw
Quoted 15 lines · Markus Armbruster
Quoted 11 lines · Markus Armbruster
Quoted 7 lines · Fam Zheng

qemu-iotests contains useful tests that have a nice coverage of block layer code. Adding check-block (which calls tests/qemu-iotests-quick.sh) to "make check" is good for developers' self-testing.

With the first patch, this set takes a half minute on my laptop. If "-j" option
is used, it only takes a few more seconds than what we have now.

Different data point: elderly machine, spinning rust, /tmp is tmpfs, no -j: elapsed time increases from ~2 to ~3 minutes.

I'm very much in favour of actually running the tests we have.

Quoted 8 lines

Running all the block tests for all the formats would be too slow, and that's why you run just the "quick" group, and only for qcow2. Quick enough?

Any ideas on speeding it up further? Trimming image sizes, perhaps?

What are the slowest tests in the quick group? Why are they slow? How are tests selected for the quick group anyway?

Last time I updated the associations it was "Whatever runs in under five seconds on my HDD".

Max