diff --git a/Run/Jobscripts/README b/Run/Jobscripts/README.md similarity index 100% rename from Run/Jobscripts/README rename to Run/Jobscripts/README.md diff --git a/Source/Python/install.py b/Source/Python/install.py index 701e8212db1cb6e263f0c7199d12c05315537b86..18170696c177e116c3b5028a8976f8d40e082c72 100755 --- a/Source/Python/install.py +++ b/Source/Python/install.py @@ -375,7 +375,7 @@ def mk_tarball(tarball_path, target): for x in UioFiles(_config.PATH_REL_CONTROLFILES, 'CONTROL*').files] testfiles = [os.path.relpath(x, ecd) - for x in UioFiles(_config.PATH_REL_TEST, '*').files] + for x in UioFiles(_config.PATH_REL_TEST+"/Installation", '*').files] tempfiles = [os.path.relpath(x, ecd) for x in UioFiles(_config.PATH_REL_TEMPLATES, '*.template').files] gribtable = [os.path.relpath(x, ecd) @@ -386,7 +386,8 @@ def mk_tarball(tarball_path, target): for x in UioFiles(_config.PATH_REL_FORTRAN_SRC, '*.h').files] makefiles = [os.path.relpath(x, ecd) for x in UioFiles(_config.PATH_REL_FORTRAN_SRC, 'makefile*').files] - jobdir = [_config.PATH_REL_JOBSCRIPTS] + jobdir = [os.path.relpath(x, ecd) + for x in UioFiles(_config.PATH_REL_JOBSCRIPTS, '*.md').files] # concatenate single lists to one for a better looping filelist = pyfiles + pytestfiles + controlfiles + tempfiles + \ diff --git a/Source/Pythontest/TestEcFlexpart.py b/Source/Pythontest/TestEcFlexpart.py deleted file mode 100644 index 046835e742b5ad7c4fe021c3243618f1453a5eea..0000000000000000000000000000000000000000 --- a/Source/Pythontest/TestEcFlexpart.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - - -import sys -import os -import inspect -import pytest - -sys.path.append('../python') -import _config -from classes.EcFlexpart import EcFlexpart -from classes.ControlFile import ControlFile -from mods.tools import silent_remove - -class TestEcFlexpart(): - ''' - ''' - - def test_write_namelist(self): - import filecmp - - control_file = os.path.join(_config.PATH_TEST_DIR, - 'TestData', - 'CONTROL.temp') - c = ControlFile(control_file) - flexpart = EcFlexpart(c) - - c.inputdir = 'TestData' - - # comparison file - testfile = os.path.join(_config.PATH_TEST_DIR, - 'TestData', - 'convert.nl.test') - - # create - flexpart.write_namelist(c) - - finalfile = os.path.join(c.inputdir, _config.FILE_NAMELIST) - assert filecmp.cmp(testfile, finalfile, shallow=False) - - # delete test file - silent_remove(finalfile) - - - - -# these functions should test the output and compare the results with an output -# of the old version and check if there are no differences!!! -# also check for errors?! Or check if it works for alle datasets and private public etc - - # - process_output - # - create - # - deacc_fluxes - # - retrieve - diff --git a/Source/Pythontest/TestInput.py b/Source/Pythontest/TestInput.py deleted file mode 100644 index 596d9c722769cd7fcd64bf93460defb9c145b0ab..0000000000000000000000000000000000000000 --- a/Source/Pythontest/TestInput.py +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import os -import sys -import pytest - -sys.path.append('../Python') -from Classes.ControlFile import ControlFile -from Mods.tools import get_cmdline_args - - -class TestInput(): - ''' - Test class to test the reading of commandline arguments and - control file. - ''' - # ToDo - # create more tests for input - # 1. nur controlfile reading - # 2. check of parameter - - @classmethod - def setup_class(self): - # Default values for ArgumentParser - self.args = {'start_date':None, - 'end_date':None, - 'date_chunk':None, - 'basetime':None, - 'step':None, - 'levelist':None, - 'area':None, - 'inputdir':None, - 'outputdir':None, - 'flexpart_root_scripts':None, - 'ppid':None, - 'job_template':'job.temp', - 'queue':None, - 'controlfile':'CONTROL.test', - 'debug':0, - } - #sys.argv = ['dummy.py', '--start_date=20180101', '--debug=1', - # '--step=0/to/11/BY/3', '--area=20./20./0./90.'] - sys.argv = ['dummy.py', '--start_date=20180101'] - - self.args = get_cmdline_args() - - self.c = ControlFile('../../Testing/Regression/Unit/Testfiles/CONTROL.test') - - self.c.assign_args_to_control(self.args) - - self.c.check_conditions() - - - def test_args_reading(self): - - sys.argv = ['dummy.py', '--start_date=20180101', '--debug=1', - '--step=0/to/11/BY/3', '--area=20./20./0./90.'] - - arguments = get_cmdline_args() - - args_exp = {'start_date':'20180101', - 'end_date':None, - 'date_chunk':None, - 'basetime':None, - 'step':'0/to/11/BY/3', - 'levelist':None, - 'area':'20./20./0./90.', - 'inputdir':None, - 'outputdir':None, - 'flexpart_root_scripts':None, - 'ppid':None, - 'job_template':'job.temp', - 'queue':None, - 'controlfile':'CONTROL.test', - 'debug':1, - } - - assert vars(arguments) == args_exp - - - def test_args_assignment(self): - - import collections - - # expected parametervalue: - exp_dict = { - 'accuracy': '16', - 'addpar': ['186', '187', '188', '235', '139', '39'], - 'area': None, - 'basetime': None, - 'controlfile': 'CONTROL.test', - 'cwc': 0, - 'date_chunk': 3, - 'debug': 0, - 'destination': None, - 'dpdeta': '1', - 'dtime': '3', - 'ecfsdir': 'ectmp:/${USER}/econdemand/', - 'ecgid': None, - 'ecmwfdatadir': '/raid60/nas/tmc/Anne/Interpolation/flexextract/flexextract/python/../', - 'ecstorage': '0', - 'ectrans': '1', - 'ecuid': None, - 'end_date': '20180101', - 'eta': '0', - 'etadiff': '0', - 'etapar': 77, - 'exedir': '/raid60/nas/tmc/Anne/Interpolation/flexextract/flexextract/python/../src/', - 'expver': '1', - 'flexpart_root_scripts': '/raid60/nas/tmc/Anne/Interpolation/flexextract/flexextract/python/../', - 'format': 'GRIB1', - 'gateway': None, - 'gauss': '1', - 'grib2flexpart': '0', - 'grid': '5000', - 'inputdir': '../work', - 'job_template': 'job.temp', - 'left': '-15000', - 'level': '60', - 'levelist': '55/to/60', - 'lower': '30000', - 'mailfail': ['${USER}'], - 'mailops': ['${USER}'], - 'makefile': None, - 'marsclass': 'EI', - 'maxstep': 11, - 'number': 'OFF', - 'omega': '0', - 'omegadiff': '0', - 'outputdir': '../work', - 'prefix': 'EI', - 'resol': '63', - 'right': '45000', - 'smooth': '0', - 'start_date': '20180101', - 'step': ['00', '01', '02', '03', '04', '05', '00', '07', '08', '09', '10', '11', '00', '01', '02', '03', '04', '05', '00', '07', '08', '09', '10', '11'], - 'stream': 'OPER', - 'target': None, - 'time': ['00', '00', '00', '00', '00', '00', '06', '00', '00', '00', '00', '00', '12', '12', '12', '12', '12', '12', '18', '12', '12', '12', '12', '12'], - 'type': ['AN', 'FC', 'FC', 'FC', 'FC', 'FC', 'AN', 'FC', 'FC', 'FC', 'FC', 'FC', 'AN', 'FC', 'FC', 'FC', 'FC', 'FC', 'AN', 'FC', 'FC', 'FC', 'FC', 'FC'], - 'upper': '75000', - 'wrf': 0} - - exp_dict = collections.OrderedDict(sorted(exp_dict.items())) - cdict = collections.OrderedDict(sorted(vars(self.c).items())) - - # remove content which isn't comparable for different users - # or different operating systems - del cdict['ecfsdir_expanded'] - del cdict['mailops_expanded'] - del cdict['mailfail_expanded'] - - #print 'cdict\n', cdict - #print 'exp_dict\n', exp_dict - - #assert cdict == exp_dict - assert cdict == exp_dict - - return - - @classmethod - def teardown_class(self): - - return diff --git a/Source/Pythontest/TestInstall.py b/Source/Pythontest/TestInstall.py index 0e9c086e2bc3fce26e26de21201ce1ef31bd8c11..c2d4d4a070b473a593caaa1ce305aa9564ba28ac 100644 --- a/Source/Pythontest/TestInstall.py +++ b/Source/Pythontest/TestInstall.py @@ -18,6 +18,7 @@ except ImportError: import builtins import pytest from mock import patch +import mock sys.path.append('../Python') import _config @@ -52,9 +53,10 @@ class TestInstall(): - @patch('tarfile.open', side_effect=[subprocess.CalledProcessError(1,'test'), - OSError(errno.EEXIST)]) + @patch('tarfile.open', side_effect=[tarfile.TarError, OSError]) def test_fail_mk_tarball_local(self, mock_open): + import tarfile + # mock_open.side_effekt = tarfile.TarError ecd = _config.PATH_FLEXEXTRACT_DIR + os.path.sep # create test tarball and list its content files tarballname = _config.FLEXEXTRACT_DIRNAME + '_localtest.tar' @@ -62,6 +64,7 @@ class TestInstall(): with pytest.raises(SystemExit): mk_tarball(ecd + tarballname, 'local') + def test_success_mk_tarball_local(self): ecd = _config.PATH_FLEXEXTRACT_DIR + os.path.sep @@ -118,20 +121,14 @@ class TestInstall(): # list comparison files for tarball content tar_test_dir = os.path.join(self.testdir, 'InstallTar') - cmp_dir = _config.FLEXEXTRACT_DIRNAME + '_ecgate' - tar_test_fedir = os.path.join(tar_test_dir, cmp_dir) - comparison_list = [] - for path, subdirs, files in os.walk(tar_test_fedir): - for name in files: - if 'tar' not in name: - comparison_list.append(os.path.relpath( - os.path.join(path, name), tar_test_fedir)) + tarballname = _config.FLEXEXTRACT_DIRNAME + '_ecgate.tar' + with tarfile.open(os.path.join(tar_test_dir, tarballname), 'r') as tar_handle: + comparison_list = tar_handle.getnames() # untar in test directory test_dir = os.path.join(tar_test_dir, 'test_ecgate') make_dir(test_dir) os.chdir(test_dir) - tarballname = _config.FLEXEXTRACT_DIRNAME + '_ecgate.tar' un_tarball(os.path.join(tar_test_dir, tarballname)) tarfiles_list = [] for path, subdirs, files in os.walk(test_dir): @@ -147,27 +144,21 @@ class TestInstall(): # list comparison files for tarball content tar_test_dir = os.path.join(self.testdir, 'InstallTar') - cmp_dir = _config.FLEXEXTRACT_DIRNAME + '_local' - tar_test_fedir = os.path.join(tar_test_dir, cmp_dir) - comparison_list = [] - for path, subdirs, files in os.walk(tar_test_fedir): - for name in files: - if 'tar' not in name: - comparison_list.append(os.path.relpath( - os.path.join(path, name), tar_test_fedir)) + tarballname = _config.FLEXEXTRACT_DIRNAME + '_local.tar' + with tarfile.open(os.path.join(tar_test_dir, tarballname), 'r') as tar_handle: + comparison_list = tar_handle.getnames() # untar in test directory test_dir = os.path.join(tar_test_dir, 'test_local') make_dir(test_dir) os.chdir(test_dir) - tarballname = _config.FLEXEXTRACT_DIRNAME + '_local.tar' un_tarball(os.path.join(tar_test_dir, tarballname)) tarfiles_list = [] for path, subdirs, files in os.walk(test_dir): for name in files: tarfiles_list.append(os.path.relpath( os.path.join(path, name), test_dir)) - + # test for equality assert sorted(tarfiles_list) == sorted(comparison_list) @@ -204,14 +195,6 @@ class TestInstall(): 'gateway.test.ac.at', 'user@destination') - @patch('__builtin__.open', side_effect=[OSError(errno.EPERM)]) - def test_fail_open_mk_env_vars(self, mock_open): - with pytest.raises(SystemExit): - mk_env_vars('testuser', - 'testgroup', - 'gateway.test.ac.at', - 'user@destination') - @patch('_config.FILE_INSTALL_COMPILEJOB', _config_test.PATH_TESTFILES_DIR+'/compilejob_test.ksh') def test_success_mk_compilejob(self): import filecmp @@ -220,7 +203,6 @@ class TestInstall(): 'compilejob.test') mk_compilejob('Makefile.TEST', - '', 'testuser', 'testgroup', 'fp_root_test_path') @@ -235,7 +217,6 @@ class TestInstall(): def test_fail_load_mk_compilejob(self, mock_generate): with pytest.raises(SystemExit): mk_compilejob('Makefile.TEST', - '', 'testuser', 'testgroup', 'fp_root_test_path') @@ -245,31 +226,29 @@ class TestInstall(): MockHelper.return_value.generate.side_effect = UndefinedError('undefined') with pytest.raises(SystemExit): mk_compilejob('Makefile.TEST', - '', 'testuser', 'testgroup', 'fp_root_test_path') - @patch('__builtin__.open', side_effect=[OSError(errno.EPERM)]) - def test_fail_open_mk_compilejob(self, mock_open): - with pytest.raises(SystemExit): - mk_compilejob('Makefile.TEST', - '', - 'testuser', - 'testgroup', - 'fp_root_test_path') +# @patch('builtins.open', side_effect=[OSError(errno.EPERM)]) +# def test_fail_open_mk_compilejob(self, mock_open): +# with pytest.raises(SystemExit): +# mk_compilejob('Makefile.TEST', +# 'testuser', +# 'testgroup', +# 'fp_root_test_path') - @patch('_config.TEMPFILE_JOB', _config_test.PATH_TESTFILES_DIR+'/job_temp.test_test') + @patch('_config.TEMPFILE_JOB', _config_test.PATH_TESTFILES_DIR+'/submitscript.template.test.comp') def test_success_mk_job_template(self): import filecmp testfile = os.path.join(self.testfilesdir, - 'job.temp.test') + 'submitscript.template.test') mk_job_template('testuser', 'testgroup', - 'gateway.test.ac.at', - 'dest@generic', +# 'gateway.test.ac.at', +# 'dest@generic', 'fp_root_test_path') finalfile = os.path.join(_config.PATH_TEMPLATES, @@ -283,8 +262,8 @@ class TestInstall(): with pytest.raises(SystemExit): mk_job_template('testuser', 'testgroup', - 'gateway.test.ac.at', - 'dest@generic', +# 'gateway.test.ac.at', +# 'dest@generic', 'fp_root_test_path') def test_fail_generate_mk_job_template(self): @@ -293,18 +272,18 @@ class TestInstall(): with pytest.raises(SystemExit): mk_job_template('testuser', 'testgroup', - 'gateway.test.ac.at', - 'dest@generic', + # 'gateway.test.ac.at', + # 'dest@generic', 'fp_root_test_path') - @patch('__builtin__.open', side_effect=[OSError(errno.EPERM)]) - def test_fail_open_mk_job_template(self, mock_open): - with pytest.raises(SystemExit): - mk_job_template('testuser', - 'testgroup', - 'gateway.test.ac.at', - 'dest@generic', - 'fp_root_test_path') +# @patch('builtins.open', side_effect=[OSError(errno.EPERM)]) +# def test_fail_open_mk_job_template(self, mock_open): +# with pytest.raises(SystemExit): +# mk_job_template('testuser', +# 'testgroup', +# 'gateway.test.ac.at', +# 'dest@generic', +# 'fp_root_test_path') @classmethod def teardown_class(self): diff --git a/Source/Pythontest/TestUIOFiles.py b/Source/Pythontest/TestUIOFiles.py index c5018b75c61ae93b705f9af847c3fdb6cb4118e1..3c7a10b0ad1907192ad9df8ac414a76003d96557 100644 --- a/Source/Pythontest/TestUIOFiles.py +++ b/Source/Pythontest/TestUIOFiles.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os @@ -50,10 +50,10 @@ class TestUioFiles(): def test_str_(self): """Test if list of file is correctly converted to string.""" - self.expected = "FCSH__SL.20160410.40429.16424.grb, "\ - "FCSH__ML.20160410.40429.16424.grb, "\ + self.expected = "FCOG__ML.20160410.40429.16424.grb, "\ "FCOG__SL.20160410.40429.16424.grb, "\ - "FCOG__ML.20160410.40429.16424.grb, "\ + "FCSH__ML.20160410.40429.16424.grb, "\ + "FCSH__SL.20160410.40429.16424.grb, "\ "OG_OROLSM__SL.20160410.40429.16424.grb, "\ "FCGG__SL.20160410.40429.16424.grb, "\ "FCOG_acc_SL.20160409.40429.16424.grb" diff --git a/Source/Pythontest/_config_test.py b/Source/Pythontest/_config_test.py index e9fcca456ab557c808a76a7b91ab10f92b81d97f..71645bb100b0f764cc437bc0b5446b59c0878ad0 100644 --- a/Source/Pythontest/_config_test.py +++ b/Source/Pythontest/_config_test.py @@ -9,7 +9,7 @@ @Change History: @License: - (C) Copyright 2014-2018. + (C) Copyright 2014-2020. This software is licensed under the terms of the Apache Licence Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/Source/Pythontest/leos_test_suit.py b/Source/Pythontest/leos_test_suit.py deleted file mode 100755 index 6cd9ed7cfb41cd7faf5b1f5487524535216a889d..0000000000000000000000000000000000000000 --- a/Source/Pythontest/leos_test_suit.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -#******************************************************************************* -# @Author: Leopold Haimberger (University of Vienna) -# -# @Date: December 2015 -# -# @Change History: -# -# February 2018 - Anne Philipp (University of Vienna): -# - applied PEP8 style guide -# - added documentation -# -# @License: -# (C) Copyright 2015-2018. -# -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. -# -# @Program Functionality: -# This script triggers the flex_extract test suite. Call with -# test_suite.py [test group] -# -# @Program Content: -# -#******************************************************************************* - -# ------------------------------------------------------------------------------ -# MODULES -# ------------------------------------------------------------------------------ -import os -import sys -import json -import subprocess - -# ------------------------------------------------------------------------------ -# PROGRAM -# ------------------------------------------------------------------------------ -try: - taskfile = open('test_suite.json') -except IOError: - print 'could not open suite definition file test_suite.json' - exit() - -if not os.path.isfile('../src/CONVERT2'): - print '../src/CONVERT2 could not be found' - print 'please run "install.py --target=local" first' - exit() - -fprs = os.getenv('FLEXPART_ROOT_SCRIPTS') -if fprs is None: - print 'FLEXPART_ROOT_SCRIPTS not set .. some test jobs may fail' - -tasks = json.load(taskfile, encoding='latin-1') -taskfile.close() -if not os.path.exists('../test'): - os.makedirs('../test') -if len(sys.argv) > 1: - groups = sys.argv[1:] -else: - groups = ['xinstall', 'default', 'ops', 'work', 'cv', 'fc']#,'hires'] -jobcounter = 0 -jobfailed = 0 -for g in groups: - try: - tk, tv = g, tasks[g] - finally: - pass - garglist = [] - for ttk, ttv in tv.iteritems(): - if isinstance(ttv, basestring): - if ttk != 'script': - garglist.append('--' + ttk) - if ttv[0] == '$': - garglist.append(os.path.expandvars(ttv)) - else: - garglist.append(ttv) - for ttk, ttv in tv.iteritems(): - if isinstance(ttv, dict): - arglist = [] - for tttk, tttv in ttv.iteritems(): - if isinstance(tttv, basestring): - arglist.append('--' + tttk) - if '$' in tttv[0]: - arglist.append(os.path.expandvars(tttv)) - else: - arglist.append(tttv) - print 'Command: ', ' '.join([tv['script']] + garglist + arglist) - o = '../test/' + tk + '_' + ttk + '_' + '_'.join(ttv.keys()) - print 'Output will be sent to ', o - f = open(o, 'w') - try: - p = subprocess.check_call([tv['script']] + garglist + arglist, - stdout=f, stderr=f) - except subprocess.CalledProcessError as e: - f.write('\nFAILED\n') - print 'FAILED' - jobfailed += 1 - jobcounter += 1 - f.close() - -print 'Test suite tasks completed' -print str(jobcounter-jobfailed) + ' successful, ' + str(jobfailed) + ' failed' -print 'If tasks have been submitted via ECACCESS please check emails' diff --git a/Source/Pythontest/leos_testsuite.json b/Source/Pythontest/leos_testsuite.json deleted file mode 100644 index ffc9b4392c74348bb9a70ac8c3fa35de975cd30a..0000000000000000000000000000000000000000 --- a/Source/Pythontest/leos_testsuite.json +++ /dev/null @@ -1,79 +0,0 @@ -{ -"install": { -"script": "install.py", -"control": null, -"inputdir": null, -"ecuid":"lh0", -"ecgid":"spatlh00", -"gateway":"srvx7.img.univie.ac.at", -"destination":"leo@genericSftp", -"local": {"target":"local"}, -"local_flexpart": {"target":"local","flexpart_root_scripts":"$FLEXPART_ROOT_SCRIPTS"}, -"ecgate": {"target":"ecgate"}, -"cca": {"target":"cca"} -}, -"default": { -"script": "submit.py", -"control": null, -"inputdir": null, -"start_date": "20131107", -"local": {}, -"local_flexpart": {"flexpart_root_scripts":"$FLEXPART_ROOT_SCRIPTS"}, -"ecgate": {"queue":"ecgate"}, -"cca": {"queue":"cca"} -}, -"work": { -"script": "submit.py", -"control": null, -"start_date": "20131107", -"inputdir": "$SCRATCH/work", -"local_flexpart": {"flexpart_root_scripts":"$FLEXPART_ROOT_SCRIPTS"} -}, -"fc": { -"script": "submit.py", -"control": "CONTROL_FC", -"inputdir": "$SCRATCH/workfc", -"local_flexpart": {"flexpart_root_scripts":"$FLEXPART_ROOT_SCRIPTS"} -}, -"cv": { -"script": "submit.py", -"control": "CONTROL_CV", -"inputdir": "$SCRATCH/workcv", -"start_date": "20131107", -"local_flexpart": {"flexpart_root_scripts":"$FLEXPART_ROOT_SCRIPTS"} -}, -"hires": { -"script": "submit.py", -"control": "CONTROL_HIRES", -"inputdir": "$SCRATCH/workhires", -"local_flexpart": {"flexpart_root_scripts":"$FLEXPART_ROOT_SCRIPTS"}, -"ecgate": {"queue":"ecgate"} -}, -"hiresgauss": { -"script": "submit.py", -"control": "CONTROL_HIRESGAUSS", -"inputdir": "$SCRATCH/workhiresgauss", -"basetime": "00", -"local_flexpart": {"flexpart_root_scripts":"$FLEXPART_ROOT_SCRIPTS"}, -"ecgate": {"queue":"ecgate"}, -"cca": {"queue":"cca"} -}, -"ops": { -"script": "submit.py", -"start_date": "20131108", -"control": "CONTROL_OPS_V6.0_4V.temp", -"inputdir": "$SCRATCH/workops2", -"local_flexpart": {"basetime":"00"}, -"local_flexpart12": {"basetime":"12"}, -"ecgate": {"queue":"ecgate","basetime":"00"} -}, -"opsfc": { -"script": "submit.py", -"start_date": "20131108", -"control": "CONTROL_OPS_V6.0", -"inputdir": "$SCRATCH/workopsfc", -"local_flexpart": {"basetime":"00"}, -"local_flexpart12": {"basetime":"12"}, -"ecgate": {"queue":"ecgate","basetime":"00"} -} -} \ No newline at end of file diff --git a/Testing/Regression/Unit/Controls/CONTROL.test b/Testing/Regression/Unit/Controls/CONTROL.test index 46b4008b87a0084ad1fbcd2b83255b8c63716efa..3d5e7c28a44733a98b491ba65a6d1b094aa05dd3 100644 --- a/Testing/Regression/Unit/Controls/CONTROL.test +++ b/Testing/Regression/Unit/Controls/CONTROL.test @@ -1,14 +1,23 @@ -DTIME 3 -TYPE AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC -TIME 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12 -STEP 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11 -CLASS EI +START_DATE 20180809 +DTIME 1 +TYPE AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN +TIME 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 +STEP 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +ACCTYPE FC +ACCTIME 06/18 +ACCMAXSTEP 12 +CLASS EA STREAM OPER -EXPVER 1 -GRID 5000 -LEFT -10000 -LOWER 30000 -UPPER 40000 -RIGHT 10000 -LEVELIST 59/to/60 -RESOL 63 +GRID 0.28125 +LEFT -24. +LOWER 9.875 +UPPER 74. +RIGHT 60.375 +LEVELIST 1/to/137 +RESOL 799 +ETA 1 +FORMAT GRIB2 +PREFIX EA +CWC 1 +RRINT 1 +ECTRANS 1 diff --git a/Testing/Regression/Unit/InstallTar/mk_install_tar.sh b/Testing/Regression/Unit/InstallTar/mk_install_tar.sh index 2a6bc413cd7ff208cd364bc3a9647a01dba4440f..0b388d2624bc984208f9d5b5a6b977c2756d691a 100755 --- a/Testing/Regression/Unit/InstallTar/mk_install_tar.sh +++ b/Testing/Regression/Unit/InstallTar/mk_install_tar.sh @@ -10,7 +10,7 @@ # path to flex_extract base directory path=../../ -tarname='flex_extract_v7.1_local.tar' +tarname='flex_extract_v7.1.2_local.tar' pwd tar -zcvf ../../Testing/Regression/Unit/InstallTar/$tarname \ ${path}Source/Python/Classes/*py \ @@ -20,24 +20,21 @@ tar -zcvf ../../Testing/Regression/Unit/InstallTar/$tarname \ ${path}Source/Fortran/*.f90 \ ${path}Source/Fortran/*.h \ ${path}Source/Fortran/makefile* \ - ${path}Templates/convert.nl \ - ${path}Templates/*.temp \ - ${path}Templates/ecmwf_grib1_table_128 \ + ${path}Templates/* \ ${path}Run/run_local.sh \ ${path}Run/Control/CONTROL* \ - --exclude=${path}Run/Control/Testgrid \ - --exclude=${path}Run/Control/notPublic \ - ${path}Run/Jobscripts \ - ${path}LICENSE.md \ - ${path}CODE_OF_CONDUCT.md \ - ${path}README.md \ - ${path}Testing/* \ + ${path}Run/Jobscripts/*.md \ + ${path}*.md \ + ${path}Testing/Installation/*.sh \ + ${path}Testing/Installation/Api_testscripts/* \ + ${path}Testing/Installation/Calc_etadot/* \ + ${path}Testing/Installation/First_extraction/* \ --exclude=*.ksh \ --exclude=flex_extract_v7.1_*.tar -tarname='flex_extract_v7.1_ecgate.tar' +tarname='flex_extract_v7.1.2_ecgate.tar' tar -zcvf ../../Testing/Regression/Unit/InstallTar/$tarname \ ${path}Source/Python/Classes/*py \ @@ -47,19 +44,18 @@ tar -zcvf ../../Testing/Regression/Unit/InstallTar/$tarname \ ${path}Source/Fortran/*.f90 \ ${path}Source/Fortran/*.h \ ${path}Source/Fortran/makefile* \ - ${path}Templates/convert.nl \ - ${path}Templates/*.temp \ - ${path}Templates/ecmwf_grib1_table_128 \ + ${path}Templates/* \ ${path}Run/ECMWF_ENV \ ${path}Run/run.sh \ ${path}Run/Control/CONTROL* \ - --exclude=${path}Run/Control/Testgrid \ - --exclude=${path}Run/Control/notPublic \ - ${path}Run/Jobscripts \ + ${path}Run/Jobscripts/*.md \ ${path}LICENSE.md \ ${path}CODE_OF_CONDUCT.md \ ${path}README.md \ - ${path}Testing/* \ + ${path}Testing/Installation/*.sh \ + ${path}Testing/Installation/Api_testscripts/* \ + ${path}Testing/Installation/Calc_etadot/* \ + ${path}Testing/Installation/First_extraction/* \ --exclude=*.ksh \ --exclude=flex_extract_v7.1_*.tar diff --git a/Testing/Regression/Unit/Testfiles/compilejob.test b/Testing/Regression/Unit/Testfiles/compilejob.test index 3a4646f868234a3db43d23a818ec38b89b6f1ba6..3992ad2870ee694f10f4490265876c2340894085 100644 --- a/Testing/Regression/Unit/Testfiles/compilejob.test +++ b/Testing/Regression/Unit/Testfiles/compilejob.test @@ -24,23 +24,22 @@ ##PBS -l EC_memory_per_task=3200MB set -x -export VERSION=7.1 +export VERSION=7.1.2 case ${HOST} in *ecg*) module unload grib_api - module unload eccodes - module load eccodes - module load python module unload emos + module load python3 + module load eccodes module load emos/455-r64 export FLEXPART_ROOT_SCRIPTS=fp_root_test_path export MAKEFILE=Makefile.TEST ;; *cca*) module switch PrgEnv-cray PrgEnv-intel + module load python3 module load eccodes - module load emos - module load python + module load emos/455-r64 echo ${GROUP} echo ${HOME} echo ${HOME} | awk -F / '{print $1, $2, $3, $4}' @@ -54,11 +53,11 @@ esac mkdir -p ${FLEXPART_ROOT_SCRIPTS}/flex_extract_v${VERSION} cd ${FLEXPART_ROOT_SCRIPTS}/flex_extract_v${VERSION} # if FLEXPART_ROOT is not set this means cd to the home directory tar -xvf ${HOME}/flex_extract_v${VERSION}.tar -cd source/fortran -\rm *.o *.mod CONVERT2 +cd Source/Fortran +\rm *.o *.mod calc_etadot make -f ${MAKEFILE} >flexcompile 2>flexcompile -ls -l CONVERT2 >>flexcompile +ls -l calc_etadot >>flexcompile if [ $? -eq 0 ]; then echo 'SUCCESS!' >>flexcompile mail -s flexcompile.${HOST}.$$ ${USER} <flexcompile diff --git a/Testing/Regression/Unit/Testfiles/job.temp.test b/Testing/Regression/Unit/Testfiles/submitscript.template.test similarity index 51% rename from Testing/Regression/Unit/Testfiles/job.temp.test rename to Testing/Regression/Unit/Testfiles/submitscript.template.test index 23424a3a873daf2cecd1ec99161d3e9286a3f083..606847c525ae9868e5593c46b80592aa08ad5c06 100644 --- a/Testing/Regression/Unit/Testfiles/job.temp.test +++ b/Testing/Regression/Unit/Testfiles/submitscript.template.test @@ -16,7 +16,7 @@ ##PBS -N flex_ecmwf ##PBS -q np ##PBS -S /usr/bin/ksh -## -o /scratch/ms/testgroup/testuser/flex_ecmwf.${PBS_JOBID}.out +## -o /scratch/ms/testgroup/testuser/flex_ecmwf.$${PBS_JOBID}.out ## job output is in .ecaccess_DO_NOT_REMOVE ##PBS -j oe ##PBS -V @@ -24,54 +24,54 @@ ##PBS -l EC_memory_per_task=32000MB set -x -export VERSION=7.1 -case ${HOST} in +export VERSION=7.1.2 +case $${HOST} in *ecg*) - module load python module unload grib_api - module unload eccodes - module load eccodes module unload emos + module load python3 + module load eccodes module load emos/455-r64 - export PATH=${PATH}:fp_root_test_path/flex_extract_v7.1/source/python + export PATH=$${PATH}:fp_root_test_path/flex_extract_v7.1.2/Source/Python ;; *cca*) module switch PrgEnv-cray PrgEnv-intel + module load python3 module load eccodes - module load emos - module load python - export SCRATCH=${TMPDIR} - export PATH=${PATH}:fp_root_test_path/flex_extract_v7.1/source/python + module load emos/455-r64 + export SCRATCH=$${TMPDIR} + export PATH=$${PATH}:fp_root_test_path/flex_extract_v7.1.2/Source/Python ;; esac -cd ${SCRATCH} -mkdir -p python$$ -cd python$$ +cd $${SCRATCH} +mkdir -p extract$$$$ +cd extract$$$$ export CONTROL=CONTROL -cat >${CONTROL}<<EOF +cat >$${CONTROL}<<EOF +$control_content EOF -submit.py --controlfile=${CONTROL} --inputdir=./work --outputdir=./work 1> prot 2>&1 +submit.py --controlfile=$${CONTROL} --inputdir=./work --outputdir=./work 1> prot 2>&1 if [ $? -eq 0 ] ; then l=0 - for muser in `grep -i MAILOPS ${CONTROL}`; do - if [ ${l} -gt 0 ] ; then - mail -s flex.${HOST}.$$ ${muser} <prot + for muser in `grep -i MAILOPS $${CONTROL}`; do + if [ $${l} -gt 0 ] ; then + mail -s flex.$${HOST}.$$$$ $${muser} <prot fi - l=$((${l}+1)) + l=$(($${l}+1)) done else l=0 - for muser in `grep -i MAILFAIL ${CONTROL}`; do - if [ ${l} -gt 0 ] ; then - mail -s "ERROR! flex.${HOST}.$$" ${muser} <prot + for muser in `grep -i MAILFAIL $${CONTROL}`; do + if [ $${l} -gt 0 ] ; then + mail -s "ERROR! flex.$${HOST}.$$$$" $${muser} <prot fi - l=$((${l}+1)) + l=$(($${l}+1)) done fi