Index: .mtutil.scm
==================================================================
--- .mtutil.scm
+++ .mtutil.scm
@@ -1,5 +1,21 @@
+;; Copyright 2006-2017, Matthew Welland.
+;;
+;; This file is part of Megatest.
+;;
+;; Megatest is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Megatest is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with Megatest. If not, see
-
-
-Version - | --Author - | --Description - | --Date - | - -
-v1.25 - | --matt - | --converted to new document template - | --\thedate - | - -
-
-
# Fields are the keys under which your test runs are organized -[fields] -field1 TEXT -field2 TEXT - -[jobtools] -# The launcher launches jobs to the local or remote hosts, -# the job is managed on the target host by megatest, -# comment out launcher to run local only. An example launcher -# "nbfake" can be found in the utils directory. -launcher nbfake - -# The disks section specifies where the tests will be run. As you -# run out of space in a partition you can add additional disks -# entries. -# Format is: -# name /path/to/area -[disks] -disk1 /tmp --
# runconfigs.config --
mt -|-- megatest.config -|-- runconfigs.config -‘-- tests - ‘-- mytest - |-- main.sh - ‘-- testconfig --
[setup] -runscript main.sh --
#!/bin/bash - -$MT_MEGATEST -runstep mystep1 "sleep 20;echo Done" -m "mystep1 is done" -$MT_MEGATEST -test-status :state COMPLETED :status PASS -m "This is a comment" --
megatest :field1 abc :field2 def :runname 2011week08.4a -runall - -watch megatest -list-runs % - -# OR use the dashboard - -dashboard & --
mkdir simpletest -cd simpletest --
# testconfig - -[setup] -runscript main.csh --
#!/bin/tcsh -x - -# run the cpu1 simulation. -# The step name is "run_simulation" -# The commandline being run for this step is "runsim cpu1" -# The logpro file to validate the output from the run is "runsim.logpro" - -$MT_MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim cpu1" -$MT_MEGATEST -test-status :state COMPLETED :status $? --
#!/bin/tcsh -x - -# run the cpu1 simulation. -# The step name is "run_simulation" -# The commandline being run for this step is "runsim cpu1" -# The logpro file to validate the output from the run is "runsim.logpro" - -$MT_MEGATEST -runstep run_simulation_cpu1 -logpro runsim.logpro "runsim cpu1" && \ -$MT_MEGATEST -runstep run_simulation_cpu2 -logpro runsim.logpro "runsim cpu2" -$MT_MEGATEST -test-status :state COMPLETED :status $? --
# Example Makefile to run two steps in parallel - -RTLDIR=/path/to/rtl -CPUS = cpu1 cpu2 - -run_simulation_$(CPUS).html : $(RTLDIR)/$(CPUS) - $(MT_MEGATEST) -runstep run_simulation_$(CPUS) -logpro runsim.logpro "runsim $(CPUS) --
#!/bin/tcsh -x - -# run the cpu1 and cpu2 simulations in parallel. -# The -j parameter tells make how many jobs it may run in parallel - ---make -j 2 -- -$MT_MEGATEST -test-status :state COMPLETED :status $? -
[setup] -runscript main.csh --- -- -[items] -CPU cpu1 cpu2 -
#!/bin/tcsh -x - -# run the cpu simulation but now use the environment variable $CPU -# to select what cpu to run the simulation against - -$MT_MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim $CPU" -# As of version 1.07 Megatest automatically converts a status of "0" -# to "PASS", any other number to "FAIL" and directly uses the value of -# a string passed in. -$MT_MEGATEST -test-status :state COMPLETED :status $? --
# testconfig for the "system" test -[setup] -runscript main.csh -waiton cpu mem --
# Fields are: -# category,variable,value,expected,tol,units,comment,status - -$MT_MEGATEST -load-test-data << EOF -foo,bar,1.2,1.9,> -foo,rab,1.0e9,10e9,1e9 -foo,bla,1.2,1.9,< -foo,bal,1.2,1.2,<,,Check for overload -foo,alb,1.2,1.2,<=,Amps,This is the high power circuit test -foo,abl,1.2,1.3,0.1 -foo,bra,1.2,pass,silly stuff -faz,bar,10,8mA,,,"this is a comment" -EOF --
megatest -rollup :sysname ubuntu :fsname nfs :datapath none :runname rollup_ww38 --
> dashboard & --
megatest -extract-ods results.ods :runname % --
megatest -test-paths -target %/%/% :runname % -testpatt % -itempatt % :status PASS --
# 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 --
megatest -runflow <flowname> :FIELD1 val1 :FIELD2 val2 :runname wk32.4 --
[section name] --
VARX has this value --
[include filename] --
VARNAME [system ls /tmp] --
-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) - | - -
-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. - | - -
-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. - | - -
# runconfigs.config -[default] -ENCRYTION true - -[megacorp/india] -TESTPATH /nfs/testing/megacorp_runs - -[femtocorp/cook_islands] -ENCRYTION false -TESTPATH /afs/kiatoa/testing/cook_islands - -[femtocorp/new_zealand] -TESTPATH /afs/kiatoa/testing/new_zealand - -[megacorp/new_zealand] -TESTPATH /nfs/testing/megacorp_runs --
-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 - | --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 - | - -
-switch or param - | --parameter - | --purpose - | --comments - | - -
--h - | -- - | --brief help - | -- - | - -
--runall - | -- - | --run all tests - | -- - | - -
--runtests - | --test1,test2,... - | --run one or more tests - | -- - | - -
--step - | --stepname - | --record a step - | --requires :state and :status - | - -
--test-status - | -- - | --record the test status - | --requires :state and :status - | - -
--setlog - | --logfilename - | --set the logfile name for a test - | --path is assumed to be relative to the test run directory - | - -
--set-toplog - | --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” - | --sets a comment for the step, test or run - | -- - | - -
-:runname - | --[a-zA-Z0-9_-]+ - | --directory in which this run will be stored in the test run area - | -- - | - -
-:state - | --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” - | - -
-: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” - | - -
--list-runs - | --any value, % is wildcard - | --Respects -itempatt and -testpatt for filters - | -- - | - -
--testpatt - | --any value, % is wildcard - | -- - | -- - | - -
--itempatt - | --any value, % is wildcard - | -- - | -- - | - -
--showkeys - | -- - | --Print the keys being used for this database - | -- - | - -
--force - | -- - | --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. - | - -
--xterm - | -- - | --Launch an xterm instead of run the test. The xterm will have the environment that the test would see. - | -- - | - -
--remove-runs - | -- - | --Remove a run, test or subtest from the database and the disk. Cannot be undone. Requires -testpatt, -itempatt, :runname and all keys be specified. - | -- - | - -
-Test helpers - | -- - | -- - | -- - | - -
--runstep - | -- - | --Used inside a test to run a step, record the start and end of the step and optionally analyze the output using logpro. - | -- - | - -
--logpro - | -- - | --If using logpro to acess the PASS/FAIL status of the step you specify the logpro file with this parameter. - | -- - | - -
This book is organised as three sub-books; getting started, writing tests and reference.
This document is part of Megatest. +Copyright 2006-2017, Matthew Welland. + + This document is part of Megatest. Megatest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -884,11 +886,11 @@
Note 1: This road-map is still evolving and subject to change without notice.
Note 1: This road-map continues to evolve and subject to change without notice.
Purpose: allow shrinking megatest.db data by moving runs to an alternate Megatest area with same keys.
Method: extend db sync to take a different megatest area as a destination.