4Construct an xl configuration file for a test (from various fragments), and
5substitue variables appropriately.
11_, out, defcfg, vcpus, extracfg, varycfg = sys.argv
14_, env, name = out.split(
'.')[0].split(
'-', 2)
19 parts = name.split(
'~', 1)
20 name, variation = parts[0],
'~' + parts[1]
23 """ Expand certain variables in text """
25 .replace(
"@@NAME@@", name)
26 .replace(
"@@ENV@@", env)
27 .replace(
"@@VCPUS@@", vcpus)
28 .replace(
"@@XTFDIR@@", os.environ[
"xtfdir"])
29 .replace(
"@@VARIATION@@", variation)
32config = open(defcfg).read()
35 config +=
"\n# Test Extra Configuration:\n"
36 config += open(extracfg).read()
39 config +=
"\n# Test Variation Configuration:\n"
40 config += open(varycfg).read()
44open(out,
"w").write(cfg)