[setup] # this will automatically kill the test if it runs for more than 1h 2m and 3s runtimelim 1h 2m 3s+
This runs script to-run.sh after all tests have been completed. It is +not necessary to use -run-wait as each test will check for other +running tests on completion and if there are none it will call the +post run hook.
Note that the output from the script call will be placed in a log file +in the logs directory with a file name derived by replacing / with _ +in post-hook-<target>-<runname>.log.
[runs] +post-hook /path/to/script/to-run.sh+
The tests browser (see the Run Control tab on the dashboard) has two views for displaying the tests.
Ezsteps is the recommended way to implement tests and automation in +Megatest.
+ + | +Each ezstep must be a single line. Use the [scripts] mechanism +to create multiline scripts (see example below). | +
[ezsteps] lookittmp ls /tmp @@ -3258,20 +3284,76 @@ [logpro] lookittmp ;; Note: config file format supports multi-line entries where leading whitespace is removed from each line ;; a blank line indicates the end of the block of text (expect:required in "LogFileBody" > 0 "A file name that should never exist!" #/This is a awfully stupid file name that should never be found in the temp dir/)
To transfer the environment to the next step you can do the following:
Turn on ezpropvars and environment variables will be propagated from +step to step. Use this to source script files that modify the +envionment where the modifications are needed in subsequent steps.
+ + | +aliases and variables with strange whitespace or characters will +not propagate correctly. Put in a ticket on the +http://www.kiatoa.com/fossils/megatest site if you need support for a +specific strange character combination. | +
[setup] +ezpropvars sh+
[ezsteps] +loadenv.csh source $REF/ourenviron.csh +compile make +install make install+
Bash and csh are supported. You can override the shell binary location +from the default /bin/bash and /bin/csh if needed.
[setup] +ezpropvars csh /bin/csh+
[ezsteps] +step1.sh export SOMEVAR=$(ps -def | wc -l);ls /tmp +# The next step will get the value of $SOMEVAR from step1.sh +step2.sh echo $SOMEVAR+
$MT_MEGATEST -env2file .ezsteps/${stepname}+
[scripts] +tarresults tar cfvz $DEST/srcdir1.tar.gz srcdir1 + tar cfvz $DEST/srcdir2.tar.gz srcdir2 + +[setup] +ezpropvars sh + +[ezsteps] +step1 DEST=/tmp/targz;source tarresults
The above example will result in files; tarresults and ez_step1 being +created in the test dir.