Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -7,5 +7,7 @@ megatest dboard tests/fullrun/tmp/* tests/simpleruns tests/simplelinks +mkdeploy/runs +mkdeploy/links Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -14,12 +14,16 @@ OFILES = $(SRCFILES:%.scm=%.o) GOFILES = $(GUISRCF:%.scm=%.o) ADTLSCR=mt_laststep mt_runstep mt_ezstep HELPERS=$(addprefix $(PREFIX)/bin/,$(ADTLSCR)) -DEPLOYHELPERS=$(addprefix $(DEPLOYTARG)/,$(ADTLSCR)) +DEPLOYHELPERS=$(addprefix deploytarg/,$(ADTLSCR)) MTESTHASH=$(shell fossil info|grep checkout:| awk '{print $$2}') + +CSIPATH=$(shell which csi) +CKPATH=$(shell dirname $(shell dirname $(CSIPATH))) + all : mtest dboard newdashboard mtest: $(OFILES) megatest.o csc $(CSCOPTS) $(OFILES) megatest.o -o mtest @@ -27,15 +31,24 @@ csc $(OFILES) dashboard.scm $(GOFILES) -o dboard newdashboard : newdashboard.scm $(OFILES) csc $(OFILES) newdashboard.scm -o newdashboard -$(DEPLOYTARG)/megatest : $(OFILES) megatest.o - csc -deployed $(CSCOPTS) $(OFILES) megatest.o -o $(DEPLOYTARG)/megatest +deploytarg/libiupcd.so : $(CKPATH)/lib/libiupcd.so + for i in iup im cd av call sqlite; do \ + cp $(CKPATH)/lib/lib$$i* deploytarg/ ; \ + done + cp $(CKPATH)/include/*.h deploytarg + +# puts deployed megatest in directory "megatest" +deploytarg/megatest : $(OFILES) megatest.o + csc -deploy $(CSCOPTS) $(OFILES) megatest.scm + rsync -av megatest/ deploytarg/ -$(DEPLOYTARG)/dashboard : $(OFILES) $(GOFILES) - csc -deployed $(OFILES) $(GOFILES) -o $(DEPLOYTARG)/dashboard +deploytarg/dashboard : $(OFILES) $(GOFILES) + csc -deploy $(OFILES) $(GOFILES) dashboard.scm + rsync -av dashboard/ deploytarg/ # Special dependencies for the includes tests.o db.o launch.o runs.o dashboard-tests.o dashboard-guimonitor.o dashboard-main.o monitor.o dashboard.o megatest.o : db_records.scm tests.o runs.o dashboard.o dashboard-tests.o dashboard-main.o : run_records.scm @@ -57,10 +70,13 @@ @echo Installing to PREFIX=$(PREFIX) $(INSTALL) mtest $(PREFIX)/bin/mtest utils/mk_wrapper $(PREFIX) mtest > $(PREFIX)/bin/megatest chmod a+x $(PREFIX)/bin/megatest +$(PREFIX)/bin/newdashboard : newdashboard + $(INSTALL) newdashboard $(PREFIX)/bin/newdashboard + $(HELPERS) : utils/mt_* $(INSTALL) $< $@ chmod a+x $@ $(DEPLOYHELPERS) : utils/mt_* @@ -73,15 +89,15 @@ $(PREFIX)/bin/nbfind : utils/nbfind $(INSTALL) $< $@ chmod a+x $@ -$(DEPLOYTARG)/nbfake : utils/nbfake +deploytarg/nbfake : utils/nbfake $(INSTALL) $< $@ chmod a+x $@ -$(DEPLOYTARG)/nbfind : utils/nbfind +deploytarg/nbfind : utils/nbfind $(INSTALL) $< $@ chmod a+x $@ # install dashboard as dboard so wrapper script can be called dashboard @@ -88,13 +104,22 @@ $(PREFIX)/bin/dboard : dboard $(FILES) $(INSTALL) dboard $(PREFIX)/bin/dboard utils/mk_wrapper $(PREFIX) dboard > $(PREFIX)/bin/dashboard chmod a+x $(PREFIX)/bin/dashboard -install : bin $(PREFIX)/bin/mtest $(PREFIX)/bin/megatest $(PREFIX)/bin/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake $(PREFIX)/bin/nbfind +install : bin $(PREFIX)/bin/mtest $(PREFIX)/bin/megatest $(PREFIX)/bin/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake $(PREFIX)/bin/nbfind $(PREFIX)/bin/newdashboard + +deploytarg/apropos.so : Makefile + for i in apropos base64 canvas-draw csv-xml directory-utils dot-locking extras fmt format hostinfo http-client intarweb json md5 message-digest posix posix-extras readline regex regex-case s11n spiffy spiffy-request-vars sqlite3 srfi-1 srfi-18 srfi-69 tcp test uri-common zmq check-errors synch matchable sql-null tcp-server rpc blob-utils string-utils variable-item defstruct uri-generic sendfile opensll openssl lookup-table list-utils stack; do \ + chicken-install -prefix deploytarg -deploy $$i;done + +deploytarg/libsqlite3.so : + CSC_OPTIONS="-Ideploytarg -Ldeploytarg" $CHICKEN_INSTALL -prefix deploytarg -deploy sqlite3 + + -deploy : $(DEPLOYTARG)/megatest $(DEPLOYTARG)/dashboard $(DEPLOYHELPERS) $(DEPLOYTARG)/nbfake $(DEPLOYTARG)/nbfind +deploy : deploytarg/megatest deploytarg/dashboard $(DEPLOYHELPERS) deploytarg/nbfake deploytarg/nbfind deploytarg/libiupcd.so deploytarg/apropos.so bin : mkdir -p $(PREFIX)/bin Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -59,10 +59,11 @@ "-test" "-debug" "-host" ) (list "-h" + "-use-server" "-guimonitor" "-main" "-v" "-q" ) @@ -83,11 +84,13 @@ (if (args:get-arg "-host") (begin (set! *runremote* (string-split (args:get-arg "-host" ":"))) (client:launch)) - (client:launch)) + (if (not (args:get-arg "-use-server")) + (set! *transport-type* 'fs) ;; force fs access + (client:launch))) ;; HACK ALERT: this is a hack, please fix. (define *read-only* (not (file-read-access? (conc *toppath* "/megatest.db")))) ;; (client:setup *db*) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -260,10 +260,20 @@ (sqlite3:execute db "PRAGMA synchronous = FULL;") (debug:print-info 11 "Initialized test database " dbpath) (db:testdb-initialize db))) ;; (sqlite3:execute db "PRAGMA synchronous = 0;") (debug:print-info 11 "open-test-db END (sucessful)" testpath) + ;; now let's test that everything is correct + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: problem accessing test db " testpath ", you probably should clean and re-run this test" + ((condition-property-accessor 'exn 'message) exn)) + #f) + ;; Is there a cheaper single line operation that will check for existance of a table + ;; and raise an exception ? + (sqlite3:execute db "SELECT id FROM test_data LIMIT 1;")) db) (begin (debug:print-info 11 "open-test-db END (unsucessful)" testpath) #f))) ADDED docs/dashboard-and-other-windows.png Index: docs/dashboard-and-other-windows.png ================================================================== --- /dev/null +++ docs/dashboard-and-other-windows.png cannot compute difference between binary files ADDED docs/dashboard-small.png Index: docs/dashboard-small.png ================================================================== --- /dev/null +++ docs/dashboard-small.png cannot compute difference between binary files Index: docs/dashboard-test.png ================================================================== --- docs/dashboard-test.png +++ docs/dashboard-test.png cannot compute difference between binary files Index: docs/manual/megatest_manual.html ================================================================== --- docs/manual/megatest_manual.html +++ docs/manual/megatest_manual.html @@ -745,24 +745,20 @@

Dedication

-

Dedicated to my wife, Joanna, who has, for many years now, supported -all my wacky ideas and nutty projects with only the occasional grumble -and roll of the eyes.

+

Dedicated to my wife Joanna who has kindly supported my working on various projects over the years.

Thanks

-

To all the great people from the various places I’ve worked over the -years, thank you. I’ve benefitted from your patience and insight and I -hope that some of what I’ve learned from you has been incorporated -into Megatest.

-

Also, my thanks to all the wonderful open source creators. These -truly free projects, from Linux, xemacs, chicken scheme, and fossil to -asciidoc and bash are the philosophical and direct underpinnings of -the Megatest project.

+

Thank you the many people I’ve worked over the years who have +shared their knowledge and insights with me.

+

Thanks also to the creators of the various open source projects that +Megatest is built on. These include Linux, xemacs, chicken scheme, +fossil and asciidoc. Without these projects something like Megatest +would be difficult or impossible to do.

@@ -1004,10 +1000,10 @@

Index: docs/manual/megatest_manual.txt ================================================================== --- docs/manual/megatest_manual.txt +++ docs/manual/megatest_manual.txt @@ -7,26 +7,22 @@ [dedication] Dedication ========== -Dedicated to my wife, Joanna, who has, for many years now, supported -all my wacky ideas and nutty projects with only the occasional grumble -and roll of the eyes. +Dedicated to my wife Joanna who has kindly supported my working on various projects over the years. Thanks ------ -To all the great people from the various places I've worked over the -years, thank you. I've benefitted from your patience and insight and I -hope that some of what I've learned from you has been incorporated -into Megatest. - -Also, my thanks to all the wonderful open source creators. These -truly free projects, from Linux, xemacs, chicken scheme, and fossil to -asciidoc and bash are the philosophical and direct underpinnings of -the Megatest project. +Thank you the many people I've worked over the years who have +shared their knowledge and insights with me. + +Thanks also to the creators of the various open source projects that +Megatest is built on. These include Linux, xemacs, chicken scheme, +fossil and asciidoc. Without these projects something like Megatest +would be difficult or impossible to do. [preface] Preface ======= This book is organised as three sub-books; getting started, writing tests and reference. ADDED docs/megatest-training.odp Index: docs/megatest-training.odp ================================================================== --- /dev/null +++ docs/megatest-training.odp cannot compute difference between binary files ADDED docs/megatest-training.pdf Index: docs/megatest-training.pdf ================================================================== --- /dev/null +++ docs/megatest-training.pdf cannot compute difference between binary files ADDED docs/new-dashboard.png Index: docs/new-dashboard.png ================================================================== --- /dev/null +++ docs/new-dashboard.png cannot compute difference between binary files ADDED example/megatest.config Index: example/megatest.config ================================================================== --- /dev/null +++ example/megatest.config @@ -0,0 +1,24 @@ +[fields] +PLATFORM TEXT +OS TEXT + +[setup] +# Adjust max_concurrent_jobs to limit parallel jobs +max_concurrent_jobs 50 + +# This is your link path, best to set it and then not change it +linktree #{getenv PWD}/linktree + +# Job tools control how your jobs are launched +[jobtools] +useshell yes +launcher nbfind + +# You can override environment variables for all your tests here +[env-override] +EXAMPLE_VAR example value + +# As you run more tests you may need to add additional disks +# the names are arbitrary but must be unique +[disks] +disk0 #{getenv PWD}/runs ADDED example/runconfigs.config Index: example/runconfigs.config ================================================================== --- /dev/null +++ example/runconfigs.config @@ -0,0 +1,6 @@ +[default] +ALLTESTS see this variable + +# Your variables here are grouped by targets [SYSTEM/RELEASE] +[SYSTEM_val/RELEASE_val] +ANOTHERVAR only defined if target is SYSTEM_val/RELEASE_val ADDED example/tests/checkspace/checkspace.logpro Index: example/tests/checkspace/checkspace.logpro ================================================================== --- /dev/null +++ example/tests/checkspace/checkspace.logpro @@ -0,0 +1,3 @@ +(expect:error in "LogFileBody" = 0 "Any error" #/err/i) +(expect:required in "LogFileBody" = 1 "Sucess signature" #/adequate space/) + ADDED example/tests/checkspace/checkspace.sh Index: example/tests/checkspace/checkspace.sh ================================================================== --- /dev/null +++ example/tests/checkspace/checkspace.sh @@ -0,0 +1,8 @@ +#!/bin/bash -e +freespace=`df -k $DIRECTORY | grep $DIRECTORY | awk '{print $4}'` +if [[ $freespace -lt $REQUIRED ]];then + echo "ERROR: insufficient space on $DIRECTORY" + exit 1 +else + echo "There is adequate space on $DIRECTORY" +fi ADDED example/tests/checkspace/testconfig Index: example/tests/checkspace/testconfig ================================================================== --- /dev/null +++ example/tests/checkspace/testconfig @@ -0,0 +1,9 @@ +# Add steps here. Format is "stepname script" +[ezsteps] +checkspace checkspace.sh + +# Iteration for your tests are controlled by the items section +[itemstable] +DIRECTORY /tmp /opt +REQUIRED 1000000 100000 + Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -473,32 +473,58 @@ ;; to the iteration. use pathname-directory to trim the path by one ;; level (if (not not-iterated) ;; i.e. iterated (let ((iterated-parent (pathname-directory (conc lnkpath "/" item-path)))) (debug:print-info 2 "Creating iterated parent " iterated-parent) - (create-directory iterated-parent #t))) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create directory " iterated-parent ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-directory iterated-parent #t)))) - (if (symbolic-link? lnkpath) (delete-file lnkpath)) + (if (symbolic-link? lnkpath) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to remove symlink " lnkpath ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (delete-file lnkpath))) + (if (not (or (file-exists? lnkpath) (symbolic-link? lnkpath))) - (create-symbolic-link toptest-path lnkpath)) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create symlink " lnkpath ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-symbolic-link toptest-path lnkpath))) ;; The toptest path has been created, the link to the test in the linktree has ;; been created. Now, if this is an iterated test the real test dir must be created (if (not not-iterated) ;; this is an iterated test (let ((lnktarget (conc lnkpath "/" item-path))) (debug:print 2 "Setting up sub test run area") (debug:print 2 " - creating run area in " test-path) - (create-directory test-path #t) ;; (system (conc "mkdir -p " test-path)) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to create directory " test-path ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit 1)) + (create-directory test-path #t)) (debug:print 2 " - creating link from: " test-path "\n" " to: " lnktarget) - ;; (create-directory lnkpath #t) ;; (system (conc "mkdir -p " lnkpath)) ;; If there is already a symlink delete it and recreate it. - (if (symbolic-link? lnktarget) (delete-file lnktarget)) - (if (not (file-exists? lnktarget)) (create-symbolic-link test-path lnktarget)))) + (handle-exceptions + exn + (begin + (debug:print 0 "ERROR: Failed to re-create link " linktarget ((condition-property-accessor 'exn 'message) exn) ", exiting") + (exit)) + (if (symbolic-link? lnktarget) (delete-file lnktarget)) + (if (not (file-exists? lnktarget)) (create-symbolic-link test-path lnktarget))))) ;; I suspect this section was deleting test directories under some ;; wierd sitations? This doesn't make sense - reenabling the rm -f ;; I honestly don't remember *why* this chunk was needed... ;; (let ((testlink (conc lnkpath "/" testname))) @@ -507,11 +533,19 @@ ;; (symbolic-link? testlink))) ;; (system (conc "rm -f " testlink))) ;; (system (conc "ln -sf " test-path " " testlink))) (if (directory? test-path) (begin - (let* ((cmd (conc "rsync -av" (if (debug:debug-mode 1) "" "q") " " test-src-path "/ " test-path "/")) + (let* ((ovrcmd (let ((cmd (config-lookup *configdat* "setup" "testcopycmd"))) + (if cmd + ;; substitute the TEST_SRC_PATH and TEST_TARG_PATH + (string-substitute "TEST_TARG_PATH" test-path + (string-substitute "TEST_SRC_PATH" test-src-path cmd)) + #f))) + (cmd (if ovrcmd + ovrcmd + (conc "rsync -av" (if (debug:debug-mode 1) "" "q") " " test-src-path "/ " test-path "/"))) (status (system cmd))) (if (not (eq? status 0)) (debug:print 2 "ERROR: problem with running \"" cmd "\""))) (list lnkpathf lnkpath )) (list #f #f)))) Index: megatest-version.scm ================================================================== --- megatest-version.scm +++ megatest-version.scm @@ -1,7 +1,7 @@ ;; Always use two digit decimal ;; 1.01, 1.02...1.10,1.11 ... 1.99,2.00.. (declare (unit megatest-version)) -(define megatest-version 1.54) +(define megatest-version 1.5402) ADDED mkdeploy/megatest.config Index: mkdeploy/megatest.config ================================================================== --- /dev/null +++ mkdeploy/megatest.config @@ -0,0 +1,30 @@ +[fields] +PLATFORM TEXT +OS TEXT +OSVER TEXT + +[setup] +# Adjust max_concurrent_jobs to limit parallel jobs +max_concurrent_jobs 20 + +# This is your link path, best to set it and then not change it +linktree #{getenv MT_RUN_AREA_HOME}/linktree + +# Job tools control how your jobs are launched +[jobtools] +useshell yes +launcher nbfind + +# As you run more tests you may need to add additional disks +# the names are arbitrary but must be unique +# +[disks] +disk0 #{getenv MT_RUN_AREA_HOME}/runs + +# put env-override last so definitions in site.config by default +# are added as env-override variables +# +[env-override] + +# if the file site.config exists it will be used +[include site.config] ADDED mkdeploy/runconfigs.config Index: mkdeploy/runconfigs.config ================================================================== --- /dev/null +++ mkdeploy/runconfigs.config @@ -0,0 +1,9 @@ +[default] +TARGDIR_tmp /tmp +TARGDIR_opt /opt +TARGDIR_runs #{getenv MT_RUN_AREA_HOME}/runs +BUILDDIR #{getenv MT_RUN_AREA_HOME}/.. + +# Your variables here are grouped by targets [SYSTEM/RELEASE] +[SYSTEM_val/RELEASE_val] +ANOTHERVAR only defined if target is SYSTEM_val/RELEASE_val ADDED mkdeploy/tests/checkspace/checkspace.logpro Index: mkdeploy/tests/checkspace/checkspace.logpro ================================================================== --- /dev/null +++ mkdeploy/tests/checkspace/checkspace.logpro @@ -0,0 +1,3 @@ +(expect:error in "LogFileBody" = 0 "Any error" #/err/i) +(expect:required in "LogFileBody" = 1 "Sucess signature" #/adequate space/) + ADDED mkdeploy/tests/checkspace/checkspace.sh Index: mkdeploy/tests/checkspace/checkspace.sh ================================================================== --- /dev/null +++ mkdeploy/tests/checkspace/checkspace.sh @@ -0,0 +1,8 @@ +#!/bin/bash -e +freespace=`df -k /$DIRECTORY | grep $DIRECTORY | awk '{print $4}'` +if [[ $freespace -lt $REQUIRED ]];then + echo "ERROR: insufficient space on /$DIRECTORY" + exit 1 +else + echo "There is adequate space on /$DIRECTORY" +fi ADDED mkdeploy/tests/checkspace/testconfig Index: mkdeploy/tests/checkspace/testconfig ================================================================== --- /dev/null +++ mkdeploy/tests/checkspace/testconfig @@ -0,0 +1,11 @@ +# Add steps here. Format is "stepname script" +[ezsteps] +checkspace checkspace.sh + +# Iteration for your tests are controlled by the items section +# However it is impractical to code the actual directory here +# so use names here and dereference to variables in runconfigs +[itemstable] +DIRECTORY tmp opt runs +REQUIRED 100000 100000 1000000 + ADDED mkdeploy/tests/eggs/install.logpro Index: mkdeploy/tests/eggs/install.logpro ================================================================== --- /dev/null +++ mkdeploy/tests/eggs/install.logpro @@ -0,0 +1,5 @@ +(expect:ignore in "LogFileBody" >= 0 "ignore setup-error-handling" #/setup-error-handling/) +(expect:ignore in "LogFileBody" >= 0 "ignore check-errors" (list #/check-errors/ #/type-errors/ #/srfi-4-errors/)) +(expect:error in "LogFileBody" = 0 "Any error" #/error/i) +(expect:required in "LogFileBody" = 1 "Sucess signature" #/DONE/) + ADDED mkdeploy/tests/eggs/install.sh Index: mkdeploy/tests/eggs/install.sh ================================================================== --- /dev/null +++ mkdeploy/tests/eggs/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash -e +targpath=`megatest -test-paths -target $MT_TARGET :runname $MT_RUNNAME -testpatt executables/megatest` +chicken-install -prefix $targpath/megatest -deploy $EGGNAME +echo DONE ADDED mkdeploy/tests/eggs/testconfig Index: mkdeploy/tests/eggs/testconfig ================================================================== --- /dev/null +++ mkdeploy/tests/eggs/testconfig @@ -0,0 +1,12 @@ +# Add steps here. Format is "stepname script" +[ezsteps] +install install.sh + +[requirements] +waiton executables + +# Iteration for your tests are controlled by the items section +# However it is impractical to code the actual directory here +# so use names here and dereference to variables in runconfigs +[items] +EGGNAME apropos base64 canvas-draw csv-xml directory-utils dot-locking extras fmt format hostinfo http-client intarweb json md5 message-digest posix posix-extras readline regex regex-case s11n spiffy spiffy-request-vars sqlite3 srfi-1 srfi-18 srfi-69 tcp test uri-common zmq check-errors synch matchable sql-null tcp-server rpc blob-utils string-utils variable-item defstruct uri-generic sendfile openssl lookup-table list-utils stack ADDED mkdeploy/tests/executables/addlibs.logpro Index: mkdeploy/tests/executables/addlibs.logpro ================================================================== --- /dev/null +++ mkdeploy/tests/executables/addlibs.logpro @@ -0,0 +1,3 @@ +(expect:error in "LogFileBody" = 0 "Any error" #/err/i) +(expect:required in "LogFileBody" = 1 "Sucess signature" #/libchicken.so.6/) + ADDED mkdeploy/tests/executables/addlibs.sh Index: mkdeploy/tests/executables/addlibs.sh ================================================================== --- /dev/null +++ mkdeploy/tests/executables/addlibs.sh @@ -0,0 +1,10 @@ +#!/bin/bash -e + +CSIPATH=$(echo $(type csi)|awk '{print $3}') +CKPATH=$(dirname $(dirname $CSIPATH)) +rsync -av $EXECUTABLE/ ../deploytarg/ +for i in iup im cd av call sqlite; do + cp $(CKPATH)/lib/lib$i* ../deploytarg/ +done + +cp $(CKPATH)/include/*.h ../deploytarg/ ADDED mkdeploy/tests/executables/install.logpro Index: mkdeploy/tests/executables/install.logpro ================================================================== --- /dev/null +++ mkdeploy/tests/executables/install.logpro @@ -0,0 +1,3 @@ +(expect:error in "LogFileBody" = 0 "Any error" #/err/i) +(expect:required in "LogFileBody" = 1 "Sucess signature" #/libchicken.so.6/) + ADDED mkdeploy/tests/executables/install.sh Index: mkdeploy/tests/executables/install.sh ================================================================== --- /dev/null +++ mkdeploy/tests/executables/install.sh @@ -0,0 +1,7 @@ +#!/bin/bash -e + +unset LD_LIBRARY_PATH +rm -rf $EXECUTABLE +mkdir $EXECUTABLE +csc -deploy $EXECUTABLE +ls $EXECUTABLE ADDED mkdeploy/tests/executables/linksrc.logpro Index: mkdeploy/tests/executables/linksrc.logpro ================================================================== --- /dev/null +++ mkdeploy/tests/executables/linksrc.logpro @@ -0,0 +1,3 @@ +(expect:error in "LogFileBody" = 0 "Any error" #/err/i) +(expect:required in "LogFileBody" = 1 "Sucess signature" #/Makefile/) + ADDED mkdeploy/tests/executables/linksrc.sh Index: mkdeploy/tests/executables/linksrc.sh ================================================================== --- /dev/null +++ mkdeploy/tests/executables/linksrc.sh @@ -0,0 +1,6 @@ +#!/bin/bash -e + +rm -f *.scm *.o Makefile +ln -s $BUILDDIR/*.scm . +ln -s $BUILDDIR/Makefile . +ls Makefile *.scm ADDED mkdeploy/tests/executables/make_mt.logpro Index: mkdeploy/tests/executables/make_mt.logpro ================================================================== --- /dev/null +++ mkdeploy/tests/executables/make_mt.logpro @@ -0,0 +1,3 @@ +(expect:error in "LogFileBody" = 0 "Any error" #/err/i) +(expect:required in "LogFileBody" = 1 "Sucess signature" #/mtest/) + ADDED mkdeploy/tests/executables/testconfig Index: mkdeploy/tests/executables/testconfig ================================================================== --- /dev/null +++ mkdeploy/tests/executables/testconfig @@ -0,0 +1,13 @@ +# Add steps here. Format is "stepname script" +[ezsteps] +linksrc linksrc.sh +make_mt make +install install.sh +addlibs addlibs.sh + +# Iteration for your tests are controlled by the items section +# However it is impractical to code the actual directory here +# so use names here and dereference to variables in runconfigs +[itemstable] +EXECUTABLE megatest dashboard + ADDED mkdeploy/tests/helpers/install.logpro Index: mkdeploy/tests/helpers/install.logpro ================================================================== --- /dev/null +++ mkdeploy/tests/helpers/install.logpro @@ -0,0 +1,3 @@ +(expect:error in "LogFileBody" = 0 "Any error" #/err/i) +(expect:required in "LogFileBody" = 1 "Sucess signature" #/adequate space/) + ADDED mkdeploy/tests/helpers/install.sh Index: mkdeploy/tests/helpers/install.sh ================================================================== --- /dev/null +++ mkdeploy/tests/helpers/install.sh @@ -0,0 +1,8 @@ +#!/bin/bash -e +freespace=`df -k /$DIRECTORY | grep $DIRECTORY | awk '{print $4}'` +if [[ $freespace -lt $REQUIRED ]];then + echo "ERROR: insufficient space on /$DIRECTORY" + exit 1 +else + echo "There is adequate space on /$DIRECTORY" +fi ADDED mkdeploy/tests/helpers/testconfig Index: mkdeploy/tests/helpers/testconfig ================================================================== --- /dev/null +++ mkdeploy/tests/helpers/testconfig @@ -0,0 +1,11 @@ +# Add steps here. Format is "stepname script" +[ezsteps] +install install.sh + +# Iteration for your tests are controlled by the items section +# However it is impractical to code the actual directory here +# so use names here and dereference to variables in runconfigs +[itemstable] +DIRECTORY tmp opt runs +REQUIRED 100000 100000 1000000 + Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -817,15 +817,21 @@ (debug:print 0 "WARNING: directory " real-dir " does not exist") (debug:print 0 "WARNING: no real directory corrosponding to link " run-dir ", nothing done"))) (if (symbolic-link? run-dir) (begin (debug:print-info 1 "Removing symlink " run-dir) - (delete-file run-dir)) + (handle-exceptions + exn + (debug:print 0 "ERROR: Failed to remove symlink " run-dir ((condition-property-accessor 'exn 'message) exn) ", attempting to continue") + (delete-file run-dir))) (if (directory? run-dir) (if (> (directory-fold (lambda (f x)(+ 1 x)) 0 run-dir) 0) (debug:print 0 "WARNING: refusing to remove " run-dir " as it is not empty") - (delete-directory run-dir)) ;; it should be empty by here BUG BUG, add error catch + (handle-exceptions + exn + (debug:print 0 "ERROR: Failed to remove directory " run-dir ((condition-property-accessor 'exn 'message) exn) ", attempting to continue") + (delete-directory run-dir))) (if run-dir (debug:print 0 "WARNING: not removing " run-dir " as it either doesn't exist or is not a symlink") (debug:print 0 "NOTE: the run dir for this test is undefined. Test may have already been deleted.")) ))) ((set-state-status) Index: tests/fullrun/megatest.config ================================================================== --- tests/fullrun/megatest.config +++ tests/fullrun/megatest.config @@ -9,10 +9,21 @@ area1 /tmp/oldarea/megatest [include #{getenv MT_RUN_AREA_HOME}/config/mt_include_1.config] [setup] + +# It is possible (but not recommended) to override the rsync command used +# to populate the test directories. For test development the following +# example can be useful +# +testcopycmd cp --remove-destination -rsv TEST_SRC_PATH/. TEST_TARG_PATH/. + +# or for hard links + +# testcopycmd cp --remove-destination -rlv TEST_SRC_PATH/ TEST_TARG_PATH/ + # FULL or 2, NORMAL or 1, OFF or 0 synchronous OFF # Throttle roughly scales the db access milliseconds to seconds delay throttle 0.2 # Max retries allows megatest to re-check that a tests status has changed