minor, add diagnosis to smoke test
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/bf261148 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/bf261148 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/bf261148 Branch: refs/heads/KYLIN-1726 Commit: bf26114866d9b4f8dcb5e13c48acdbf6c8e308e9 Parents: be7751b Author: lidongsjtu <lid...@apache.org> Authored: Fri Sep 9 12:37:05 2016 +0800 Committer: lidongsjtu <lid...@apache.org> Committed: Fri Sep 9 12:37:05 2016 +0800 ---------------------------------------------------------------------- build/smoke-test/smoke-test.sh | 1 + build/smoke-test/testDiag.py | 44 +++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/bf261148/build/smoke-test/smoke-test.sh ---------------------------------------------------------------------- diff --git a/build/smoke-test/smoke-test.sh b/build/smoke-test/smoke-test.sh index 06d930a..c21bd6d 100755 --- a/build/smoke-test/smoke-test.sh +++ b/build/smoke-test/smoke-test.sh @@ -67,6 +67,7 @@ sleep 3m cd $dir/smoke-test python testBuildCube.py || { exit 1; } python testQuery.py || { exit 1; } +python testDiag.py || { exit 1; } cd - # Tear down stage http://git-wip-us.apache.org/repos/asf/kylin/blob/bf261148/build/smoke-test/testDiag.py ---------------------------------------------------------------------- diff --git a/build/smoke-test/testDiag.py b/build/smoke-test/testDiag.py new file mode 100644 index 0000000..cc932da --- /dev/null +++ b/build/smoke-test/testDiag.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This is python unittest used in smoke-test.sh, aim to testing query via rest APIs. + +import unittest +import requests + +class testDiag(unittest.TestCase): + def setUp(self): + pass + + def tearDown(self): + pass + + def testDiag(self): + url = "http://sandbox:7070/kylin/api/diag/project/learn_kylin/download" + headers = { + 'content-type': "application/json", + 'authorization': "Basic QURNSU46S1lMSU4=", + 'cache-control': "no-cache" + } + + response = requests.get(url, headers = headers) + self.assertEqual(response.status_code, 200, 'Diagnosis failed.') + + +if __name__ == '__main__': + print 'Test Diagnogis for Kylin sample.' + unittest.main()