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

« back to all changes in this revision

Viewing changes to landscape/sysinfo/tests/test_deployment.py

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2009-12-16 10:50:05 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20091216105005-bmki8i2of1dmcdkc
Tags: 1.4.0-0ubuntu0.9.10.0
* New upstream release (LP: #497351)

* Bug fixes:
  - Fix landscape daemons fail to start when too many groups are
    available (LP: #456124)
  - Fix landscape programs wake up far too much. (LP: #340843)
  - Fix Package manager fails with 'no such table: task' (LP #465846)
  - Fix test suite leaving temporary files around (LP #476418)
  - Fix the 1hr long wait for user data to be uploaded following a
    resynchronisation (LP #369000)

* Add support for Ubuntu release upgrades:
  - Add helper function to fetch many files at once (LP: #450629)
  - Handle release-upgrade messages in the packagemanager
    plugin (LP: #455217)
  - Add a release-upgrader task handler (LP: #462543)
  - Support upgrade-tool environment variables (LP: #463321)

* Add initial support for Smart package locking:
  - Detect and report changes about Smart package locks (#488108)

* Packaging fixes:
  - Turn unnecessary Pre-Depends on python-gobject into a regular Depends
  - If it's empty, remove /etc/landscape upon purge

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
    def test_get_plugins(self):
26
26
        self.configuration.load(["--sysinfo-plugins", "Load,TestPlugin",
27
 
                                 "-d", self.make_path()])
 
27
                                 "-d", self.makeFile()])
28
28
        plugins = self.configuration.get_plugins()
29
29
        self.assertEquals(len(plugins), 2)
30
30
        self.assertTrue(isinstance(plugins[0], Load))
31
31
        self.assertTrue(isinstance(plugins[1], TestPlugin))
32
32
 
33
33
    def test_get_all_plugins(self):
34
 
        self.configuration.load(["-d", self.make_path()])
 
34
        self.configuration.load(["-d", self.makeFile()])
35
35
        plugins = self.configuration.get_plugins()
36
36
        self.assertEquals(len(plugins), len(ALL_PLUGINS))
37
37
 
38
38
    def test_exclude_plugins(self):
39
39
        exclude = ",".join(x for x in ALL_PLUGINS if x != "Load")
40
40
        self.configuration.load(["--exclude-sysinfo-plugins", exclude,
41
 
                                 "-d", self.make_path()])
 
41
                                 "-d", self.makeFile()])
42
42
        plugins = self.configuration.get_plugins()
43
43
        self.assertEquals(len(plugins), 1)
44
44
        self.assertTrue(isinstance(plugins[0], Load))
45
45
 
46
46
    def test_config_file(self):
47
 
        filename = self.make_path()
 
47
        filename = self.makeFile()
48
48
        f = open(filename, "w")
49
49
        f.write("[sysinfo]\nsysinfo_plugins = TestPlugin\n")
50
50
        f.close()
51
 
        self.configuration.load(["--config", filename, "-d", self.make_path()])
 
51
        self.configuration.load(["--config", filename, "-d", self.makeFile()])
52
52
        plugins = self.configuration.get_plugins()
53
53
        self.assertEquals(len(plugins), 1)
54
54
        self.assertTrue(isinstance(plugins[0], TestPlugin))
234
234
                          "/var/log/landscape/sysinfo.log")
235
235
 
236
236
    def test_create_log_dir(self):
237
 
        log_dir = self.make_path()
 
237
        log_dir = self.makeFile()
238
238
        self.assertFalse(os.path.exists(log_dir))
239
239
        setup_logging(landscape_dir=log_dir)
240
240
        self.assertTrue(os.path.exists(log_dir))