source: trunk/packages/xen-common/xen-common/tools/xm-test/README @ 95

Last change on this file since 95 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 10.8 KB
Line 
1
2xm-test README
3
4Copyright (C) International Business Machines Corp., 2005
5Author(s): Dan Smith <danms@us.ibm.com>
6           Woody Marvel <marvel@us.ibm.com>
7
8Overview
9========
10
11This suite provides a framework for testing the Xen userspace tools.
12The directory structure is:
13
14  ./xm-test
15   |
16   +-/lib: Python support libraries
17   |
18   +-/ramdisk: Staging area for building the test ramdisk
19   |
20   +-/tests
21   | |
22   | +-/create: Tests for the 'xm create' command
23   | +-/destroy: Tests for the 'xm destroy' command
24   |  . . .
25   |
26   +-/utils: Utility scripts for ramdisk building
27
28Reports are posted here:
29
30   http://xmtest.dague.org
31
32
33Building
34========
35
36Before the test suite can be used, the ramdisk must be built from
37source.  All source needed for this process is automatically
38downloaded, extracted, and compiled.  Due to the need to create
39special files, this process must be done as root:
40
41   # ./autogen
42   # ./configure
43   # make
44
45NB: If you have the initrd.img from another installation of xm-test,
46you can copy it into the ramdisk directory to eliminate the need to
47rebuild it.  If you do this, there is no need to run 'make' again.
48Simply copy the initrd-X.Y-ARCH.img file into ramdisk/ and then run:
49
50   # make existing
51
52Or, you can run:
53   # INITRD="http://url.of.initrd.repo/" make existing
54
55You do not need to include the name of the image itself in the url,
56however, an initrd with the right name (initrd.X.Y-ARCH.img) and version
57number must exist at that location.  The script will determine which
58version of the initrd it needs and try to download the right file from
59that location.
60
61This will set up the link so that xm-test will use the existing
62ramdisk.  Next, just run "runtest.sh" normally.  Note that in general,
63you should not attempt to use a ramdisk from a previous minor version
64of xm-test (i.e., don't use a ramdisk from 0.4.0 with 0.5.0.  0.5.0
65should work for 0.5.3 though)
66
67
68BUILDING with HVM Support
69=========================
70
71If you'd like to build and run this with hardware virtual machine assist
72(HVM) support to test fully virtualized disk images on VMX/SVM hardware,
73please add the --enable-hvm-support option to configure:
74
75  # ./autogen
76  # ./configure --enable-hvm-support
77  # make
78
79The ramdisk/bin/create_disk_image script, which builds the full virt
80disk.img, requires Lilo 22.7+ to be installed on the system. Lilo is
81used to install the bootloader on the disk.img.
82
83If HVM support is enabled, the ramdisk/bin/create_disk_image script
84will be run to create a full virt disk.img in the ramdisk directory. The
85script, by default, will look in /boot for the first non-Xen kernel it
86runs across. If you'd like to set xm-test to use a specific kernel,
87rather than the first one it finds in /boot, you can configure it in
88with the "--with-hvm-kernel=KERNEL" option:
89 
90# ./autogen
91# ./configure --enable-hvm-support --with-hvm-kernel=KERNEL
92# make
93
94Otherwise, you can always rerun the create script using the -k option
95to use a specific kernel.
96
97The disk.img created for HVM testing must contain a pcnet32 driver for
98network tests. The ramdisk/bin/create_disk_image script will, by default,
99look in the /lib/modules directory associated with the kernel being
100used. If you'd like to specify a different location for the driver or
101want to tell the script that the driver is built into the kernel, please
102use the "--with-driver-dir=DRVDIR" configure option. If built into
103the kernel, please use the key word "builtin" with the option:
104 
105# ./autogen
106# ./configure --enable-hvm-support --with-driver-dir=builtin
107- or -
108# ./configure --enable-hvm-support --with-driver-dir=/driver/directory
109# make
110 
111Xm-test will look for disk.img in the ramdisk directory when run by
112default.
113
114
115BUILDING for ACM Security Testing
116=================================
117
118A number of tests have been added to test the access control module (ACM)
119in the Xen hypervisor and the tools for supporting ACM. Those tests are
120located in the security-acm directory. If ACM support is compiled into Xen
121(see the user guide for how to do this) those tests can be run with the
122following command from the xm-test directory
123
124./runtest.sh [...] -g security <report>
125
126Some of these tests will work even without support of ACM by Xen.
127
128The xm test suite has been extended to support labeling of resources
129as required by the existing tests. However, by default the test suite
130is not allowed to automatically label resources since this may affect
131existing labels. To enable this, the test suite must be configured with
132the following parameter passed to the configure scripts (in addition to
133any other desired parameters)
134
135./configure --enable-full-labeling
136
137To revoke the privilege at a later time run the configure scripts without
138this parameter:
139
140./configure
141
142If a 'make' has previously been run for building the test suite, it is not
143necessary to run 'make' again just for enabling or disabling the automatic
144labeling of resources.
145
146
147Running
148=======
149
150To run the full test suite, do the following as root:
151
152   # ./runtest.sh <logfile>
153
154This will run all tests, as well as generate and submit a report at
155the end. All output files will begin with "<logfile>."
156If you wish to prevent submission of a report, add "-d" to the
157command line like this:
158
159   # ./runtest.sh -d <logfile>
160
161It may be useful to run tests without submission as above, and then
162submit the report at a later time.  To do so, run runtest.sh with the
163-s flag and the name of the previously-generated report:
164
165   # ./runtest.sh -s <logfile>
166
167Group test sets are supported in xm-test. This is form of layering of
168tests groups/cases/tests. In the framework directory "grouptest",
169files exist for group processing. The user can add groups, casenames
170and test lists as required. Default group run is "grouptest/default".
171
172   # ./runtest.sh -g <groupname> <logfile>
173
174* NOTE: There is a quick set of tests in group mode, that was added to
175run certain casenames and tests, and there is a "medium" group, which is a
176medium-length run (around 20 minutes).  Neither is a substitute for the full
177xm-test test suite.
178   # ./runtest.sh -g quick <logfile>
179   # ./runtest.sh -g medium <logfile>
180
181
182
183It may be desirable to run a specific test group.  This can be
184accomplished by doing the following:
185
186   # cd tests/create
187   # TEST_VERBOSE=1 make check
188
189When developing or debugging a specific feature, a single test can be
190run to avoid having to run even a whole test group:
191
192   # cd tests/create
193   # TEST_VERBOSE=1 make check TESTS=01_create_basic_pos.test
194
195The runtest.sh script will create several files, including a .report
196file, which is the cleaned up, email-friendly report of failures.
197Additionally, the script will submit your results to the development
198team for trend analysis.  This helps us determine the level of success
199people "out there" are having with different versions of Xen.
200
201Note: you should generally run xm-test with a minimum of memory
202allocated to Dom0.  More memory available for allocation to DomUs
203means a more rigorous test.
204
205BIG FAT WARNING: The test framework assumes it is running on a
206dedicated machine.  As such, the library automatically destroys any
207running DomUs on the system to provide each test with a "clean slate".
208
209
210Testing the XML-RPC and Xen-API interfaces of xend
211==================================================
212
213The xm-test suite can be used to test xm's interface with xend using
214either XML-RPC or the Xen-API. In order to use either one of these modes,
215xm needs to be configured using its configuration file
216'/etc/xen/xm-config.xml'.
217Note: The current default configuration after a fresh install of the xen
218sources currently is to use the XML-RPC interface for communication with xend.
219
220Example content for the xm-config.xml for using the Xen-API looks as
221follows:
222
223<xm>
224  <server type='Xen-API'
225          uri='http://localhost:9363/'
226          username='me'
227          password='mypassword' />
228</xm>
229
230This configuration makes xm talk to xend using port 9363. For this to
231work, also xend needs to be configured to listen to port 9363. Therefore
232The following line must be in /etc/xen/xend-config.sxp.
233
234(xen-api-server (( 127.0.0.1:9363 none )))
235
236To communicate via the legacy XML-RPC interface, the file
237'/etc/xen/xm-config.xml' may simply have the following content or
238may be complete remove from the /etc/xen directory.
239
240<xm>
241</xm>
242
243A few tests have been written for the xm-test suite that test the
244Xen-API interface directly without relying on 'xm'. These tests can be
245found in the grouptest 'xapi' and for them to work properly, xm must have
246been configured to use the Xen-API following the instructions above. To
247run these test, the following command line can be invoked:
248
249   # ./runtest.sh -g xapi <logfile>
250
251
252
253Extending
254=========
255
256Additional tests may be added in existing groups to test additional
257cases for a given xm subcommand.  Test programs should be named
258according to the following scheme:
259       
260  XY_group_name_{pos,neg}.py
261
262Where:
263  XY        is the next number in line
264  group     is the name of the subcommand being tested
265  name      is the short name of the test
266  {pos,neg} denotes whether this is a positive or negative test case
267
268New subcommand groups should be added as directories named after the
269subcommand itself.  The "Makefile.am.template" should be copied into
270the new group directory as "Makefile.am".
271
272See the Writing_Tests_HOWTO file for more detailed information on
273adding tests to the suite.
274
275
276Developer Notes
277===============
278
279Our library provides a DomU console abstraction for automated
280execution of commands.  Please note that this is relatively fragile,
281and is intended for use only with the ramdisk built by the framework.
282Because the console experiences some occasional corruption, this
283method is not completely perfect at the moment, although the authors
284use it with relatively few problems.
285
286
287Known Issues
288============
289
290If you create a domain with a small amount of memory, under 32MBs, you
291may run into out of memory situations for the domain. There's no way
292to know the amount of memory needed by the kernel and modules used. Xm-test
293uses 64MBs as default and that should work. If there are out of memory
294issues, the default can be changed. Edit xm-test/lib/XmTestLib/XenDomain.py
295and change ParavirtDefaults and HVMDefaults "memory".
296
297There are two tests that work with small memory, 15_create_smallmem_pos.py
298and 16_create_smallmem_neg.py. The first makes sure the default 32 MBs
299limit works. The second checks a low memory fail situation. These tests
300are located in the xm-test/tests/create directory and can be easily edited
301to change the MEM value they should test. If the 32MBs test fails, the
302failure should be reported to the Xen xen-devel mailing list. The Xen
303tools use 32MBs as a lower acceptable limit for domain creation. The Xen
304mailing lists are located here:
305
306http://lists.xensource.com/
307
308
309Reporting Bugs
310==============
311
312If you find a bug in the test framework, report it to:
313
314   Dan Smith <danms@us.ibm.com>
315
316If you find a bug in a specific test case, contact the author of the
317test case first.
Note: See TracBrowser for help on using the repository browser.