import unittest import logging import subprocess import json class ClusterBenchTestCase(unittest.TestCase): logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') def setUp(self) -> None: # pylint: disable=useless-parent-delegation return super().setUp() def test_clusterbench_submit(self): logging.info('test_clusterbench_submit') subprocess.run('pip list', shell=True, check=True, executable='/bin/bash') command = 'clusterbench-submit --cluster-id \'dummy\' --arch-regexp "intel_core.*" --benchmark-id \'mamul1\' --config \'{"compiler_id": "gfortran", "matrix_size": 1024, "num_loops":10}\' --results-dir /tmp/mamul1_out' subprocess.run(command, shell=True, check=True, executable='/bin/bash') def test_clusterbench_hibench(self): logging.info('test_clusterbench_hibench') config = { 'compiler_id': 'gfortran', 'test_id': 'arch4_quick', 'hibridon_version': 'a3bed1c3ccfbca572003020d3e3d3b1ff3934fad', 'cmake_path': 'cmake', 'num_cores': 2, } command = f'clusterbench-submit --cluster-id \'dummy\' --benchmark-id \'hibench\' --config \'{json.dumps(config)}\' --results-dir /tmp/hibench_out' subprocess.run(command, shell=True, check=True, executable='/bin/bash') if __name__ == '__main__': unittest.main()