adding and fixing commands

adding tests
deleting redundant script
This commit is contained in:
ekonstantinov
2013-07-10 15:54:45 +03:00
parent b82ec666cd
commit 18b04f93f1
3 changed files with 18 additions and 8 deletions

View File

@@ -1,4 +0,0 @@
#!/bin/bash
echo $WORKSPACE
[[ ! -z $WORKSPACE ]] || export WORKSPACE=$(pwd)
nosetests -q test_general_flow.py:adapter_tests --with-xunit --xunit-file=$WORKSPACE/functional.xml

View File

@@ -19,7 +19,7 @@ class adapter_tests(unittest.TestCase):
@classmethod
def setUp(cls):
url = 'http://127.0.0.1:8989/v1'
url = 'http://172.18.164.69:8989/v1'
cls.adapter = TestingAdapterClient(url)
cls.tests = {
'fast_pass': 'functional.dummy_tests.general_test.Dummy_test.test_fast_pass',
@@ -42,12 +42,20 @@ class adapter_tests(unittest.TestCase):
"""Verify that self.testsets are in json respons
"""
json = self.adapter.testsets()
for testset in self.testsets:
response_testsets = [item['id'] for item in json]
msg = '"{test}" not in "{response}"'.format(test=testset.capitalize(), response=response_testsets)
self.assertTrue(testset in response_testsets, msg)
self.assertTrue(all(x in (item['id'] for item in json) for x in self.testsets))
def test_list_tests(self):
"""Verify that self.tests are in json response
"""
json = self.adapter.tests()
for test in self.tests.values():
response_tests = [item['id'] for item in json]
msg = '"{test}" not in "{response}"'.format(test=test.capitalize(), response=response_tests)
self.assertTrue(test in response_tests, msg)
self.assertTrue(all(x in (item['id'] for item in json) for x in self.tests.values()))
def test_general_testset(self):
@@ -92,6 +100,11 @@ class adapter_tests(unittest.TestCase):
assertions[self.tests['really_long']]['status'] = 'stopped'
self._verify_json(assertions, json)
def test_testruns(self):
testsets = ["plugin_stopped",
"plugin_general"]
config = {}
cluster_id = 3

View File

@@ -10,7 +10,7 @@ function killapp {
function startapp {
! netstat -nplt | grep 8989 | grep -o [0-9]*/python | grep -o [0-9]* &> /dev/null || { echo "Server exists" && return 1; }
nohup ostf-server --log_file testing.log --host 0.0.0.0 &
sleep 3
sleep 10
nc -xvw 2 0.0.0.0 8989 &> /dev/null || echo "Not working"
}
@@ -26,7 +26,8 @@ function update_tests {
function migrate_db {
service postgresql restart
while ! service postgresql status | grep running &> /dev/null; do sleep 1; done
sleep 30
export PGPASSWORD='ostf'
psql -U postgres -h localhost -c "drop database if exists testing_adapter"
psql -U postgres -h localhost -c "drop user adapter"
@@ -38,5 +39,5 @@ function migrate_db {
function run_functional_tests {
[[ ! -z $WORKSPACE ]] || export WORKSPACE=$(pwd)
nosetests -q test_general_flow.py:adapter_tests --with-xunit --xunit-file=$WORKSPACE/functional.xml
nosetests -q functional/test_general_flow.py:adapter_tests --with-xunit --xunit-file=$WORKSPACE/functional.xml
}