~ubuntu-branches/ubuntu/jaunty/landscape-client/jaunty-updates

« back to all changes in this revision

Viewing changes to landscape/tests/test_plugin.py

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2009-09-21 17:59:31 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090921175931-4ucv40j9ro26i3lm
Tags: 1.3.2.3-0ubuntu0.9.04.0
* New upstream release (LP: #347983):
  - Don't clear the hash_id_requests table upon resynchronize (LP #417122)
  - Include the README file in landscape-client (LP: #396260)
  - Fix client capturing stderr from run_command when constructing
    hash-id-databases url (LP: #397480)
  - Use substvars to conditionally depend on update-motd or
    libpam-modules (LP: #393454)
  - Fix reporting wrong version to the server (LP: #391225)
  - The init script does not wait for the network to be available
    before checking for EC2 user data (LP: #383336)
  - When the broker is restarted by the watchdog, the state of the client
    is inconsistent (LP: #380633)
  - Package stays unknown forever in the client with hash-id-databases
    support (LP: #381356)
  - Standard error not captured when calling smart-update (LP: #387441)
  - Changer calls reporter without switching groups, just user (LP: #388092)
  - Run smart update in the package-reporter instead of having a cronjob (LP: #362355)
  - Package changer does not inherit proxy settings (LP: #381241)
  - The ./test script doesn't work in landscape-client (LP: #381613)
  - The source package should build on all supported releases (LP: #385098)
  - Strip smart update's output (LP: #387331)
  - The fetch() timeout isn't based on activity (#389224)
  - Client can use a UUID of "None" when fetching the hash-id-database (LP: #381291)
  - Registration should use the fqdn rather than just the hostname (LP: #385730)

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
        self.assertEquals(plugin2.exchanged, 1)
161
161
        self.assertTrue("ZeroDivisionError" in self.logfile.getvalue())
162
162
 
 
163
    def test_broker_restart(self):
 
164
        """
 
165
        When L{BrokerClientPluginRegistry.broker_started} is called, any
 
166
        message types previously registered with the broker are registered
 
167
        again.
 
168
        """
 
169
        result1 = self.registry.register_message("foo", lambda m: None)
 
170
        result2 = self.registry.register_message("bar", lambda m: None)
 
171
        types = []
 
172
        d = Deferred()
 
173
        def register_client_accepted_message_type(type):
 
174
            types.append(type)
 
175
            if len(types) == 2:
 
176
                d.callback(types)
 
177
        def got_result(result):
 
178
            self.registry.broker.register_client_accepted_message_type = \
 
179
                 register_client_accepted_message_type
 
180
            self.registry.broker_started()
 
181
            return d.addCallback(self.assertEquals, ["foo", "bar"])
 
182
        return gather_results([result1, result2]).addCallback(got_result)
 
183
 
163
184
 
164
185
def assertReceivesMessages(test_case, broker_plugin, broker_service, remote):
165
186
    """