Belle II Software development
test_madgraph_isr.py
1
8
9'''
10Test if MadGraph works when running a simple BSM model.
11'''
12
13
14import os
15import subprocess
16
17import basf2 as b2
18import b2test_utils as b2tu
19
20
21if __name__ == '__main__':
22
23 # FIXME: this test fails on buildbot with the error:
24 # PermissionError : [Errno 13] Permission denied: '{working_dir}/Dark_photon_mass_1_isr/bin/internal/ufomodel/__pycache__'
25 # os.chmod below is supposed to fix this, but it doesn't work.
26 if not b2tu.is_ci():
27 b2tu.skip_test("The test can not be properly run on buildbot.")
28
29 with b2tu.clean_working_directory() as working_dir:
30
31 os.chmod(working_dir, 0o744)
32
33 steering_file = b2.find_file('generators/madgraph/examples/MadGraph_darkphoton_isr.py')
34 subprocess.check_call(['basf2', steering_file, '--random-seed', 'madgraph'])