diff options
author | Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> | 2009-10-27 10:46:06 +0200 |
---|---|---|
committer | Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> | 2009-10-27 10:46:06 +0200 |
commit | c340ac0e5d1358b0a4a355a67b1e8349a8290665 (patch) | |
tree | 1c0922ad46226f5e4e0b106feca26b1a081f314f | |
parent | cfde5c1dfb4f01bcddca2f4fc5d40430169d32d3 (diff) |
libcontextprovider, protocol change: initial multiprovider customer tests, ping pong
4 files changed, 72 insertions, 0 deletions
diff --git a/libcontextprovider/customer-tests/multiprovider/env.sh b/libcontextprovider/customer-tests/multiprovider/env.sh new file mode 100755 index 00000000..df63b533 --- /dev/null +++ b/libcontextprovider/customer-tests/multiprovider/env.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +export PYTHONPATH=$PYTHONPATH:../../../python +export CONTEXT_PROVIDERS=. +export LD_LIBRARY_PATH=../../src/.libs:../../../libcontextprovider/src/.libs +export PATH=../../../python:../../libcontextprovider/context-provide:../../../libcontextsubscriber/cli:../../../libcontextsubscriber/cls:$PATH diff --git a/libcontextprovider/customer-tests/multiprovider/multiprovider.py b/libcontextprovider/customer-tests/multiprovider/multiprovider.py new file mode 100644 index 00000000..71472a75 --- /dev/null +++ b/libcontextprovider/customer-tests/multiprovider/multiprovider.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +## +## This file is part of ContextKit. +## +## Copyright (C) 2008, 2009 Nokia. All rights reserved. +## +## Contact: Marius Vollmer <marius.vollmer@nokia.com> +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public License +## version 2.1 as published by the Free Software Foundation. +## +## This library is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +## 02110-1301 USA +## +## +## Requires python2.5-gobject and python2.5-dbus +## + +import sys +import unittest +import os +from ContextKit.cltool import CLTool + +class MultiProvider(unittest.TestCase): + def tearDown(self): + #os.unlink('./context-provide.context') + #os.unlink('./context-provide2.context') + pass + + def testPingPong(self): + """ + + """ + provider = CLTool("context-provide", "--v2", "--system", "com.nokia.test", + "int","test.int","1", + "string","test.string","foobar", + "double","test.double","2.5", + "truth","test.truth","True") + provider.send("dump") + provider2 = CLTool("context-provide", "--v2", "--session", "com.nokia.test2", + "int","test.int","1", + "string","test.string","foobar", + "double","test.double","2.5", + "truth","test.truth","True") + provider2.send("dump context-provide2.context") + + +if __name__ == "__main__": + sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 1) + unittest.main() diff --git a/libcontextprovider/customer-tests/multiprovider/test.sh b/libcontextprovider/customer-tests/multiprovider/test.sh new file mode 100755 index 00000000..bbd65570 --- /dev/null +++ b/libcontextprovider/customer-tests/multiprovider/test.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +for file in *.py; do + python2.5 $file +done
\ No newline at end of file diff --git a/libcontextprovider/customer-tests/runTests.sh b/libcontextprovider/customer-tests/runTests.sh index c88e5967..c1e458c7 100755 --- a/libcontextprovider/customer-tests/runTests.sh +++ b/libcontextprovider/customer-tests/runTests.sh @@ -19,6 +19,9 @@ do make -C $i check-customer done +echo "Running multiproviders customer check" +cd multiprovider; . ./env.sh; ./test.sh ; cd .. + if [ -n "$COVERAGE" ] then echo "computing coverage" |