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:06:16 +0200 |
commit | 83f6bea56508cd7afe9975aff79880f252371455 (patch) | |
tree | d385ed3cb38cc4a648085f401972896bc3051f5f /tools | |
parent | de5a2c656e7b75b44a39e2f3865c078a4937c338 (diff) |
Move tests to shell scriptslarge-tests
Diffstat (limited to 'tools')
-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"] |