Ignore:
Timestamp:
Aug 25, 2010 12:57:53 PM (14 years ago)
Author:
bennylp
Message:

Misc (re #1110): undo accidental checkin of run_continuous.py in previous commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/tests/automated/run_continuous.py

    r3295 r3296  
    88INTERVAL = 300 
    99DELAY = 0 
    10 CMDLINE = "" 
    1110 
    12 def run_cmdline(group): 
    13         cmdline = CMDLINE + " --group " + group 
    14         return os.system(cmdline) 
     11def run_scenarios(scenarios, group): 
     12        # Run each scenario 
     13        rc = 0 
     14        for scenario in scenarios: 
     15                argv = [] 
     16                argv.append("ccdash.py") 
     17                argv.append("scenario") 
     18                argv.append(scenario) 
     19                argv.append("--group") 
     20                argv.append(group) 
     21                thisrc = ccdash.main(argv) 
     22                if rc==0 and thisrc: 
     23                        rc = thisrc 
     24        return rc 
    1525 
    1626 
     
    1929 
    2030Usage: 
    21   run_continuous.py [options] "cmdline" 
    22  
    23 where: 
    24   cmdline is command to be executed to perform the test. Typically, this is 
    25   a script that calls configure.py and run_scenario.py for each scenario to 
    26   be performed. See perform_test.sh.sample and perform_test.bat.sample for 
    27   sample scripts. Note that the cmdline will be called with added group 
    28   argument (e.g. --group Nightly). 
     31  run_continuous.py [options] scenario1.xml [scenario2.xml ...] 
    2932 
    3033options: 
     
    4447                usage() 
    4548 
    46         # Check args 
     49        # Splice list 
     50        scenarios = [] 
    4751        i = 1 
    4852        while i < len(sys.argv): 
     
    5559                        print "Delay is set to %f minute(s)" % (DELAY / 60) 
    5660                else: 
    57                         if CMDLINE: 
    58                                 print "Error: cmdline already specified" 
     61                        # Check if scenario exists 
     62                        scenario = sys.argv[i] 
     63                        if not os.path.exists(scenario): 
     64                                print "Error: file " + scenario + " does not exist" 
    5965                                sys.exit(1) 
    60                         CMDLINE = sys.argv[i] 
     66                        scenarios.append(scenario) 
     67                        print "Scenario %s added" % (scenario) 
    6168                i = i + 1 
    6269 
    63         if not CMDLINE: 
    64                 print "Error: cmdline is needed" 
     70        if len(scenarios) < 1: 
     71                print "Error: scenario is required" 
    6572                sys.exit(1) 
    6673 
     
    93100                                print "Will run %s after %f s.." % (group, DELAY) 
    94101                                time.sleep(DELAY) 
    95                                 rc = run_cmdline(group) 
     102                                rc = run_scenarios(scenarios, group) 
    96103                                # Sleep even if something does change 
    97104                                print str(datetime.datetime.now()) + \ 
Note: See TracChangeset for help on using the changeset viewer.