diff options
author | Magnus Ahltorp <map@kth.se> | 2016-10-05 10:06:16 +0200 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2016-10-05 10:08:43 +0200 |
commit | 1d902cd5813a2df252b6976bdcdc9cd7531590b4 (patch) | |
tree | cef355f80032c5e15893a5d96c52728d9b71b7d8 /tools/compileconfig.py | |
parent | 49b40a0170b80b204746ab3bc42a73c5c60bcf0c (diff) |
Move tests to shell scripts
Diffstat (limited to 'tools/compileconfig.py')
-rwxr-xr-x | tools/compileconfig.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/compileconfig.py b/tools/compileconfig.py index 9acc702..cee9873 100755 --- a/tools/compileconfig.py +++ b/tools/compileconfig.py @@ -354,7 +354,7 @@ def gen_config(nodename, config, localconfig): configfile.close() -def gen_testmakefile(config, testmakefile, machines): +def gen_testmakefile(config, testmakefile, machines, shellvars=False): configfile = open(testmakefile, "w") frontendnodenames = set([node["name"] for node in config["frontendnodes"]]) storagenodenames = set([node["name"] for node in config["storagenodes"]]) @@ -368,11 +368,13 @@ def gen_testmakefile(config, testmakefile, machines): signingnodeaddresses = [node["address"] for node in config["signingnodes"]] mergenodeaddresses = [node["address"] for node in config["mergenodes"] if node["name"] != config["primarymergenode"]] - print >>configfile, "NODES=" + " ".join(frontendnodenames|storagenodenames|signingnodenames|mergenodenames) - print >>configfile, "ERLANGNODES=" + " ".join(erlangnodenames) - print >>configfile, "MACHINES=" + " ".join([str(e) for e in range(1, machines+1)]) - print >>configfile, "TESTURLS=" + " ".join(frontendnodeaddresses+storagenodeaddresses+signingnodeaddresses+mergenodeaddresses) - print >>configfile, "BASEURL=" + config["baseurl"] + delimiter = '"' if shellvars else '' + + print >>configfile, "NODES=" + delimiter + " ".join(frontendnodenames|storagenodenames|signingnodenames|mergenodenames) + delimiter + print >>configfile, "ERLANGNODES=" + delimiter + " ".join(erlangnodenames) + delimiter + print >>configfile, "MACHINES=" + delimiter + " ".join([str(e) for e in range(1, machines+1)]) + delimiter + print >>configfile, "TESTURLS=" + delimiter + " ".join(frontendnodeaddresses+storagenodeaddresses+signingnodeaddresses+mergenodeaddresses) + delimiter + print >>configfile, "BASEURL=" + delimiter + config["baseurl"] + delimiter configfile.close() @@ -382,12 +384,15 @@ def main(): parser.add_argument('--config', help="System configuration", required=True) parser.add_argument('--localconfig', help="Local configuration") parser.add_argument("--testmakefile", metavar="file", help="Generate makefile variables for test") + parser.add_argument("--testshellvars", metavar="file", help="Generate shell variable file for test") parser.add_argument("--machines", type=int, metavar="n", help="Number of machines") args = parser.parse_args() config = yaml.load(open(args.config)) if args.testmakefile and args.machines: gen_testmakefile(config, args.testmakefile, args.machines) + elif args.testshellvars and args.machines: + gen_testmakefile(config, args.testshellvars, args.machines, shellvars=True) elif args.localconfig: localconfig = yaml.load(open(args.localconfig)) localnodes = localconfig["localnodes"] |