diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2016-12-24 23:08:46 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2016-12-30 15:38:08 +0000 |
commit | 64605f1cc7117854abb203375deee396e0d65cc1 (patch) | |
tree | 42f863658d915c45b18996be37271813385d3f33 /utils/test/reporting/api | |
parent | 53ed9e36a13d03455fc04b3f54ed290037359f6b (diff) |
Create Test Reporting landing page
JIRA: RELENG-165
In this patch, I do the follow things:
1.deploy tornado server(currently I haven't write any backend code,
since the backend code depend on the testapi and I need to
communicate with Serena).
2.landing page code(almostly finished. But I haven't the data, so
for now, the data this page shows is a mock json. When the testapi
and my backend code ready, this page will finally finished)
3.deployment: supervisor + nginx + tornado + angular
usage:
docker run -itd -p 8000:8000 opnfv/reporting:<tag>
visit landing page:
http://server_ip:8000/reporting/index.html
test api:
http://server_ip:8000/landing-page/filters
visit old reporting page:
http://server_ip:8000/display/master/yardstick/status-apex.html
Change-Id: I527ab2661ce9e84b2942ebe673afbf5f2bc7878f
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'utils/test/reporting/api')
-rw-r--r-- | utils/test/reporting/api/__init__.py | 0 | ||||
-rw-r--r-- | utils/test/reporting/api/handlers/__init__.py | 0 | ||||
-rw-r--r-- | utils/test/reporting/api/handlers/landing.py | 20 | ||||
-rw-r--r-- | utils/test/reporting/api/server.py | 27 | ||||
-rw-r--r-- | utils/test/reporting/api/urls.py | 14 |
5 files changed, 61 insertions, 0 deletions
diff --git a/utils/test/reporting/api/__init__.py b/utils/test/reporting/api/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/utils/test/reporting/api/__init__.py diff --git a/utils/test/reporting/api/handlers/__init__.py b/utils/test/reporting/api/handlers/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/utils/test/reporting/api/handlers/__init__.py diff --git a/utils/test/reporting/api/handlers/landing.py b/utils/test/reporting/api/handlers/landing.py new file mode 100644 index 000000000..137c05007 --- /dev/null +++ b/utils/test/reporting/api/handlers/landing.py @@ -0,0 +1,20 @@ +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from tornado.web import RequestHandler +from tornado.escape import json_encode + + +class FiltersHandler(RequestHandler): + def get(self): + return self.write(json_encode({'status': 'SUCCESS'})) + + +class ScenariosHandler(RequestHandler): + def get(self): + return self.write(json_encode({'status': 'SUCCESS'})) diff --git a/utils/test/reporting/api/server.py b/utils/test/reporting/api/server.py new file mode 100644 index 000000000..0b00e9389 --- /dev/null +++ b/utils/test/reporting/api/server.py @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +import tornado.ioloop +import tornado.web +from tornado.options import define +from tornado.options import options + +from urls import mappings + +define("port", default=8000, help="run on the given port", type=int) + + +def main(): + tornado.options.parse_command_line() + application = tornado.web.Application(mappings) + application.listen(options.port) + tornado.ioloop.IOLoop.current().start() + + +if __name__ == "__main__": + main() diff --git a/utils/test/reporting/api/urls.py b/utils/test/reporting/api/urls.py new file mode 100644 index 000000000..fcfb2d795 --- /dev/null +++ b/utils/test/reporting/api/urls.py @@ -0,0 +1,14 @@ +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from handlers import landing + +mappings = [ + (r"/landing-page/filters", landing.FiltersHandler), + (r"/landing-page/scenarios", landing.ScenariosHandler) +] |