MIN Test Framework User's Guide


Next: , Previous: (dir), Up: (dir)

General Introduction

This page documents MIN Test Framework

Copyright © 2008 Nokia

Document Version 1.3

Online copy of this document (recent): http://min.sourceforge.net/doc/min.html

Documentation download page: https://garage.maemo.org/docman/?group_id=853

Project home page: http://garage.maemo.org/projects/min/


Next: , Previous: Top, Up: Top

Short Contents

Table of Contents


Next: , Previous: Table of contents, Up: Top

Document Version History

Version Date Status Comments
1.0 17.12.2008 Draft Initial draft
1.1 20.01.2009 Draft Added chapter describing C++ modules
1.2 01.02.2009 Draft TeXinfo version draft
1.3 24.02.2009 Draft Complete TeXinfo version


Next: , Previous: Document Version, Up: Top

1 Document control


Next: , Previous: Document control, Up: Document control

1.1 Documentation conventions

Code, commandline input and output is written with the fixed-width font.


Next: , Previous: Documentation conventions, Up: Document control

1.2 Abbreviations and definitions

DLL
Dynamic Link Library
CUI
Console User Interface
IPC
Inter-Process Communication, a set of techniques for the exchange of data among two or more processes.
MIN Console UI
The Console application of MIN Test Framework.
MIN Logger
A utility of MIN Test Framework that offers logging services.
MIN Parser
A utility, which extracts information from text files.
MIN
MIN Test Framework
The name of the developed MIN Test Framework test tool.
MIN Qt
MIN Qt Graphical User Interface.
Test Case
A unique test, which either passes or fails.
Test Engine
A module of MIN Test Framework.
Test module
Contains test cases. (A test module type can be, for example, hard-coded.)
Test Module Template Wizard
A tool of MIN for automatically creating a test module template (e.g. MINUnit.)
TMC
Test Module Controller
Test Set
A collection of test cases, currently this is implemented in MIN Console UI.


Next: , Previous: Abbreviations and definitions, Up: Top

2 Introduction to MIN Test Framework

This chapter describes what the MIN Test Framework (MIN) is, and what are the program modules that MIN consist of.

MIN is a test harness for testing Linux non-UI components. This test framework can be used for both test case implementation and test cases execution.

MIN separates the actual test cases from the test case execution environment. It provides different user interfaces and a common reporting mechanism, and allows executing test cases simultaneously. This test framework contains user interfaces on the interface layer, MIN Engine on the engine layer and the test modules and tools on the test layer.

The console UI or an interface to a test automation tool can be used to start and monitor test case execution.

Test Engine is responsible for loading test modules and for executing the test cases.

Test cases are collected to separate modules, known as test modules, which are easy to implement.

MIN is not an automatic test case creator but allows you to concentrate on the actual test case implementation.


Next: , Previous: Introduction to MIN Test Framework, Up: Introduction to MIN Test Framework

2.1 MIN architecture overview

The architecture is divided into three main layers: the interface layer, the engine layer and the test layer. The arrows show the direction of the data flow.

Figure below shows an overview of the MIN architecture.

MIN architecture overview

The architecture of MIN is modular. The interface between the modules is either a function call or IPC interface. There are no cyclic dependencies between the modules. The user interface module uses MIN Engine, MIN Engine uses Test Module Controller(s) and Test Module Controller uses test module.

Main modules are listed in Table below.

Module Type Multiplicity Implementation
User Interface Executable One Executable
EXT interface Executable One Executable
Engine Library One Static linked library
Test Module Controller Library Several instances Executable
Test Modules Library Several separate libraries and several instances Library (.so)

The MIN modules on the interface layer are described in Section MIN modules on the interface layer. The MIN Engine module on the engine layer is described in Section MIN module on the engine layer and the MIN modules on the test layer are described in Section MIN modules on the test layer.


Next: , Previous: MIN architecture overview, Up: Introduction to MIN Test Framework

2.2 MIN modules on the interface layer

Currently, three interfaces are supported in MIN:

The UI is used to start the test case execution. The UI can also show information about the test case progress to the user.

The interface modules have access to the engine functionality. There exists several asynchronous functions in Test Engine, and therefore the user interface has to handle several ongoing asynchronous requests.

The MIN Console UI is used to manually start the test case execution.

The command line interface can be used, for example, to execute all the test cases of all configured test module(s).


Next: , Previous: MIN modules on the interface layer, Up: MIN modules on the interface layer

2.2.1 MIN Console UI

MIN Console UI is a menu-based console application, which can be used to manually execute test cases.

MIN Console UI can be seen in figure below.

MIN Menu


Next: , Previous: MIN Console UI, Up: MIN modules on the interface layer

2.2.2 MIN EXT interface

The MIN EXT interface is used to start test case execution from for example, a test automation system.


Next: , Previous: MIN EXT interface, Up: Introduction to MIN Test Framework

2.3 MIN module on the engine layer

Test Engine is the main module of MIN. It is responsible for loading test modules and for executing the test cases.


Next: , Previous: MIN module on the engine layer, Up: MIN module on the engine layer

2.3.1 Test Engine

Test Engine provides an API for user (console UI or EXT interface) for executing test cases and loading the test modules. Test Engine can load several test modules and execute different test cases from separate test modules at the same time. Engine provides user (CUI or EXT - in the following chapter, both will be referred to as User) with functionalities for control of test execution and test result collection.

Engine and User interface run in same process, divided into threads servicing user's requests and commands, and communication with "test module" layer of the system. This process also spawns, by means of fork( ) system call, new processes for each needed Test Module Controller. Later on, it controls those processes and communicates with them, to facilitate test execution and result reception.

Main interface for communication between Engine and Test Module Controller processes is POSIX message queue. One thread in Engine is polling queue continuously for messages addressed to engine (from Test Module Controllers). Functions that send messages to queue run also in other Engine's thread, enabling control of test execution by User.

Communication with User is realized by function interface, since physically engine is statically linked library, compiled into one executable with User interface.

Test Engine uses the initialization file of MIN for its initial parameters. This initialization file also contains a preloading list of the test modules that are used to automatically load and initialize the test modules on the MIN startup.

Test Engine generates its own test report that can be used to analyze the test case progress after the test cases have been executed. Test Engine also creates a log file that contains detailed information about the operations that are performed in a MIN Engine.

Test Engine keeps a list of test modules, as well as a list of available test cases from the modules. There is also data for every run of each test case, to facilitate test results logging/display and report generation.


Next: , Previous: Test Engine, Up: Introduction to MIN Test Framework

2.4 MIN modules on the test layer

The test layer consists of the following modules:

Figure below shows how the MIN test layer modules are placed in the MIN architecture.

MIN Module


Next: , Previous: MIN modules on the test layer, Up: MIN modules on the test layer

2.4.1 Test Module controller

For each test case, there exists one Test Module Controller that gets requests from MIN Engine and either handles the requests itself or calls the corresponding function from the test module. For example, a request to execute a test case causes a function call to the test module and a request to stop the test case is handled inside Test Module Controller.


Next: , Previous: Test Module controller, Up: MIN modules on the test layer

2.4.2 Test module

Test cases are collected to separate modules, known as test modules.

The test module is a library, which implements the MIN Test Module API. The most important function in that interface is int tm_run_test_case( unsigned int id, const char *cfg_file, TestCaseResult *result), which executes the test case and returns the test case result.

The MIN services interface from the test module to MIN provides synchronous operations for the test module. For example, printing from the test module is implemented inside a synchronous function that causes a synchronous request to be completed inside Test Module Controller.

Currently, three different test module types are supported in MIN:

MIN Test Module Template Wizard provides test module templates for test module creation. The possible test module template types of MIN are:


Next: , Previous: Test module, Up: Test module
2.4.2.1 Hardcoded test module

There is a test module template for Hardcoded module (min/TestModuleTemplates/ HardCodedTestModuleXXX). It contains some ready made test cases for MIN try-out purposes.

Figure below shows how Hardcoded test modules are situated in MIN.

MIN Hardcoded Module


Next: , Previous: Hardcoded test module, Up: Test module
2.4.2.2 Normal test module

When using the normal test module template type, an empty test module is created. Test cases for a normal type of test module can be freely implemented, and this template enables the implementing of unique type of test cases and the use of old test cases as the basis. Figue below shows where the normal test module is situated in MIN. The normal test module and its test case file are with italic font in the figure.

MIN Normal Module


Next: , Previous: Normal test module, Up: Test module
2.4.2.3 MINUnit test module

The MINUnit test module differs from Hardcoded test module mainly in the syntax of test case definition. MINUnit is an implementation of XUnit testing framework (see http://en.wikipedia.org/wiki/XUnit). The MINUnit test module supports assert macros as well as test fixtures setup and cleanup. See MIN Reference Guide for instructions on how to create a test case for MINUnit test module.

Figure below shows where the MINUnit test module is situated in MIN.

MINUnit Module


Next: , Previous: MINUnit test module, Up: MIN modules on the test layer

2.4.3 MIN Parser

MIN Parser can be used when there is a need to parse a test module's test case files or a test module's initialization files. By providing a common parser in MIN, it can obtain better control of the test case behavior. For more information on MIN Parser, see Using MIN Parser for test data parsing.


Next: , Previous: MIN Parser, Up: MIN modules on the test layer

2.4.4 MIN Logger

The purpose of MIN Logger is to get information from the modules in order to write different log files or to send information to another data store via, for example, Bluetooth. By offering a common logger in MIN, logging can be controlled.

Test modules can also use their own logging mechanisms, but it is preferred that the new test code use MIN Logger.

For more information about MIN Logger, see Using MIN Logger for logging purposes.


Next: , Previous: MIN Logger, Up: MIN modules on the test layer

2.4.5 MIN Event System

MIN Event System enables synchronization between the test cases/modules through convenient interface. The MIN Event System has two types of events: state events and indication events. State events are used to indicate that some state is active / inactive. Test process can set and unset a state event. Indication events are used to indicate that some event happened; an indication event can only be set.

MIN Event System can be used to synchronize test case execution. The high-level part of MIN Event System is implemented inside Test Engine and the low-level part inside Test Module Controller.

For more information about MIN Event System, see Using MIN Event System for test cases synchronization.


Next: , Previous: MIN Event System, Up: MIN modules on the test layer

2.4.6 MIN Text interface

MIN provides generic Text interface to manipulate strings without knowledge about the amount of memory needed to store particular string. Text interface will grow or shrink, depending on situation.

For more details check Min Text interface.


Next: , Previous: MIN Text interface, Up: Introduction to MIN Test Framework

2.5 MIN features

The following features are currently supported:


Next: , Previous: MIN features, Up: Top

3 Setting up MIN

This chapter describes how MIN can be taken into use.


Next: , Previous: Setting up MIN, Up: Setting up MIN

3.1 Building MIN

Unzip the MIN package.
$ unzip MIN<year>w<week>.zip
Go to the package newly created directory.
$ cd MIN<year>w<week>/min
To build MIN, type:
$ sh build.sh
To Install MIN, type:
$ sudo make install
After these steps you should have MIN and tmc binaries in the /usr/bin directory and a default min.conf in /etc.

To start MIN, type:
$ min (uses the default min.conf from /etc)

When starting MIN, the tool searches min.conf file from following locations:

  1. Current working directory
  2. /home/<user name>/.min
  3. /etc

Use Test Module Wizard to generate new Test Module, as instructed in Creating test module templates. When building generated module, it is automatically added to ~/.min/min.conf file.


Next: , Previous: Building MIN, Up: Setting up MIN

3.2 Creating MIN Debian packages

MIN release includes metadata for creating Debian packages. The min and min-dev packages can be created with dpkg-buildpackage in the release min/ directory.
$ cd tags/<YYYY>w<WW>
$ dpkg-buildpackage -rfakeroot

After running the command, min and min-dev packages should appear in the parent directory.
$ ls ../*.deb
../min_2008w50_i386.deb ../min-dev_2008w50_i386.deb

The MIN package install binaries (to /usr/bin), and a demo test library (to /usr/lib/min). The min-dev package contains Test Module Wizard and header and libraries needed to build MIN test modules.

After installing MIN package there should be min and tmc binaries in /usr/bin directory and a default min.conf in /etc/.


Next: , Previous: Creating MIN Debian packages, Up: Creating MIN Debian packages

3.2.1 Hardware builds

The recommended way is to create a debian package in Scratchbox and install it to hardware.

Alternatively MIN must be compiled in Scratchbox and following binaries have to be copied into the hardware:

Note: The location of these files must match the paths in min.conf file.


Next: , Previous: Hardware builds, Up: Setting up MIN

3.3 Configuring MIN via the MIN Test Framework initialization file

MIN has an initialization file that is used to set the MIN functionality. Currently initialization file contains paths for searching test modules and configuration files, defaults for MIN logger and the used test modules.

An example of the initialization file is shown below.

     [Engine_Defaults]
     ModSearchPath=/usr/lib/min
     ModSearchPath=$HOME/.min
     Debugger=gdbtui
     [End_Defaults]
     
     [New_Module]
     ModuleName=/home/user/.min/exampleModule.so
     TestCaseFile=/home/user/.min/Example.cfg
     [End_Module]
     
     [New_Module]
     ModuleName=example2
     [End_Module]
     
     [Logger_Defaults]
     EmulatorBasePath=/tmp
     EmulatorFormat=TXT
     EmulatorOutput=FILE SYSLOG
     ThreadIdToLogFile=NO
     [End_Logger_Defaults]

Table below shows the possible settings in the min.conf file.

Tag Description Optional/Required
TmcBinPath Path of TMC (absolute path, detected automatically) Optional
ModuleName Path of test library/libraries (absolute path if the module is not in a location specified in ModSearchPaths) Required
ConfigFile
TestCaseFile
A configuration / test case file where the test cases are defined.
There can be several configuration / test case files for one test module
Optional
Debugger Debugger used for test case debugging.
Defaults to gdb, if not specified.
Optional

Table below shows the possible logger settings in the min.conf file.

Tag Description Optional/Required
EmulatorBasePath Directory that will be used for logger output. Optional
EmulatorFormat Output format, can be either TXT or HTML. Can be also both of them. Optional
EmulatorOutput Output facility, can be NULL, FILE, SYSLOG, STDOUT or STDERR. (Note: do not use STDOUT or STDERR with consoleUI.) Optional
ThreadIdToLogFile Indicates if PID should be a part of output file name Optional
CreateLogDirectories Indicates if logger output directory should be created if not exists, possible values are YES or NO Optional
WithTimeStamp Indicates if time stamp should be added to the log messages, possible values are YES or NO Optional
WithLineBreak Indicates if line breaks should be added, possible values are YES or NO Optional
FileCreationMode File creation mode, possible values are APPEND or OVERWRITE Optional
LogLevel LogLevel value, can be one of following: Trace, Debug, Notice, Info, Warning, Error, Fatal Optional, default value is Info.


Next: , Previous: Configuring MIN via the MIN Test Framework initialization file, Up: Setting up MIN

3.4 Configuring MIN Modules through /etc/min.d directory

MIN searches for module configurations (files containing [New_Module] ... [End_Module] definitions) also from directory /etc/min.d. The idea is that if test modules are implemented for example as Debian packages, the min.conf does not need to be patched during the package (un)install.


Next: , Previous: Configuring MIN Modules through _etc_min_d directory, Up: Top

4 Using MIN for test cases execution

This chapter describes how the MIN interface modules (MIN Console UI and the MIN EXT interface) can be used for test cases execution.


Next: , Previous: Using MIN for test cases execution, Up: Using MIN for test cases execution

4.1 Working with MIN Console UI

MIN Console UI can be executed in normal text console.

Note: MIN Console UI requires the Ncurses library.

The MIN Console UI application provides a simple way to show test cases to the tester. It also shows to the tester the progress of ongoing test cases and the results of the executed test cases.

MIN Console UI is a menu-based application. Navigation in the menu is perfomed with arrow keys. In addition to “right arrow” key the “return” can be used for selecting items.


Next: , Previous: Working with MIN Console UI, Up: Working with MIN Console UI

4.1.1 Startup parameters

MIN has several command line parameters.

–version, -v
prints version information.
–help, -h
prints help screen with usage description.
–console, -c
starts MIN without the console UI. All test cases defined in min.conf are executed sequentially (unless specified with -x and/or -t switch)
–debug, -d
Attach a debugger to test case(s). Note: Implies -c.
–info, -i
print info about given test module.
–execute, -x
loads MIN with given test module (and optional configuration file(s)
–title, -t
loads only test cases matching the given title
–title-regex, -r
loads only test cases with title matching the given regular expression
–slave, -s
registers slave device (with optional slave type), that can then be used in master/slave test cases
–plugin, -p
loads the given input plugin for MIN. The default plugins are “cli” for commandline use and “cui” for consoleUI.


Next: , Previous: Startup parameters, Up: Working with MIN Console UI

4.1.2 Test module identification

All test module templates have their version and type compiled-in. It is possible, by using a command line switch, to have that data printed on the screen.

     $ min --info .min/mutestmodule.so
     Module Type:	Module Version:		Build date:
     MINUnit    	200830			Jun 16 2009 14:48:21
     Cases:
     mutestmodule_1
     mutestmodule_2

Similar information can be also seen from the syslog output when the module is loaded

Jun 16 14:48:54 ubuntu [24392]: INFO MIN 024392 tllib.c:0213:tl_open() Module: MINUnit, Version: 200830, Build: Jun 16 2009 14:48:21


Next: , Previous: Test module identification, Up: Working with MIN Console UI

4.1.3 Starting MIN Console UI

To start the MIN Console UI from the command line, type (note that MIN have to be installed):

     min

When starting MIN, it searches min.conf file from following locations:

  1. Current working directory
  2. /home/<user name>/.min
  3. /etc


Next: , Previous: Starting MIN Console UI, Up: Working with MIN Console UI

4.1.4 Menu navigation

All menus are lists where pressing the Arrow down key changes the position down by one menu item and the Arrow up key changes the position up by one item. If the end of the list is reached, the position is changed to the beginning of the list, and vice versa.

A menu item is selected using the Arrow right key.

The Arrow left key is used to navigate back to the previous menu.

Selecting Exit in the main menu closes MIN Console UI.


Next: , Previous: Menu navigation, Up: Working with MIN Console UI

4.1.5 Loading a test module

To load module, which is not automatically loaded when starting MIN, go to Module menu, and choose option Add test module. List of available modules should appear, with module files in /usr/lib/min and ~/.min/ directories. When the module is selected, there will be list of test case files in the same directories, multiple files may be marked to be added, when this is ready choose Add selected test case file(s) option. Message "Module added" is shown and module along with selected test cases is ready to use.

Note: Using Add test module menu will work only for current run of Console UI, to add module permanently, use min.conf file. See Configuring MIN via the MIN Test Framework initialization file.


Next: , Previous: Loading a test module, Up: Working with MIN Console UI

4.1.6 Starting a test case

To start a single test case, go to Start new case under the Case menu and select a particular case from the list. MIN Console UI starts to execute the chosen test case. A new test case can be started while another is still executed. When several cases are executed at the same time, they are executed in separate processes.

To start multiple test cases, go to Run multiple tests under the Case menu and select/mark test cases to be executed from the list and run selected test case either sequentially or in parallel.


Next: , Previous: Starting a test case, Up: Working with MIN Console UI

4.1.7 Lists of started test cases

The Case menu offers a list of Ongoing cases, Executed cases, Passed cases, Failed cases and Aborted/Crashed cases. When selecting one of these, a list of the cases is shown on the display. The list is updated whenever the test case status is changed. For example, when a case is finished, it is moved from the Ongoing cases list to either the list of passed or failed cases, depending on the result of the test case.


Next: , Previous: Lists of started test cases, Up: Working with MIN Console UI

4.1.8 Aborting, suspending and resuming a test case

When selecting a case from the Ongoing cases list, a new menu is shown that allows aborting or to suspend the test case execution, or resume the execution in case it was suspended.


Next: , Previous: Aborting_suspending and resuming a test case, Up: Working with MIN Console UI

4.1.9 Viewing the test case output

To view the test case output, select a case from any of the case lists. A new operation-specific menu is shown. By selecting View Output, the user will see the test case output.

By pressing any key, the focus is returned to the previous menu.


Next: , Previous: Viewing the test case output, Up: Working with MIN Console UI

4.1.10 Debugging a test case

To debug a test case, go to Start case in debugger under the Case menu and select the case you want to debug from list. MIN leaves ncurses temprorarily, starts the selected test case and attaches debugger (configured in min.conf) file to the test process running the case. The execution should stop in a sleep() function just before the test function is called. Note that in order to succesfully return the execution back to MIN ConsoleUI, you should detach the debugger latest at the end of test function. The following example shows how to enter test case implemented with function test_1.

Test case is selected from Start case in debugger menu. Execution leaves console UI and enters the debugger.

     New Thread 0xb7e6e6b0 (LWP 20196)]
     Loaded symbols for /lib/tls/i686/cmov/libpthread.so.0
     0xb804d7d2 in ?? () from /lib/ld-linux.so.2

Set breakpoint to test case function.

     (gdb) b test_1
     Breakpoint 1 at 0xb8048b33: file ./src/hcCases.c, line 88.

Continue execution to break point.

     (gdb) c
     Continuing.
     [Switching to Thread 0xb7e6e6b0 (LWP 20196)]
     Breakpoint 1, test_1 (tcr=0xbfd68380) at ./src/hcCases.c:88
     88

When done with debugging detach from test process.

     (gdb) det
     Detaching from program: /usr/bin/tmc, process 20196

And quit debugger in order to return to Console UI.

     (gdb) q


Next: , Previous: Debugging a test case, Up: Working with MIN Console UI

4.1.11 Test sets

The MIN Console UI application can be used to create a test set containing a set of test cases that can be run either sequentially or in parallel. MIN Console UI supports one test set at a time, but a different test set can be loaded via Load test set menu, which specifies the test set name.

Test set controlling is handled from the Test set menu that can be found from the main menu of MIN Console UI. The Test set menu provides the possibility to create or load a test set, or to control a test set (add/remove test cases, save, remove or execute test set).

The saved test name is created using time stamp date and time for example 2008-1-23,14:52.set. The default path for test sets is /home/<username>/.min. This is the location to which test sets are saved and from which they are loaded.


Next: , Previous: Test sets, Up: Using MIN for test cases execution

4.2 Working with the MIN command line interface

MIN can execute test cases also directly from the command line. User can tell MIN not to start the console UI with --console (or -c) command line switch. If -c is the only switch MIN executes all the test cases in all the modules configured in the min.conf file. MIN can also be instructed to omit the module definitions in min.conf and execute the cases from a test module specified on the command line with switch --execute (or -x).

     $ min --console --execute /usr/lib/min/minDemoModule.so
              message from "Demo_1": this is from the Demo module
     02:34:36 Passed     /usr/lib/min/minDemoModule.so:"Demo_1" - PASSED
              message from "Demo_2": this is from case Demo_2
     02:34:41 Passed     /usr/lib/min/minDemoModule.so:"Demo_2" - PASSED

Note that it's possible to pass also one or more configuration files to the test module from command line.

In case there are printouts from test case, those are also shown.

If the -x switch is used without the -c switch the console UI is started, but only the test module specified on the command line is visible in the menus.

Similarly with switches -t and -r, only the test cases with title matching the given title or regular expression are shown.

     $ min -cr Demo_[1-2]
     message from "Demo_1": this is from the Demo module
     02:40:22 Passed     minDemoModule.so:"Demo_1" - PASSED
              message from "Demo_2": This is from case Demo_2
     02:40:28 Passed     minDemoModule.so:"Demo_2" - PASSED


Previous: Working with the MIN command line interface, Up: Top

Appendix A GNU Free Documentation License

GNU Free Documentation License
		  Version 1.2, November 2002


 Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.


0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.

This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.

We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.


1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License.  Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein.  The "Document", below,
refers to any such manual or work.  Any member of the public is a
licensee, and is addressed as "you".  You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.

A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject.  (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.)  The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.

The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.  If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant.  The Document may contain zero
Invariant Sections.  If the Document does not identify any Invariant
Sections then there are none.

The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.  A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.

A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters.  A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text.  A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification.  Examples of
transparent image formats include PNG, XCF and JPG.  Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page.  For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.

A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language.  (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.

The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document.  These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.


2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and
you may publicly display copies.


3. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.

If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.

It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.


4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it.  In addition, you must do these things in the Modified Version:

A. Use in the Title Page (and on the covers, if any) a title distinct
   from that of the Document, and from those of previous versions
   (which should, if there were any, be listed in the History section
   of the Document).  You may use the same title as a previous version
   if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
   responsible for authorship of the modifications in the Modified
   Version, together with at least five of the principal authors of the
   Document (all of its principal authors, if it has fewer than five),
   unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
   Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
   adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
   giving the public permission to use the Modified Version under the
   terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
   and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
   to it an item stating at least the title, year, new authors, and
   publisher of the Modified Version as given on the Title Page.  If
   there is no section Entitled "History" in the Document, create one
   stating the title, year, authors, and publisher of the Document as
   given on its Title Page, then add an item describing the Modified
   Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
   public access to a Transparent copy of the Document, and likewise
   the network locations given in the Document for previous versions
   it was based on.  These may be placed in the "History" section.
   You may omit a network location for a work that was published at
   least four years before the Document itself, or if the original
   publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
   Preserve the Title of the section, and preserve in the section all
   the substance and tone of each of the contributor acknowledgements
   and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
   unaltered in their text and in their titles.  Section numbers
   or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements".  Such a section
   may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
   or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.

You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.

You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.


5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications".  You must delete all sections
Entitled "Endorsements".


6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.


7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.


8. TRANSLATION

Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers.  In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.

If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.


9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License.  Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License.  However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.


10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time.  Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.  See
http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.


ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:

    Copyright (c)  YEAR  YOUR NAME.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 1.2
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
    Texts.
    A copy of the license is included in the section entitled "GNU
    Free Documentation License".

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:

    with the Invariant Sections being LIST THEIR TITLES, with the
    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.

If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.

If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.