Changeset 6903 for anuga_validation
- Timestamp:
- Apr 24, 2009, 5:24:52 PM (16 years ago)
- Location:
- anuga_validation/automated_validation_tests/patong_beach_validation
- Files:
-
- 1 added
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/automated_validation_tests/patong_beach_validation/validate.py
r6893 r6903 38 38 Mandatory_Data_Objects = ('data.tgz',) 39 39 40 # sequence of optional local data objects 40 # sequence of optional local data objects. 41 # these names must be of the form <scene>.sww.<type>.tgz 42 # as code below depends upon it. 41 43 Optional_Data_Objects = ('patong.sww.TRIAL.tgz', 42 44 'patong.sww.BASIC.tgz', … … 115 117 return (True, auth) 116 118 117 log.info('Could not refresh file %s' % local)118 119 return (False, auth) 119 120 … … 141 142 else (False, <updated_auth>). 142 143 ''' 143 144 log.info("Refreshing local object '%s'" % obj)145 144 146 145 # create local and remote file paths. … … 168 167 shutil.move(remote_digest, local_digest) 169 168 (res, auth) = get_remote_from_mirrors(obj, local_file, auth, mirrors) 170 169 171 170 return (res, auth) 172 171 … … 185 184 result = True 186 185 for data_object in data_objects: 186 log.info("Refreshing file '%s'" % data_object) 187 187 log.debug('refresh_local_data: getting %s from mirrors, auth=%s' 188 188 % (data_object, str(auth))) … … 191 191 % (str(res), str(auth))) 192 192 if res == False: 193 log. debug('Failed fetching %s, returning False' % data_object)193 log.info('Refresh of file %s failed.' % data_object) 194 194 result = False 195 195 196 log.info('Local data has been refreshed, result=%s.' % str(result)) 196 if result: 197 log.info('Local data has been refreshed.') 198 else: 199 log.info('Local data has been refreshed, with one or more errors.') 197 200 return result 198 201 … … 282 285 283 286 # run the simulation, produce SWW file 284 log.critical('Running Patong simulation ...')285 287 cmd = 'python run_model.py > %s' % RUNMODEL_STDOUT 286 288 log.debug("run_simulation: doing '%s'" % cmd) … … 297 299 return res == 0 298 300 299 def check_that_output_is_as_expected( ):301 def check_that_output_is_as_expected(expected_sww, valid_sww): 300 302 '''Check that validation output is as required.''' 301 303 302 304 # get path to expected SWW file 303 305 log.critical('Checking that simulation results are as expected ...') 304 local_sww = os.path.join(Local_Data_Directory, Local_Data_Objects[0])306 local_sww = os.path.join(Local_Data_Directory, valid_sww) 305 307 306 308 # get output directory from stdout capture file … … 329 331 330 332 # compare SWW files here and there 331 new_output_sww = os.path.join(output_directory, OUTPUT_SWW)333 new_output_sww = os.path.join(output_directory, expected_sww) 332 334 cmd = 'python cmpsww.py %s %s > cmpsww.stdout' % (local_sww, new_output_sww) 333 335 log.debug("check_that_output_is_as_expected: doing '%s'" % cmd) … … 423 425 log.critical("Running Patong '%s' validation ..." % vtype) 424 426 if run_simulation(vtype, odo): 425 check_that_output_is_as_expected(vtype, odo) 427 # get SWW names expected and valid, check 'equal' 428 (valid_sww, _) = odo.rsplit('.', 1) 429 (expected_sww, _) = valid_sww.rsplit('.', 1) 430 check_that_output_is_as_expected(expected_sww, valid_sww) 426 431 427 432 # clean up
Note: See TracChangeset
for help on using the changeset viewer.