Index: docs/html/dashboard-test.png ================================================================== --- docs/html/dashboard-test.png +++ docs/html/dashboard-test.png cannot compute difference between binary files Index: docs/html/dashboard.png ================================================================== --- docs/html/dashboard.png +++ docs/html/dashboard.png cannot compute difference between binary files Index: docs/html/megatest.html ================================================================== --- docs/html/megatest.html +++ docs/html/megatest.html @@ -2,12 +2,12 @@ - - + + Megatest User Manual
@@ -27,37 +27,31 @@

Sept. 20,

- +\thispagestyleempty


-2011 Matthew Welland. All rights reserved. +©2011 Matthew Welland. All rights reserved.
Megatest is free software released under the General Public License v2.0. Please see the file COPYING in the source distribution for details.
-
- -
-Email: matt@kiatoa.com. +
Email: matt@kiatoa.com.
Web: www.kiatoa.com/fossils/megatest
-
- -
-This document is believed to be acurate at the time of writing but as with any opensource project the source code itself is the final arbiter of the softwares behaviour. It is the responsibility of the end user to validate that the code will perform as they expect. The author assumes no responsibility for any inaccuracies that this document may contain. In no event will Matthew Welland be liable for direct, indirect, special, exemplary, incidental, or consequential damages resulting from any defect or omission in this document, even if advised of the possibility of such damages. +
This document is believed to be acurate at the time of writing but as with any opensource project the source code itself is the reference. It is the responsibility of the end user to validate that the code will perform as they expect. The author assumes no responsibility for any inaccuracies that this document may contain. In no event will Matthew Welland be liable for direct, indirect, special, exemplary, incidental, or consequential damages resulting from any defect or omission in this document, even if advised of the possibility of such damages.
-This document is a snapshot in time and the Megatest software has likely been changed since publication. This document and the product that it describes may be improved at any time, without notice or obligation. +This document is a snapshot in time and Megatest software has likely changed since publication. This document and Megatest may be improved at any time, without notice or obligation.


@@ -70,48 +64,48 @@
- - - - - - - -
+ Version + Author + Description + Date
+ v1.25 + matt + converted to new document template -
- -
- +
+\thedate
+
+


+

Table of Contents
- - - - - - - - - - - +Section 4: Choose Flow or Unstructured Run? +
+ + + + + + + + + + + + + + + + + +
+


@@ -281,26 +302,26 @@

1.1 Megatest design philosophy

-Megatest is intended to provide the minimum needed resources to make writing a suite of tests for software, design engineering or process control (via owlfs for example) without being specialized for any specific problem space. Megatest in of itself does not know what constitutes a PASS or FAIL of a test. In most cases megatest is best used in conjunction with logpro or a similar tool to parse, analyze and decide on the test outcome. A call to megatest can then be made to record the result. +Megatest is intended to provide the minimum needed resources to make writing a suite of tests and implementing continuous build for software, design engineering or process control (via owlfs for example) without being specialized for any specific problem space. Megatest in of itself does not know what constitutes a PASS or FAIL of a test. In most cases megatest is best used in conjunction with logpro or a similar tool to parse, analyze and decide on the test outcome.

1.2 Megatest architecture

-All data to specify the tests and configure the system is stored in plain text files. All system state is stored in an sqlite3 database. Tests are launched using the launching system available for the distributed compute platform in use. A template script is provided which can launch jobs on local and remote Linux hosts. Currently megatest uses the network filesystem to “call home” to your master sqlite3 database. +All data to specify the tests and configure the system is stored in plain text files. All system state is stored in an sqlite3 database. Tests are launched using the launching system available for the distributed compute platform in use. A template script is provided which can launch jobs on local and remote Linux hosts. Currently megatest uses the network filesystem to “call home” to your master sqlite3 database.

2 Installation

2.1 Dependencies

-Chicken scheme and a number of “eggs” are required for building megatest. See the file utils/installall.sh for an automated way to install the dependencies on Linux. +Chicken scheme and a number of “eggs” are required for building megatest. See the file utils/installall.sh for an automated way to install the dependencies on Linux.

2.2 Build and Install

@@ -408,14 +429,20 @@

-4 How to Write Tests +4 Choose Flow or Unstructured Run? +

+
+A flow is a structured and specifically sequenced set of tests. See the Flows chapter to understand the difference. +
+

+5 How to Write Tests

-4.1 A Simple Test with one Step +5.1 A Simple Test with one Step

mkdir simpletest
 cd simpletest
@@ -422,11 +449,11 @@
 

-4.2 Create your testconfig file +5.2 Create your testconfig file

# testconfig
 ​
@@ -435,11 +462,11 @@
 

-4.3 Create the main.csh script +5.3 Create the main.csh script

Note: Using csh is NOT recommended. Use bash, perl, ruby, zsh or anything other than csh. We use csh here because it is popular in the EDA industry for which Megatest was originally created.
@@ -462,11 +489,11 @@
You can now run megatest and the created test directory will contain the new files “run_simulation.html” and “run_simulation.log”. If you are using the dashboard you can click on the run and then push the “View log” button to view the log file in firefox.

-4.4 Simple Test with Multiple Steps +5.4 Simple Test with Multiple Steps

To run multiple steps simply add them to the main.csh file. Here we add a step to test “cpu2”. The second step that tests cpu2 will only run after the step that tested “cpu1” completes.
@@ -484,14 +511,14 @@

-5 Simple Test with Multiple Steps, Some in Parallel +6 Simple Test with Multiple Steps, Some in Parallel

-5.1 The Makefile +6.1 The Makefile

A good way to run steps in parallel within a single test, especially when there are following steps, is to use the Unix Make utility. Writing Makefiles is beyond the scope of this document but here is a minimal example that will run “runsim cpu1” and “runsim cpu2” in parallel. For more information on make try “info make” at the Linux command prompt.
@@ -506,11 +533,11 @@

-5.2 The main.csh file +6.2 The main.csh file

#!/bin/tcsh -x
 ​
@@ -525,17 +552,17 @@
 

-6 Simple Test with Iteration +7 Simple Test with Iteration

Since no jobs run after the cpu1 and cpu2 simulations in this test it is possible to use iterated mode.

-6.1 Update your testconfig file for iteration +7.1 Update your testconfig file for iteration

[setup]
 runscript main.csh
@@ -548,11 +575,11 @@
 

-6.2 Rewrite your main.csh for iteration +7.2 Rewrite your main.csh for iteration

#!/bin/tcsh -x
 
@@ -567,11 +594,11 @@
 

-6.3 Tests with Inter-test dependencies +7.3 Tests with Inter-test dependencies

Sometimes a test depends on the output from a previous test or it may not make sense to run a test is another test does not complete with status “PASS”. In either of these scenarios you can use the “waiton” keyword in your testconfig file to indicate that this test must wait on one or more tests to complete before being launched. In this example there is no point in running the “system” test if the “cpu” and “mem” tests either do not complete or complete but with status “FAIL”.
@@ -583,11 +610,11 @@

-6.4 Rolling up Miscellaneous Data +7.4 Rolling up Miscellaneous Data

Use the -load-test-data switch to roll up arbitrary data from a test into the test_data table.
@@ -626,11 +653,11 @@ If status is specified its value overrides the above calculations.

-6.5 Rolling up Runs +7.5 Rolling up Runs

To roll up a number of tests in a sequence of runs to a single run use the -rollup command.
@@ -642,32 +669,32 @@
All keys must be specified and the runname is the name of the run that will be created. All paths are kept original inside the database. When -remove-runs is used to delete runs the data is not deleted if there are rollups that refer to the data.

-7 Dashboard +8 Dashboard

> dashboard &
 
-figure dashboard.png +figure dashboard.png
Pushing one of the buttons on the main dashboard will bring up the test specific dashboard. Values are updated in semi-real time as the test runs.
-figure dashboard-test.png +figure dashboard-test.png

-8 Generating an OpenDocument Spreadsheet from the Database +9 Generating an OpenDocument Spreadsheet from the Database

And OpenDocument multi-paned spreadsheet can be generated from the megatest.db file by running -extract-ods
@@ -679,17 +706,82 @@
You can optionally specify the keys for your database to limit further the runs to extract into the spreadsheet. The first sheet contains all the run data and subsequent sheets contain data rolled up for the individual tests.

-9 Reference +10 Flows +

+
+A flow specifies the tests to run, the order and dependencies and is managed by a running megatest process. +
+

+11 Flow Specification and Running (Not released yet) +

+

+11.1 Write your flow file +

+
+flows/<flowname>.config +
+
+
+
# Flow: <flowname>
+[flowconfig]
+# turn on item level dependencies
+itemdeps on
+​
+[flowsteps]
+# <testname>[,<predecessor>]
+​
+# Run the test "copydata"
+copydata
+​
+# Run the test "setup" after copydata completes with PASS, WARN or WAIVE
+setup,copydata
+​
+# once the test "setup" completes successfully run sim1, sim2 and sim3
+sim1,setup
+sim2,setup
+sim3,setup
+
+
+ +
+

+11.2 Run the flow +

+
+
+
megatest -runflow <flowname> :FIELD1 val1 :FIELD2 val2 :runname wk32.4
+
+
+ +
+

+12 Monitor based running +

+

+12.1 Monitor logic +

+
+Note: The monitor is usable but incomplete as of Megatest v1.31. Click on the “Monitor” button on the dashboard to start the monitor and give it a try. +
+
+figure monitor-state-diagram.png + +
+

+13 Reference

-9.1 Configuration file Syntax +13.1 Configuration file Syntax

+
+Note: whitespace is preserved including at the end of line. Ensure your entries only have whitespace at the end of line when needed to avoid problems. +

-9.1.1 Sections +13.1.1 Sections

[section name]
 
@@ -698,11 +790,11 @@
This creates a section named “section name”

-9.1.2 Variables +13.1.2 Variables

VARX has this value
 
@@ -711,11 +803,11 @@
The variable “VARX” will have the value “has this value”

-9.1.3 Includes +13.1.3 Includes

[include filename]
 
@@ -724,11 +816,11 @@
The file named “filename” will be included as if part of the calling file. NOTE: This means no section can be named “include “ (with the whitespace).

-9.1.4 Setting a variable by running a command +13.1.4 Setting a variable by running a command

VARNAME [system ls /tmp]
 
@@ -737,11 +829,11 @@
The variable “VARNAME” will get a value created by the Unix command “ls /tmp”. All lines of output from the command will be joined with a space.

-9.1.5 Notes +13.1.5 Notes

  • Some variables are infered as lists. Each token on the line separated by whitespace will be member of the list.
  • @@ -749,325 +841,343 @@ Comments (lines starting with #) and blank lines are ignored.

-9.2 Environment variables +13.2 Environment variables

- - - - - - - - - - - - - - - - - -
+ Variable + Purpose
+ MT_CMDINFO + Conveys test variables to the megatest test runner.
+ MT_TEST_RUN_DIR + Directory assigned by megatest for the test to run.
+ MT_TEST_NAME + Name of the test, corrosponds to the directory name under tests.
+ MT_ITEM_INFO + Iterated tests will set this to a sequence of key/values ((KEY val) ...)
+ MT_RUN_AREA_HOME + Directory where megatest was launched from and where the tests code can be found
+ MT_RUNNAME + Name of this run as set by the :runname parameter
+ MT_MEGATEST + Path/Filename to megatest executable. Found either from called path or but using the “exectuable” keyword in the [setup] section.
+ <field1> .... + The field values as set on the megatest -runall command line (e.g. :field1 abc)

-9.3 megatest.config +13.3 megatest.config

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - -
+ section + variable + value + required + comment
+ [setup] + max_concurrent_jobs + if variable is not defined no limit on jobs + no +
+ + executable + full path to megatest binary + no + Use only if necessary, megatest will extract the location from where it used to launch and add append that to the PATH for test runs.
+ + runsdir + full path to where the link tree to all runs will be created + no + Because your runs may be spread out over several disk partitions a central link tree is created to make finding all the runs easy.
+ [fields] + string of letters, numbers and underscore + string of letters, numbers and underscore + at least one +
+ [jobtools] + launcher + command line used to launch jobs - the job command (megatest -execute) will be appended to this + no +
+ + workhosts + list of hostnames to run jobs on NOT SUPPORTED RIGHT NOW + n/a +
+[jobgroups] + +string of letters, numbers and underscore + +number + +no + +Control number of jobs allowed to concurrently run in categories. See [jobgroup] in testconfig +
+ [env-override] + string of letters, numbers and underscore + any string + no + These are set on the test launching machine, not the test running machine. Typical usage is to control the host or run queue for launching tests. These values will not be seen by the test when it runs.
+ [disks] + string of letters, numbers and underscore + a valid path writable by the test launching process and by the test process + yes + The disk usage balancing algorithm is to choose the disk with the least space for each test run.

-9.4 runconfigs.config file +13.4 runconfigs.config file

- - - - - - - - - - - - - - - @@ -1113,95 +1223,131 @@
TESTPATH /nfs/testing/megacorp_runs

-9.5 Writing tests +13.5 Writing tests

-9.5.1 testconfig file +13.5.1 testconfig file

+ section + variable + value + required? + comment
+ [default] + string of letters, numbers and underscore + any + no + variables set in this section will be available for all runs, defining the same variable in another section will override the value from the default section
+ [field1value/field2value...] + string of letters, numbers and underscore + any + no + the values in this section will be set for any run where field1 is field1value, field2 is field2value and fieldN is fieldNvalue.
- - - - - - - - - - - - - - - - + + + + + + + + - - - + + + + + + + + -
+ section + variable + value + required? + comments
+ [setup] + runscript + name of script to execute for this test + yes + The script must be executable and either provide the full path or put a copy at the top of your test directory
+ [requirements] + waiton + list of valid test names + no + This test will not run until the named tests are state completed and status PASS
+ + + +jobgroup + + + + + + +
[items] + any valid + list of values + +no + +The test will be repeated once for each item with the variable name set to the value. If there is more than one variable then the test will be run against all unique combinations of the values +
+[eztests] + +any valid + +stepname command + no -The test will be repeated once for each item with the variable name set to the value. If there is more than one variable then the test will be run against all unique combinations of the values + +Use in addition to or instead of runscript for easy implementation of steps. If <stepname>.logpro exists it will be applied to the <stepname>.log and resulting exit code will be used to determine PASS/FAIL/WARN

-9.5.2 Command line +13.5.2 Command line

- @@ -1223,11 +1369,11 @@ -h - @@ -1238,11 +1384,11 @@ -runall - @@ -1253,11 +1399,11 @@ -runtests - @@ -1268,11 +1414,11 @@ -step - @@ -1283,11 +1429,11 @@ -test-status - @@ -1298,11 +1444,11 @@ -setlog - @@ -1313,11 +1459,11 @@ -set-toplog - @@ -1326,13 +1472,13 @@ - @@ -1343,11 +1489,11 @@ :runname - @@ -1358,15 +1504,15 @@ :state - - - @@ -1403,11 +1549,11 @@ -testpatt - @@ -1418,11 +1564,11 @@ -itempatt - @@ -1433,11 +1579,11 @@ -showkeys - @@ -1448,15 +1594,15 @@ -force - - @@ -1478,11 +1624,11 @@ -remove-runs - @@ -1493,11 +1639,11 @@ Test helpers - @@ -1508,11 +1654,11 @@ -runstep - @@ -1523,12 +1669,12 @@ -logpro - @@ -1536,18 +1682,18 @@
@@ -1208,11 +1354,11 @@ switch or param parameter + purpose comments + brief help + run all tests test1,test2,... + run one or more tests stepname + record a step requires :state and :status + record the test status requires :state and :status logfilename + set the logfile name for a test path is assumed to be relative to the test run directory logfilename + set the logfile name for the top test in an iterated test run each sub test can have its own logfile set
-m -“comment” +“comment” + sets a comment for the step, test or run [a-zA-Z0-9_-]+ + directory in which this run will be stored in the test run area any value + Set the step or test state, this is stored in the state field in the steps or tests table respectively -For tests Megatest recognises “INCOMPLETE”, “COMPLETE” +For tests Megatest recognises “INCOMPLETE”, “COMPLETE”
@@ -1373,15 +1519,15 @@ :status any value + Set the step or test status, this is stored in the status field in the steps or tests table respectively -For tests Megatest recognises “PASS”, “FAIL”, and “CHECK” +For tests Megatest recognises “PASS”, “FAIL”, and “CHECK”
@@ -1388,11 +1534,11 @@ -list-runs any value, % is wildcard + Respects -itempatt and -testpatt for filters any value, % is wildcard + any value, % is wildcard + + Print the keys being used for this database -Test will not re-run if in the “PASS”, “CHECK” or “KILLED”, using -force will force the run to be launched. + +Test will not re-run if in the “PASS”, “CHECK” or “KILLED”, using -force will force the run to be launched. -WARNING: The -force switch will bypass any “waiton” dependencies. +WARNING: The -force switch will bypass any “waiton” dependencies.
@@ -1463,11 +1609,11 @@ -xterm + Launch an xterm instead of run the test. The xterm will have the environment that the test would see. + Remove a run, test or subtest from the database and the disk. Cannot be undone. Requires -testpatt, -itempatt, :runname and all keys be specified. + + Used inside a test to run a step, record the start and end of the step and optionally analyze the output using logpro. -If using logpro to asses the PASS/FAIL status of the step you specify the logpro file with this parameter. + +If using logpro to acess the PASS/FAIL status of the step you specify the logpro file with this parameter.

-A Data +A Data

-B References +B References

ADDED docs/html/monitor-state-diagram.png Index: docs/html/monitor-state-diagram.png ================================================================== --- /dev/null +++ docs/html/monitor-state-diagram.png cannot compute difference between binary files