def METHOD_NAME(self, allowed_actions, on_bus=None):
    '''Start test polkitd.
    This should be called in your test cases before the exercised code
    makes any polkit query. The daemon will be stopped automatically when
    the test case ends (regardless of whether its successful or failed). If
    you want to test multiple different action sets in one test case, you
    have to call stop_polkitd() before starting a new one.
    @allowed_actions is a list of PolicyKit action IDs which will be
    allowed (active/inactive sessions or user IDs will not be considered);
    all actions not in that list will be denied. If 'all' is an element of
    @allowed_actions, all actions will be allowed.
    When @on_bus string is given, the daemon will run on that D-BUS
    address, otherwise on the system D-BUS.
    '''
    assert self.polkit_pid is None, \
        'can only launch one polkitd at a time; write a separate test case or call stop_polkitd()'
    self.polkit_pid = spawn(allowed_actions, on_bus)
    self.addCleanup(self.stop_polkitd)