summaryrefslogtreecommitdiff
path: root/tests/automated
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-08-16 12:18:20 +0000
committerBenny Prijono <bennylp@teluu.com>2010-08-16 12:18:20 +0000
commitc98536d11edb6153298e43bc9efe9722bc030382 (patch)
tree897973ebe0aee0b06b7310c531b3c0159b272a9d /tests/automated
parent41770365a6b23b154fd412d7461fd5a0f881cbdc (diff)
Automated test (re: #1111): added script to run the test continuously
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3269 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests/automated')
-rwxr-xr-xtests/automated/run_continuous.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/automated/run_continuous.py b/tests/automated/run_continuous.py
new file mode 100755
index 00000000..ab51f1f6
--- /dev/null
+++ b/tests/automated/run_continuous.py
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+import os
+import sys
+import time
+import ccdash
+
+GROUP = "Continuous"
+INTERVAL = 60
+
+if __name__ == "__main__":
+ if len(sys.argv)<=1 or sys.argv[1]=="-h" or sys.argv[1]=="--h" or sys.argv[1]=="/h":
+ print "Usage: run_continuous.py scenario1.xml [scenario2.xml ...]"
+ sys.exit(0)
+
+ # Splice list
+ scenarios = sys.argv[1:]
+
+ # Check if scenario exists
+ for scenario in scenarios:
+ if not os.path.exists(scenario):
+ print "Error: file " + scenario + " does not exist"
+ sys.exit(1)
+
+ # Loop foreva
+ while True:
+ argv = []
+
+ # Anything changed recently?
+ argv.append("ccdash.py")
+ argv.append("status")
+ argv.append("-w")
+ argv.append("../..")
+ rc = ccdash.main(argv)
+
+ if rc==0:
+ # Nothing changed
+ print "No update, will check again in " + str(INTERVAL) + "s.."
+ time.sleep(INTERVAL)
+ continue
+
+ # Run each scenario
+ for scenario in scenarios:
+ argv = []
+ argv.append("ccdash.py")
+ argv.append("scenario")
+ argv.append(scenario)
+ argv.append("--group")
+ argv.append(GROUP)
+ thisrc = ccdash.main(argv)
+ if rc==0 and thisrc:
+ rc = thisrc
+
+ # Sleep even if something does change
+ time.sleep(INTERVAL)
+