if mode == "fuzzingserver": webdir = File(pkg_resources.resource_filename("autobahntestsuite", "web/fuzzingserver")) curdir = File(".") webdir.putChild("cwd", curdir) web = Site(webdir) reactor.listenTCP(spec.get("webport", 8080), web) ## use TLS server key/cert from spec, but allow overriding from cmd line if not o.opts["key"]: o.opts["key"] = spec.get("key", None) if not o.opts["cert"]: o.opts["cert"] = spec.get("cert", None) factory = FuzzingServerFactory(spec, debug) listenWS(factory, createWssContext(o, factory)) elif mode == "fuzzingclient": factory = FuzzingClientFactory(spec, debug) # no connectWS done here, since this is done within # FuzzingClientFactory automatically to orchestrate tests else: raise Exception("logic error") elif mode in ["testeeclient", "testeeserver"]: wsuri = str(o.opts["wsuri"]) if mode == "testeeserver":
mode = str(o.opts['mode']) if mode in ['fuzzingclient', 'fuzzingserver']: spec = str(o.opts['spec']) spec = json.loads(open(spec).read()) if mode == 'fuzzingserver': ## use TLS server key/cert from spec, but allow overriding from cmd line if not o.opts['key']: o.opts['key'] = spec.get('key', None) if not o.opts['cert']: o.opts['cert'] = spec.get('cert', None) factory = FuzzingServerFactory(spec, debug) context = createWssContext(o, factory) listenWS(factory, context) webdir = File(pkg_resources.resource_filename("autobahntestsuite", "web/fuzzingserver")) curdir = File('.') webdir.putChild('cwd', curdir) web = Site(webdir) if factory.isSecure: reactor.listenSSL(spec.get("webport", 8080), web, context) else: reactor.listenTCP(spec.get("webport", 8080), web) elif mode == 'fuzzingclient': factory = FuzzingClientFactory(spec, debug) # no connectWS done here, since this is done within
testData = loadTestData() if mode in ["fuzzingclient", "fuzzingserver", "fuzzingwampclient", "fuzzingwampserver"]: spec = str(o.opts["spec"]) spec = json.loads(open(spec).read()) if mode == "fuzzingserver": ## use TLS server key/cert from spec, but allow overriding from cmd line if not o.opts["key"]: o.opts["key"] = spec.get("key", None) if not o.opts["cert"]: o.opts["cert"] = spec.get("cert", None) factory = FuzzingServerFactory(spec, debug) factory.testData = testData context = createWssContext(o, factory) listenWS(factory, context) webdir = File(pkg_resources.resource_filename("autobahntestsuite", "web/fuzzingserver")) curdir = File(".") webdir.putChild("cwd", curdir) web = Site(webdir) if factory.isSecure: reactor.listenSSL(spec.get("webport", 8080), web, context) else: reactor.listenTCP(spec.get("webport", 8080), web) elif mode == "fuzzingclient": factory = FuzzingClientFactory(spec, debug)