Author: lslezak
Date: Thu Jun 18 16:44:22 2009
New Revision: 57640
URL: http://svn.opensuse.org/viewcvs/yast?rev=57640&view=rev
Log:
DBus service '--session' command line parameter has been changed to
'--test' - it runs the service on the session bus and disables PolicyKit
checks. It is used in the testsuite, can be useful for
testing/debugging.
Modified:
trunk/core/dbus/namespace_service/src/DBusModulesServer.cc
trunk/core/dbus/namespace_service/src/DBusModulesServer.h
trunk/core/dbus/namespace_service/src/yast_modules_dbus_server.cc
trunk/core/dbus/namespace_service/testsuite/modules/Makefile.am
trunk/core/dbus/namespace_service/testsuite/modules/TEST.ycp
trunk/core/dbus/namespace_service/testsuite/t1
trunk/core/liby2dbus/src/DBusConn.cc
trunk/core/liby2dbus/src/DBusServerBase.cc
trunk/core/liby2dbus/src/DBusServerBase.h
Modified: trunk/core/dbus/namespace_service/src/DBusModulesServer.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/dbus/namespace_service/src/DBusModulesServer.cc?rev=57640&r1=57639&r2=57640&view=diff
==============================================================================
--- trunk/core/dbus/namespace_service/src/DBusModulesServer.cc (original)
+++ trunk/core/dbus/namespace_service/src/DBusModulesServer.cc Thu Jun 18 16:44:22 2009
@@ -229,11 +229,11 @@
}
-DBusModulesServer::DBusModulesServer(const NameSpaceList &name_spaces, bool use_session_bus)
+DBusModulesServer::DBusModulesServer(const NameSpaceList &name_spaces, bool test_mode)
: e(this)
, manager_callback(this)
, wfm(NULL)
- , m_use_session_bus(use_session_bus)
+ , m_test_mode(test_mode)
{
init_wfm();
@@ -317,7 +317,7 @@
bool DBusModulesServer::connect()
{
registerManager();
- return DBusServerBase::connect(m_use_session_bus? SESSION: SYSTEM,
+ return DBusServerBase::connect(m_test_mode ? SESSION : SYSTEM,
YAST_DBUS_SERVICE_NAME);
}
Modified: trunk/core/dbus/namespace_service/src/DBusModulesServer.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/dbus/namespace_service/src/DBusModulesServer.h?rev=57640&r1=57639&r2=57640&view=diff
==============================================================================
--- trunk/core/dbus/namespace_service/src/DBusModulesServer.h (original)
+++ trunk/core/dbus/namespace_service/src/DBusModulesServer.h Thu Jun 18 16:44:22 2009
@@ -24,7 +24,7 @@
typedef std::liststd::string NameSpaceList;
- DBusModulesServer(const NameSpaceList &name_spaces, bool use_session_bus);
+ DBusModulesServer(const NameSpaceList &name_spaces, bool test_mode);
virtual ~DBusModulesServer();
virtual bool connect();
@@ -95,7 +95,7 @@
void init_wfm();
- bool m_use_session_bus;
+ bool m_test_mode;
};
Modified: trunk/core/dbus/namespace_service/src/yast_modules_dbus_server.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/dbus/namespace_service/src/yast_modules_dbus_server.cc?rev=57640&r1=57639&r2=57640&view=diff
==============================================================================
--- trunk/core/dbus/namespace_service/src/yast_modules_dbus_server.cc (original)
+++ trunk/core/dbus/namespace_service/src/yast_modules_dbus_server.cc Thu Jun 18 16:44:22 2009
@@ -11,7 +11,7 @@
bool forever = false;
bool badopts = false;
- bool use_session_bus = false;
+ bool test_mode = false;
DBusModulesServer::NameSpaceList modules;
@@ -29,9 +29,9 @@
{
forever = true;
}
- else if (!strcmp(argv[index], "--session"))
+ else if (!strcmp(argv[index], "--test"))
{
- use_session_bus = true;
+ test_mode = true;
}
else
{
@@ -47,12 +47,13 @@
std::cerr << "Usage: " << argv[0] << " [--help] [--disable-timer] [--session] <namespace> <namespace>..." << std::endl;
std::cerr << " --help Print this text\n";
std::cerr << " --disable-timer Disable automatic shutdown of the service, useful for debugging\n";
- std::cerr << " --session Connect to the session bus (system is the default), useful for debugging\n";
+ std::cerr << " --test Set the test mode - Connect to the session bus (system is the default),\n";
+ std::cerr << " disable PolicyKit checks. Useful for testing or debugging.\n";
std::cerr << " <namespace> Preload an yast namespace and export it on DBus\n";
return 1;
}
- DBusModulesServer server(modules, use_session_bus);
+ DBusModulesServer server(modules, test_mode);
bool connected = server.connect();
if (connected)
Modified: trunk/core/dbus/namespace_service/testsuite/modules/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/dbus/namespace_service/testsuite/modules/Makefile.am?rev=57640&r1=57639&r2=57640&view=diff
==============================================================================
--- trunk/core/dbus/namespace_service/testsuite/modules/Makefile.am (original)
+++ trunk/core/dbus/namespace_service/testsuite/modules/Makefile.am Thu Jun 18 16:44:22 2009
@@ -4,7 +4,7 @@
yast_modules_ybc = $(yast_modules:.ycp=.ybc)
$(yast_modules_ybc): $(yast_modules)
- ycpc -c $<
+ ../../../../base/tools/ycpc/ycpc -c $<
all: $(yast_modules_ybc)
Modified: trunk/core/dbus/namespace_service/testsuite/modules/TEST.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/dbus/namespace_service/testsuite/modules/TEST.ycp?rev=57640&r1=57639&r2=57640&view=diff
==============================================================================
--- trunk/core/dbus/namespace_service/testsuite/modules/TEST.ycp (original)
+++ trunk/core/dbus/namespace_service/testsuite/modules/TEST.ycp Thu Jun 18 16:44:22 2009
@@ -1,4 +1,7 @@
+// This is a testing module for the YaST DBuse service
+// Some methods are not called during tests, but the correct signature is checked in the introspection test
+
{
module "TEST";
@@ -6,7 +9,7 @@
global define list List()
{return [];}
-global define list ListAny()
+global define list<any> ListAny()
{return [];}
global define list ListAny1()
@@ -15,7 +18,6 @@
global define list ListAny2()
{return [["dssd", 123], ["zxcxczzx", 456]];}
-
global define list<string> ListString()
{return ["dssd", "sdfdfs"];}
@@ -67,6 +69,9 @@
global define map MapAny4()
{return $[ "3" : $["l" : ["3", 10, $["a" : "b"]]]];}
+// Note: interger key is returned as string in map