summaryrefslogtreecommitdiff
path: root/test/dbus/validatestate.py
blob: 1af303f155f79c88781c983a0f5d3189e4e6ecb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python3

# Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Simply connects to the dbus service and calls Refresh and ensures that the
# value returned is zero

import testlib
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import sys
import os


if __name__ == "__main__":

	use_session = os.getenv('LVMD_BUSD_USE_SESSION', False)

	if use_session:
		bus = dbus.SessionBus(mainloop=DBusGMainLoop())
	else:
		bus = dbus.SystemBus(mainloop=DBusGMainLoop())

	mgr_proxy = testlib.ClientProxy(bus, testlib.MANAGER_OBJ)
	sys.exit(mgr_proxy.Manager.Refresh())