qemu-e2k/tests/qemu-iotests
Sascha Silbe 5a8fabf333 qemu-iotests: iotests: fail hard if not run via "check"
Running an iotests-based Python test directly might appear to work,
but may fail in subtle ways and is insecure:

- It creates files with predictable file names in a world-writable
  location (/var/tmp).

- Tests expect the environment to be set up by check. E.g. 041 and 055
  may take the wrong code paths if QEMU_DEFAULT_MACHINE is not
  set. This can lead to false negatives.

Instead fail hard and tell the user we want to be run via "check".

The actual environment expected by the tests is currently only defined
by the implementation of "check". We use two of the environment
variables set by "check" as indication of whether we're being run via
"check". Anyone writing their own test runner (replacing "check") will
need to replicate the full environment (in a broader sense, not just
environment variables) provided by "check" anyway, including setting
the two environment variables we check. Whereas a regular developer
just trying to invoke the tests usually won't have both of these
defined in their environment so we can catch their mistake and give
out useful advice.

Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: Bo Tu <tubo@linux.vnet.ibm.com>
Message-id: 1461094442-16014-1-git-send-email-silbe@linux.vnet.ibm.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-05-12 15:33:24 +02:00
..
sample_images
.gitignore
001
001.out
002
002.out
003
003.out
004
004.out
005
005.out
007
007.out
008
008.out
009
009.out
010
010.out
011
011.out
012
012.out
013
013.out
014
014.out
015
015.out
017
017.out
018
018.out
019
019.out
020
020.out
021
021.out
022
022.out
023
023.out
024
024.out
025
025.out
026
026.out
026.out.nocache
027
027.out
028
028.out
029
029.out
030
030.out
031
031.out
032
032.out
033
033.out
034
034.out
035
035.out
036
036.out
037
037.out
038
038.out
039
039.out
040
040.out
041
041.out
042
042.out
043
043.out
044
044.out
045
045.out
046
046.out
047
047.out
048
048.out
049
049.out
050
050.out
051
051.out
051.pc.out
052
052.out
053
053.out
054
054.out
055
055.out
056
056.out
057
057.out
058
058.out
059
059.out
060
060.out
061
061.out
062
062.out
063
063.out
064
064.out
065
065.out
066
066.out
067
067.out
068
068.out
069
069.out
070
070.out
071
071.out
072
072.out
073
073.out
074
074.out
075
075.out
076
076.out
077
077.out
078
078.out
079
079.out
080
080.out
081
081.out
082
082.out
083
083.out
084
084.out
085
085.out
086
086.out
087
087.out
088
088.out
089
089.out
090
090.out
091
091.out
092
092.out
093
093.out
094
094.out
095
095.out
096
096.out
097
097.out
098
098.out
099
099.out
100
100.out
101
101.out
102
102.out
103
103.out
104
104.out
105
105.out
107
107.out
108
108.out
109
109.out
110
110.out
111
111.out
112
112.out
113
113.out
114
114.out
115
115.out
116
116.out
117
117.out
118
118.out
119
119.out
120
120.out
121
121.out
122
122.out
123
123.out
124
124.out
128
128.out
129
129.out
130
130.out
131
131.out
132
132.out
133
133.out
134
134.out
135
135.out
136
136.out
137
137.out
138
138.out
139
139.out
140
140.out
141
141.out
142
142.out
143
143.out
144
144.out
145
145.out
146
146.out
148
148.out
149
149.out
150
150.out
152
152.out
check
common
common.config
common.filter
common.pattern
common.qemu
common.rc
COPYING
group
iotests.py qemu-iotests: iotests: fail hard if not run via "check" 2016-05-12 15:33:24 +02:00
Makefile
nbd-fault-injector.py
qcow2.py
qed.py
README
socket_scm_helper.c

=== This is the QEMU I/O test suite ===

* Intro

This package contains a simple test suite for the I/O layer of qemu.
It does not require a guest, but only the qemu, qemu-img and qemu-io
binaries.  This does limit it to exercise the low-level I/O path only
but no actual block drivers like ide, scsi or virtio.

* Usage

Just run ./check to run all tests for the raw image format, or ./check
-qcow2 to test the qcow2 image format.  The output of ./check -h explains
additional options to test further image formats or I/O methods.

* Feedback and patches

Please send improvements to the test suite, general feedback or just
reports of failing tests cases to qemu-devel@savannah.nongnu.org.