Changeset 97e09f4 in flex_extract.git
- Timestamp:
- Sep 2, 2018, 12:32:04 PM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- efa05d7
- Parents:
- f9f7b3f
- Location:
- python
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
python/install.py
r763fcf6 r97e09f4 177 177 fortran_executable = 'CONVERT2' 178 178 179 if c.install_target.lower() != 'local': 179 if c.install_target.lower() != 'local': # ecgate or cca 180 180 181 181 mk_compilejob(ecd + 'python/compilejob.temp', c.makefile, … … 195 195 c.ecuid, c.ecgid) 196 196 197 result_code =submit_job_to_ecserver(ecd + '/python/', c.install_target,198 197 submit_job_to_ecserver(ecd + '/python/', c.install_target, 198 'compilejob.ksh') 199 199 200 200 print 'job compilation script has been submitted to ecgate for ' + \ 201 201 'installation in ' + c.flexpart_root_scripts + \ 202 202 '/' + target_dir 203 print 'You should get an email with subject flexcompilewithin ' + \203 print 'You should get an email with subject "flexcompile" within ' + \ 204 204 'the next few minutes!' 205 205 -
python/pythontest/.cache/v/cache/lastfailed
rdda0e9d r97e09f4 1 1 { 2 "TestTools.py": true, 2 3 "TestTools.py::TestTools::test_init128": true, 3 4 "TestTools.py::TestTools::test_to_param_id": true -
python/pythontest/TestTools.py
rf9f7b3f r97e09f4 117 117 assert True 118 118 119 @pytest.mark.msuser 119 def test_fail_put_file_to_ecserver(self): 120 ecuid=os.environ['ECUID'] 121 ecgid=os.environ['ECGID'] 122 with pytest.raises(SystemExit) as pytest_wrapped_e: 123 put_file_to_ecserver('TestData/', 'testfil.txt', 124 'ecgate', ecuid, ecgid) 125 assert pytest_wrapped_e.type == SystemExit 126 assert pytest_wrapped_e.value.code == '... ECACCESS-FILE-PUT FAILED!' 127 120 128 def test_success_put_file_to_ecserver(self): 129 ecuid=os.environ['ECUID'] 130 ecgid=os.environ['ECGID'] 131 result = put_file_to_ecserver('TestData/', 'testfile.txt', 132 'ecgate', ecuid, ecgid) 133 assert result == '' 134 135 @pytest.mark.msuser_pw 136 def test_fullsuccess_put_file_to_ecserver(self): 121 137 ecuid=os.environ['ECUID'] 122 138 ecgid=os.environ['ECGID'] … … 134 150 def test_success_submit_job_to_ecserver(self): 135 151 result = submit_job_to_ecserver('ecgate', 'TestData/testfile.txt') 136 assert result == 0 137 152 assert result.strip().isdigit() == True 138 153 139 154 -
python/pythontest/pytest.ini
rf9f7b3f r97e09f4 2 2 [pytest] 3 3 markers = 4 m emberstate: Test that can be executed only as a member-state user. Password required.4 msuser_pw: Test that can be executed only as a member-state user. Password required. -
python/tools.py
r70a0bec r97e09f4 446 446 ''' 447 447 @Description: 448 Uses the ecaccess command to send a file to the ECMWF servers. 449 Catches and prints the error if it failed. 448 Uses the ecaccess-file-put command to send a file to the ECMWF servers. 449 450 NOTE: 451 The return value is just for testing reasons. It does not have 452 to be used from the calling function since the whole error handling 453 is done in here. 450 454 451 455 @Input: 452 456 ecd: string 453 The path were the file is to bestored.457 The path were the file is stored. 454 458 455 459 filename: string … … 457 461 458 462 target: string 459 The target where the file should be sent to, e.g. the queue.463 The target queue where the file should be sent to. 460 464 461 465 ecuid: string … … 466 470 467 471 @Return: 468 <nothing> 472 rcode: string 473 Resulting code of command execution. If successful the string 474 will be empty. 469 475 ''' 470 476 471 477 try: 472 subprocess.check_call(['ecaccess-file-put', 473 ecd + '/' + filename, 474 target + ':/home/ms/' + 475 ecgid + '/' + ecuid + 476 '/' + filename]) 478 rcode = subprocess.check_output(['ecaccess-file-put', 479 ecd + '/' + filename, 480 target + ':/home/ms/' + 481 ecgid + '/' + ecuid + 482 '/' + filename], 483 stderr=subprocess.STDOUT) 477 484 except subprocess.CalledProcessError as e: 478 print 'ERROR:' 479 print e 480 sys.exit('ecaccess-file-put failed!\n' + \ 481 'Probably the eccert key has expired.') 482 483 return 485 print '... ERROR CODE:\n ... ', e.returncode 486 print '... ERROR MESSAGE:\n ... ', e 487 print '... COMMAND MESSAGE:\n ...', e.output 488 489 print '\nDo you have a valid eccert key?' 490 sys.exit('... ECACCESS-FILE-PUT FAILED!') 491 492 return rcode 484 493 485 494 def submit_job_to_ecserver(target, jobname): 486 495 ''' 487 496 @Description: 488 Uses ecaccess to submit a job to the ECMWF server. 489 Catches and prints the error if one arise. 497 Uses ecaccess-job-submit command to submit a job to the ECMWF server. 498 499 NOTE: 500 The return value is just for testing reasons. It does not have 501 to be used from the calling function since the whole error handling 502 is done in here. 490 503 491 504 @Input: … … 497 510 498 511 @Return: 499 rcode: integer 500 Resulting code of subprocess.check_call. 512 rcode: string 513 Resulting code of command execution. If successful the string 514 will contain an integer number, representing the id of the job 515 at the ecmwf server. 501 516 ''' 502 517 503 518 try: 504 rcode = subprocess.check_ call(['ecaccess-job-submit',505 '-queueName', target,506 jobname])519 rcode = subprocess.check_output(['ecaccess-job-submit', 520 '-queueName', target, 521 jobname]) 507 522 except subprocess.CalledProcessError as e: 508 523 print '... ERROR CODE: ', e.returncode 524 print '... ERROR MESSAGE:\n ... ', e 525 print '... COMMAND MESSAGE:\n ...', e.output 526 527 print '\nDo you have a valid eccert key?' 509 528 sys.exit('... ECACCESS-JOB-SUBMIT FAILED!') 510 529
Note: See TracChangeset
for help on using the changeset viewer.