]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/ocf/tests/unit/tests/add_new_test_file.py
4 # Copyright(c) 2012-2018 Intel Corporation
5 # SPDX-License-Identifier: BSD-3-Clause-Clear
12 args
= ' '.join(sys
.argv
[1:])
13 script_path
= os
.path
.dirname(os
.path
.realpath(__file__
))
14 framework_script_path
= script_path
+ os
.sep
+ "../framework/add_new_test_file.py"
15 framework_script_path
= os
.path
.normpath(framework_script_path
)
16 status
, output
= commands
.getstatusoutput(framework_script_path
+ " " + args
)
21 path
= output
.split(" ", 1)[0]
22 with
open(script_path
+ os
.sep
+ "header.c", "r") as header_file
:
23 with
open(path
, "r+") as source_file
:
24 source
= source_file
.readlines()
26 source_file
.seek(0, os
.SEEK_SET
)
27 source_file
.truncate()
29 source_file
.writelines(header_file
.readlines())
30 source_file
.writelines(source
)